web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

JavaScript in MS CRM

(0) ShareShare
ReportReport
Posted on by

How do we create a record in another entity by invoking a javascript in the current entity ?

My requirement is as follows :-

I have two entities "Bid packages" and "Commitments", i need to create a button on "Bid packages" and on click of that button , create a new record in the "Commitment" and then fill up the look up field in "Bid packages" with the newly created record name of the "Commitment"

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at
    RE: JavaScript in MS CRM

    There are a few ways to do this, but let's start with the basics.

    The first thing that you need to do is create the button. In order to create the button on the Command Bar, you will need to use Ribbon Workbench (you can use it from XRMToolbox or download it from www.develop1.net/.../ribbonworkbench.aspx)

    Once the solution is installed, create a new button in your entity, and customize its command to use a JavaScript command. Provide the name of your JavaScript web resource file and the name of the function that you will use to create the new record.

    //

    The second part is to create the related record. The two main ways that you can do this are using webapi and actions.

    although you can write webapi code directly, I would recommend, especially for starters to use one of the packages webapi libraries out there. There is one from ZACRMGuy and one from David Yack:

    github.com/.../Xrm.Tools.CRMWebAPI

    sdkwebapi.codeplex.com

    //

    You can also do the same logic using actions (which can be used similar to a Workflow or Plugin). In order to call an action

    from JavaScript, you should use the process.js JavaScript library. This can be downloaded from: github.com/.../processjs

    Hope all this helps get you to the solution you need.

  • Community Member Profile Picture
    on at
    RE: JavaScript in MS CRM

    Thanks it worked :)

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans