Posts

Showing posts from December, 2023

Configuration parameter set in commerce parameter

   If you want to get the value of the configuration parameter set in commerce parameter in commerce runtime, then below is the code you execute,             string parameterValue  = string.Empty;             GetConfigurationParametersDataRequest getConfigurationParametersDataRequest = new GetConfigurationParametersDataRequest(requestContext.GetPrincipal().ChannelId);                 var retailConfigurationParameters = await requestContext.ExecuteAsync<EntityDataServiceResponse<RetailConfigurationParameter>>(getConfigurationParametersDataRequest).ConfigureAwait(false);                 RetailConfigurationParameter retailConfigurationParameter = retailConfigurationParameters.ToList<RetailConfigurationParameter>().SingleOrDefault<RetailConfigurationParameter...

Read key vault secret d365 in CRT extension

If you want to read the key vault secret in the D365 CRT extension, Follow the following steps; First, we have to configure the Key vaults on the D365 HQ side. On the CRT Side you have to implement a class in which you have to write the method below; public static async Task<string> GetKeyVaultValueAsync (string keyVaultName, RequestContext requestContext) { if (string.IsNullOrEmpty(keyVaultName)) { throw new ArgumentNullException("keyVaultName"); } string vaultValue = string.Empty; try {  GetUserDefinedSecretStringValueServiceRequest keyVaultRequest = new GetUserDefinedSecretStringValueServiceRequest(keyVaultName); GetUserDefinedSecretStringValueServiceResponse keyVaultResponse = await requestContext.ExecuteAsync<GetUserDefinedSecretStringValueServiceResponse>(keyVaultRequest).ConfigureAwait(false); if (keyVaultResponse != null) { vaultValue = keyVaultResponse.SecretStringValue; } return vaultValue; } catch (Exception ex)...

Call GetActiveProductPrice API in Commerce runtime dynamics 365

 In this blog, we learn how to call the  GetActiveProductPrice  API in the commerce runtime (CRT).  We take ProductIds from cartLine but you also hardcode the ProductIds.                      CartLine cartLine = ((AddCartLinesRequest)request).CartLines.FirstOrDefault();                 List<long> productIds = new List<long>();                 productIds.Add(cartLine.ProductId);                 ChannelConfiguration channelConfigs = request.RequestContext.GetChannelConfiguration(); Pass this ProductIds in the GetActiveProductPriceRequest and then execute the request.                 GetActiveProductPriceRequest getActiveProductPriceRequest = new                       ...

Deployment of CPOS package on the VM in D365

Image
 If you want to run the CPOS on the VM, then follow the following steps; First download the latest package from LCS save the package in a folder and unzip the package. After unzipping the package go to the path “J:\CPOS Package\ \RetailCloudPOS\Code” and copy the folder “Extensions” and paste this folder to the (path “K:\RetailCloudPos\WebRoot”). (You can skip this project if the Extension folder is already present) Go to the path “J:\CPOS Package\RetailServer\Code\bin\ext” and copy all the files except the “CommerceRuntime.ext.config” and paste these files into the Retail server folder (path “K:\RetailServer\WebRoot\bin\Ext”).    Go to the path “J:\CPOS Package\RetailServer\Code\bin\ext”  and open the file “CommerceRuntime.ext.config” in Notepad++ after opening the file copy all the lines present in the composition tag (<composition>). After copying the lines go to the path “K:\RetailServer\WebRoot\bin\Ext” and open the file “CommerceRuntime.ext.config” After ...

How search is working in D365 using the UseAzureSearch

Image
For D365, searching is working using the Azure search or we can use third-party integration like unbxd for searching but searching is always triggered from Azure search endpoints and we need t o configure cloud-powered search capabilities, following these steps. In Commerce headquarters, go to  Commerce Parameters > Configuration Parameters . Under  Set up the configuration parameters , check that an entry exists for  ProductSearch.UseAzureSearch  and its value is set to  true , as shown in the following example image. If the  ProductSearch.UseAzureSearch  configuration parameter exists and is set to  true , cloud-powered search capabilities have already been configured. If the  ProductSearch.UseAzureSearch  configuration parameter exists but isn't set to  true , set it to  true . If the  ProductSearch.UseAzureSearch  configuration parameter isn't present, continue to the next step. Select  New  to add th...