web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Suggested Answer

RetailSDK Store Hours Sample Operation ID Invalid

(0) ShareShare
ReportReport
Posted on by

Hi, i am currently working on Store Hours Sample and cant been stuck at the end. ive done every step given in the doc but at the end in MPOS it gives me the error Operation ID is invalid. In step 1 it says to set ID 3001, but in ax when i set 3001 it says it wont be applied to a button as operation ID in designer. The steps i followed are:pastedimage1585551538693v1.jpeg
the steps are 

Sample overview:
This sample shows how to create a new business entity (StoreHours) across both AX and the channel.

The changes are in AX tables, CDX, Channel DB, CRT, Retail Server, and POS (both Modern POS and Cloud POS). This sample supports offline mode for Modern POS.

Setup steps:

0. It is advised that you do these changes on an untouched Retail SDK. Ideally, you would have it under source control (VSO, or similar) with no changes so far. This is ideal, as you could revert at any steps without much work. Also, ideally, you would change some specific settings for your whole org, i.e. versioning, naming, etc. See the Retail SDK documentation for details.

1. AX customization:
- Import the project file AXchanges.axpp, compile the project, and run the job.
- Populate the database with some data by running the ContosoRetailStoreHoursInsertTestData job (make it a Startup object and hit F5).
- Create a new operation with ID 3001, add it to a button grid, and run the 1090 Registers job.

2. CDX:
- Initialize the Retail scheduler. Make sure "Delete existing configuration" is checked as "Yes".

3. Channel DB (manual, just for development, for official change, see deployment below):
- Find the ChannelDBUpgrade.sql file from /SampleInstructions/StoreHours.
- Run it and ensure that it succeeds.

4. Verify CDX:
- Run the 1070 job full sync (channel data group).
- Make sure the data has arrived through "Download sessions" and the channel DB.

Note: The CRT and Retail Server code changes are all part of the RetailSdk\SampleExtensions. Therefore, the steps below refer to how to build, deploy and test these.

5. Enable and test CRT sample code:
- Open the solution at RetailSdk\SampleExtensions\CommerceRuntime\CommerceRuntimeSamples.sln.
- Configure the default channel in RetailSdk\Assets\commerceruntime.config:
<storage defaultOperatingUnitNumber="052" />
- Register the new CRT assembly in RetailSdk\Assets\commerceruntime.ext.config (Note: Please DO NOT edit commerceruntime.config file. This file is not meant for any customizations.):
<add source="type" value="Contoso.Commerce.Runtime.StoreHoursSample.StoreHoursDataService, Contoso.Commerce.Runtime.StoreHoursSample" />
- Register the new CRT assembly in RetailSdk\BuildTools\customization.settings:
<ISV_CommerceRuntime_CustomizableFile Include="$(SdkReferencesPath)\Contoso.Commerce.Runtime.StoreHoursSample.dll" />
- Configure the app.config's connection string for Houston to point to a valid database.
- Run the CRT test host project (Runtime.Extensions.TestHost.csproj) in the debugger and execute the code for the store hours sample (part of RunSdkSampleTest() method).

6. Enable and test Retail Server sample code:
- Open the project at RetailSdk\SampleExtensions\RetailServer\Extensions.StoreHoursSample\RetailServer.Extensions.StoreHoursSample.csproj and compile it.
- Use inetmgr to find the location of the local Retail Server folder.
- Register the new Retail Server assembly in web.config file under <extensionComposition> (Note: If there is an assembly registered from a previous sample, then remove it.):
<add source="assembly" value="Contoso.RetailServer.StoreHoursSample" />
- Register the new Retail Server assembly in RetailSdk\BuildTools\customization.settings:
<ISV_RetailServer_CustomizableFile Include="$(SdkReferencesPath)\Contoso.RetailServer.StoreHoursSample.dll" />
- Register the new Retail Server assembly in RetailSdk\BuildTools\customization.settings below <RetailServerLibraryPathForProxyGeneration Include="$(PkgMicrosoft_Dynamics_Retail_RetailServerLibrary)\lib\net461\Microsoft.Dynamics.Retail.RetailServerLibrary.dll"/>:
<RetailServerLibraryPathForProxyGeneration Include="$(SdkReferencesPath)\Contoso.RetailServer.StoreHoursSample.dll"/>
- Copy the changes you made to RetailSdk\Assets\commerceruntime.ext.config to the local Retail Server's commerceruntime.ext.config in its bin\ext folder.
<add source="type" value="Contoso.Commerce.Runtime.StoreHoursSample.StoreHoursDataService, Contoso.Commerce.Runtime.StoreHoursSample" />
- Drop both the new CRT and Retail Server assemblies into the local Retail Server bin folder. Alternatively, use the Retail SDK's AfterBuildDropBinariesToRetailServer target for rapid development (Note: If you use the AfterBuildDropBinariesToRetailServer target, then you have to rebuild the 2 assemblies at least once in order to binplace them automatically).
- Use inetmgr to browse to the Retail Server's $metadata and verify that the StoreHours entity is exposed (i.e. open usnconeboxax1ret.cloud.onebox.dynamics.com/.../$metadata and search for "StoreHours" in the XML).

