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
Thanks it worked :)
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
//
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.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156