Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Create related entity from Custom Ribbon button in JS (MS CRM 2013)

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi All,

I have Ia and Ca - (entities)
Ia has a lookup to Ca

Now, i have to create a custom button in Ca
onClick of the button , A new Ia form with its lookup pre populated should be loaded

pre populated value will be from Ca (Name)

how to do this

Thank you!

*This post is locked for comments

  • Suggested answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: Create related entity from Custom Ribbon button in JS (MS CRM 2013)

    You don't need to set it, CRM will set if you will pass it like parameter, please check the link that I have suggested, and if you are interested in using no code option than you can use subgrid as well as suggested (this that case the lookup will be auto populated by CRM because of the system mapping)

    Thanks

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Create related entity from Custom Ribbon button in JS (MS CRM 2013)

    Hi Raz,

    Thank you for the suggestion. Will discuss this approach and let you know.  As of now we also have to set the lookup value in IA on load to Ca record name from where ribbon button is clicked.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Create related entity from Custom Ribbon button in JS (MS CRM 2013)

    Hello Mahen

    Thanks much.

    I would need a clarification..

    I create a record in ca let's name it as himbap

    . Now il open himbap record... From the ribbon button il open new ia record using xrmutility passing (name:himbap and I'd of this record) now onload of ia form will I be able to set himbap to ia's lookup value.

    Ia has a look up to ca.  Ia s look up should now be prefilled to himbap..

    Thank you

  • Suggested answer
    razdynamics Profile Picture
    razdynamics 17,304 User Group Leader on at
    RE: Create related entity from Custom Ribbon button in JS (MS CRM 2013)

    Hi Mythalias

    For a No Code Approach you can try the following;

    1.Create a 1:N relationship between Ca:Ia

    2.Add a Ia Subgrid on the Ca Form

    3.Enable Quick Create Forms for both Entities

    4.Set the Lookup to Ca on the IA form to 'Required'

    This will ensure  the user will get a “new record” form when clicking the + button. If the lookup field for the parent entity is not required on the child entity, the user will get the lookup field to “add existing.

    Best Wishes, Raz

  • Verified answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: Create related entity from Custom Ribbon button in JS (MS CRM 2013)

    Hi,

    You can use xrmutility to open form by passing name as parameter, check sample code here msdn.microsoft.com/.../jj602956.aspx

    Or can use Odata create request to create record and open it using xrmutility, you can use OData designer for request help

    Let me know if you are facing any issue.

    Thanks

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,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans