locked
onchange of a field how to hit the other entity ? RRS feed

  • Question

  • I have a requirement like onchange of a field I need to check the records on other entity and match the score there , if it matches then get the value from the field and set it to the other field on the form.

    please help me ..

    thank you in advance


    Friday, June 13, 2014 7:37 AM

Answers

  • Hi,

    You can use either REST call using Javascript or You can use FetchXml to get the data from other entity. 

    CodePlex provides a Library called XrmServiceToolkit. It contains many SOAP functions. You can use fetchXml as a parameter to the function "XrmServiceToolkit.Soap.Fetch(fetchXML)". But before using this function you need to refer Jquery, JSON and XrmServiceToolkit libraries in your Form Properties.

    If you call that function you will get the return value as an array of Objects.

    Then  suppose if you want to fetch the name value then store the value in a variable returned by  "fetchedResults[0].attributes['new_name'].value" like

    var name=fetchedResults[0].attributes['new_name'].value;

    I think this will help you.

    Friday, June 13, 2014 9:19 AM

All replies