Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Getting a Record Id in the Dynamics 365 Portal

Posted on by 70

I have a create contact page in a Dynamics 365 portal, and this page needs to call an action in CRM when the new contact record is saved.  On the CRM form, I have JavaScript that waits until the contact's id is created and then calls the action.  This all occurs in the OnSave JavaScript.  In the portal, how can I use JavaScript to get the id of the contact that is being created?  Is it possible in the portal?

*This post is locked for comments

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Getting a Record Id in the Dynamics 365 Portal

    Hi,

    With portal version 8.4 & above, you can display the custom errors from plugin. The reason we are recommending this becuse its simplae and workf on both CRM & Portals.

    Check this out- colinvermander.com/.../dynamics-365-portal-new-release-8-4-0-265-portal-error-logs

    Hope this helps.

  • jimfield Profile Picture
    jimfield 70 on at
    RE: Getting a Record Id in the Dynamics 365 Portal

    My action returns values and a status which I need to use in the javascript to display messages to the user.  Otherwise I would have used a plugin.

  • jimfield Profile Picture
    jimfield 70 on at
    RE: Getting a Record Id in the Dynamics 365 Portal

    I would have used a plugin, but I need to display various notifications to the user depending on whether or not the action is successful.  

  • Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: Getting a Record Id in the Dynamics 365 Portal

    Agree with Ravi, Is there any spcific reason why you are using js code for this when this can be done through configuration only,

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Getting a Record Id in the Dynamics 365 Portal

    Hi jimfield,

    Is your action returning any values or you are using the response within your JavaScript? If not then you could have done it through workflow which wil work from both CRM as well as Portal.

    You could refer the below blog on exeuting the server side code if you can't achiev it through workflow-

    uds.systems/.../how-to-run-custom-code-in-dynamics-365-portal

    community.dynamics.com/.../hacking-your-way-to-server-side-code-with-dynamics-365-portals-just-like-microsoft

    Hope this helps.

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans