Search code examples
javascriptc#dynamics-crmentitymicrosoft-dynamics

Dynamics 365 - How to retrieve record and populate in field from different entity based on selected product?


quote line form

I'm creating this form in Quote Line entity, what I'm trying to do now is I want the Tax Code 2 field is auto-populate based on Existing Product that I chose. The product and its tax code is located in different entity (Product entity).

enter image description here

How do I call the record? I have tried creating another field in Quote Line entity and make 1:N relationship but still, it didn't work out as expected.


Solution

    1. Create a Javascript
    2. Fire the Event on change of Existing Product
    3. create a function which will get Id of Existing Product and get all the information from Existing Product record.
    4. Once you have the information you can add this to your Tax Code 2 field.

    Few Examples as below

    1. Example 1
    2. Example 2
    3. Example 3
    4. Example 4