Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Commerce forum / Generating a TypeScrip...
Commerce forum
Unanswered

Generating a TypeScript proxy in v10.0.12

Posted on by 1,423

I used the following link to try and generate the typescript proxy for my retail server extension in v10.0.12: docs.microsoft.com/.../retail-server-icontroller-extension

It wasn't clear for me on how to do it reading the document.

My scenario might be different. My retail server and CRT extensions are class library (.NET Framework), which means I do not have the dependencies folder in my project.

I copied the StoreHours sample in  : "RetailSDK\SampleExtensions\TypeScriptProxy\TypeScriptProxy.Extensions.StoreHoursSample" and saved it with another name where I keep my retailserver and CRT extension code. Which means this project will have a Dependencies folder. 

Anyways, I deleted the StoreHours  reference in the project folder under Dependencies.

Then I did the following and keep in mind that this might be specific to projects that are of type Class Library (.NET Framework) and that the link from Microsoft will work for thos that have their projects as Class Library (.NET Standard).

 
Important: Copy your retail server extension project's latest DLL to RetailSDK\References (directory where you develop, for me it was on my C-drive)
1) Open your new project which was created when copying the store hours example
2) Right-click on the project and choose Unload Project
3) Right-click on the unloaded project and choose Edit
4) Scroll down to the ItemGroup that contains the RetailServerExtensionAssemblies nodes.
5) If your project's DLL doesn't exist in the item-group, add a RetailServerExtensionAssemblies-node for it.
Example: <RetailServerExtensionAssemblies Include="$(SdkRootPath)\References\TMCRetailServer.RoundUpDown.dll" />  
If you do not like the destination folder provided in the copy sourcefiles item group, then change it to a directory where you want it copied. I chose a different directory because it generates only one proxy at a time and if you have more than one project then it will overwrite the previously generated proxy files.
6) Comment out all the other RetailServerExtensionAssemblies-nodes.
The proxy generator can only generate one RetailServer extension at a time
7) Save the change to the project file and close it.
8) Right-click on project and choose Reload Project
9) Save, clean and rebuild solution
10) The generated proxies: DataServiceEntities.g.ts and DataServiceRequests.g.ts will be in the DataServices folder in the project.
It will also be in the folder you specified in the destination folder
You can now go to CloudPOS and add the newly generated code to the existing DataServices-folder. 

Layout of my TypeScript proxy project in the end. Before you delete the store hours project reference the Dependencies folder will show a yellow triangle and it will even have it on the NuGet packages but the moment you delete that project references, the yellow triangles will go away.

pastedimage1599150919308v1.png

Categories:
  • ToddB Profile Picture
    ToddB on at
    RE: Generating a TypeScript proxy in v10.0.12

    Hi Retha,

    Thank you for sharing.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,696 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,490 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans