Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Retrieve Data

Posted on by Microsoft Employee

22418.Capture.PNG

Hello Guys,

can anyone please share input on the following: -

As soon as I get the account name which is a look up, Pal gets automatically filled in. I want office also to get automatically filled in, can anyone help me please?

*This post is locked for comments

  • Suggested answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: Retrieve Data

    Hello,

    You can write a Web API request where you can pass account id and it can return you required field, you can design your web api request using rest builder: github.com/.../releases

    further you can set lookup like below

    var object = new Array();

               object[0] = new Object();

               object[0].id = result.fieldname.id;

               object[0].name = result.fieldname.name;

               object[0].entityType = "entityname";

               Xrm.Page.getAttribute("fieldname").setValue(object);

    You can refer my sample if you are working with Dynamics 365 V> 9.0

    http://himbap.com/blog/?p=2874

  • Verified answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Retrieve Data

    So basically this can be achieved by

    1) JS using the WEB API - So you need to check if there is any JS wrtten on change or on save.

    2) Workflow - You need to check if there are any workflows running for this entity on create/ update

    3) Plugin - You need to check if there are any steps registered for this entity on create/ update

    Hope this helps.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Retrieve Data

    Can you tell me how to find out the source code, that we used to call in dotnet for CRM. Am sure there can be JS or pluggin that takes the information from account name and places in pal# If you tell me that, I think, I can solve the problem.

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Retrieve Data

    How are you currently setting the pal lookup from account?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Retrieve Data

    Hi Ravi,

    These 2 fields Pal and office are look up. however account name has details of pal and office. when account name is selected, pal sits in the pal field, now I want office to be placed in office field. Can you please help me on that.

  • Suggested answer
    Arun Vinoth Profile Picture
    Arun Vinoth 11,613 on at
    RE: Retrieve Data

    Verify the form scripts, there will be some service calls on change of Account lookup in js to populate the existing PAL# field, just extend the same method to pull extra column office as well & populate it.

    Pro tip: you don’t need to do this to store redundant data. Since after storing these fields here, if Account data changed it will not flow here. Best option is Quick view form to show it. Basically CRM platform will query & show lookup record values in similar way. Just you have to design the Account QV form & embed in referred entity form.

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Retrieve Data

    Hi SuchiSuchi,

    You need to share some more details about your setup. There is no oob field called Pal/ office. Based on your description, you can add the logic same as your Pal field for office.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Retrieve Data

    Hi Suchi,

    As your requirement, it seems you are retrieving office name of the selected AccountName lookup.

    You need to write JS onchange of AccountName Lookup.

    Thank you

    Pankaj Kumar

    If found useful, please mark the answer as verified

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Retrieve Data

    Hi ,

    Create  business rules like below -

    IF Account Name Contains Data

    Then

    Set Field Value

    3580.BUR.png

    If you find any limitation on business rules to set the value then write JS function where set the value  and register it  in onload and onchagne event of the Account Name field..

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans