In our last article, we discussed Xrm.WebApi Create, Update, and Delete method. In this article, we are going to provide sample code for using Xrm.WebApi Retrieve method.
The above code is self-explanatory. It can be modified based on the required fields that we want to fetch from the parent entity and can call the above function on onChange of the lookup field for parent entity. For example, in the above scenario, it can be used on onChange of the "parentcustomerid" lookup field.
Stay tuned for more Dynamics 365 Sample code !!