7. Implement the proxy code for offline mode (equivalent to RetailServer controller but for local CommerceRuntime when the client is not connected)
- open Proxies.RetailProxy.Extensions.StoreHoursSample proj from RetailSDK\SampleExtensions\RetailProxy\RetailProxy.Extensions.StoreHoursSample
- Add the Contoso.Commerce.Runtime.StoreHoursSample.dll and Contoso.RetailServer.StoreHoursSample.dll as reference to the project
- Build the proxy project.
- Copy the output assembly and paste in RetailSDK\References folder.
- Navigate to RetailSDK\Assets folder and open RetailProxy.MPOSOffline.ext.config
- Under the composition section, register your new proxy library name. (The assembly generated after building your proxy project.
<add source="assembly" value="Contoso.Commerce.RetailProxy.StoreHoursSample" />
- For manual testing, update the RetailProxy.MPOSOffline.ext.config under the C:\Program Files (x86)\Microsoft Dynamics 365\70\Retail Modern POS\ClientBroker\ext with the custom proxy library name under the composition section.
<add source="assembly" value="Contoso.Commerce.RetailProxy.StoreHoursSample" />
- Navigate to RetailSDK\Assets folder and open CommerceRuntime.MPOSOffline.ext.config
- Under the composition section, register your new CRT library name. (The assembly generated after building your proxy project.
<add source="assembly" value="Contoso.Commerce.Runtime.StoreHoursSample" />
- For manual testing, update the CommerceRuntime.MPOSOffline.ext.config under the C:\Program Files (x86)\Microsoft Dynamics 365\70\Retail Modern POS\ClientBroker\ext with the custom proxy library name under the composition section.
<add source="assembly" value="Contoso.Commerce.Runtime.StoreHoursSample" />
- add the proxy extension dll to customization.settings ---> <ISV_RetailProxy_CustomizableFile Include="$(SdkReferencesPath)\Contoso.Commerce.RetailProxy.StoreHoursSample.dll" />
8. Use the Retail Server Test Client to verify that calling the new functionality succeeds.
- Open the solution at RetailSdk\SampleExtensions\RetailServer\Extensions.TestClient\RetailServer.Extensions.TestClient.sln.
- Uncomment all code that is marked with "SDKSAMPLE_STOREHOURS".
- Add assembly references to Contoso.Commerce.RetailProxy.StoreHoursSample.dll and Contoso.Commerce.Runtime.StoreHoursSample.dll.
- Compile the solution (Note: If you get compilation errors regarding missing StoreHours-related types, then you likely missed the step above to register the new Retail Server assembly in RetailSdk\BuildTools\customization.settings with RetailServerLibraryPathForProxyGeneration.).
- Run the Retail Server Test Client.
- Enter the local Retail Server URL in the text box next to the "Activate New" button.
- Click the "Activate New" button.
- Enter the device and register id you would like to activate and click "Activate".
- Sign in with the AAD credentials that has the needed registration privileges.
- Wait a few seconds.
- The Retail Server Test Client should now show that the device is activated.
- Click the "Logon" button and log on with a workers credentials.
- Click the "SDK Tests" button in order to call the new functionality.
- Click the "Debug" button to see whether or not the your validation succeeded.
Notes:
- To see a console with errors/logs, use the "Debug" button.

9. Extend and test Modern POS and Cloud POS:
- Open the solution at RetailSdk\POS\ModernPos.sln in admin mode.
- Follow the instructions in readme.md under the Pos.Extensions project, adjusting the steps for the StoreHoursSample extension accordingly.

10. (Optional) Extend and test the sample Online Store (Note: These changes will not be included in official deployment packages.):
- Open the solution at RetailSdk\SampleExtensions\OnlineStore\SampleExtensions.OnlineStore.sln in admin mode.
- Add assembly references to RetailSdk\References\Contoso.Commerce.Runtime.StoreHoursSample.dll and RetailSdk\References\Contoso.Commerce.RetailProxy.StoreHoursSample.dll for the Platform.Ecommerce.Sdk.Core and Storefront.Portal projects.
- Uncomment all code that is marked with "SDKSAMPLE_STOREHOURS".
- Follow the sample Online Store instructions. Run and test the Online Store.

11. Official Deployment:
- Add the channel DB change file to the database folder and register it in RetailSdk\BuildTools\customization.settings.
- Run msbuild for the whole RetailSdk (Note: All resulting packages will have all of the appropriate changes).
- Deploy the resulting packages via LCS or manually.

I have the same question (0)
  • Suggested answer
    ahgamal Profile Picture
    on at

    Hi Faisal

    Operation parameter will not be enabled in button grid designer for operation ID equal or less than 4000.
    If you are creating custom operation and want to pass parameter from the button grid designer, then use operation ID greater than 4000.
    so try to change the operation ID in AX to 4001 and make sure that it match the operation id in the manifest in below path
    C:\RetailSDK\POS\Extensions\StoreHoursSample\manifest.json
    C:\RetailSDK\POS\Extensions\StoreHoursSample\Operations\StoreHours\StoreHoursOperationRequest.ts

  • Community Member Profile Picture
    on at

    Hey, i have changed what you said but im still getting the same error!
    POS.JPGreq.JPGmanifest.JPG

    [quote user="ahgamal"]

    Hi Faisal

    Operation parameter will not be enabled in button grid designer for operation ID equal or less than 4000.
    If you are creating custom operation and want to pass parameter from the button grid designer, then use operation ID greater than 4000.
    so try to change the operation ID in AX to 4001 and make sure that it match the operation id in the manifest in below path
    C:\RetailSDK\POS\Extensions\StoreHoursSample\manifest.json
    C:\RetailSDK\POS\Extensions\StoreHoursSample\Operations\StoreHours\StoreHoursOperationRequest.ts

    [/quote]
  • ahgamal Profile Picture
    on at

    Hi Faisal

    it should work may be there is something in the MPOS deployment can you view the extension package in MPOS and see if you can find the storehouse sample

    pastedimage1585646795524v1.png

  • Community Member Profile Picture
    on at

    It Says no packages are installed. actually im just starting this development so havent deployed anything. i worked with receipt sample and its working still not showing here. 
    4456.Capture.JPG

  • ahgamal Profile Picture
    on at

    this because the receipt sample is a CRT change and will not appear in MPOS extension , this only show POS extensions so you have to make sure to include your extension in extensions.json file and comment excluding it from tsconfig.json file and then from Visual studio you can Press F5, and deploy the POS to test your customization.

  • Community Member Profile Picture
    on at

    yes i have done that,
    6763.Capture.JPG6835.Capture.JPG

  • kvigneshvaran Profile Picture
    90 on at

    Hi Faisal,

    I have followed the steps which you follow to enable the store hour sample.

    Here i have mentioned my short notes which i have follow

    pastedimage1585928415881v1.png

    but in the last step when am run the object which in testhost project, the below mentioned error occurs, please do the needful.

    pastedimage1585928482966v2.png

  • kvigneshvaran Profile Picture
    90 on at

    Hi Faisal,

    Can you please explain the below step which i have mentioned what should i need to do this?

    "Drop both the new CRT and Retail Server assemblies into the local Retail Server bin folder.

    Alternatively, use the Retail SDK's AfterBuildDropBinariesToRetailServer target for rapid development

    (Note: If you use the AfterBuildDropBinariesToRetailServer target, then you have to rebuild the 2 assemblies at least once in order to binplace them automatically)."

    Its a little bit confusing.

  • ahgamal Profile Picture
    on at

    Hi Faisal

    can you check the same from CPOS and see if it works

  • kvigneshvaran Profile Picture
    90 on at

    Hi Ahmed Gamal,

    I was check from cpos only. but its not working.

    pastedimage1586144810228v1.png

    Please do the needful.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 288 Super User 2025 Season 2

#2
Siv Sagar Profile Picture

Siv Sagar 178 Super User 2025 Season 2

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 116 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans