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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Send Form Id id in Create Record command

(0) ShareShare
ReportReport
Posted on by

Hi Experts,

I want to create record of a custom entity in JavaScript which I am able to do but I also want to send Form Id into it. 

How can I do that?

e.g. For entity X, I have two forms "Main1" and "Main2" 

Scenario:

if(condition){

Create record of entity X with form "Main1"

}

else{

Create record of entity X with form "Main2"

}

Code:

I am using code something like this

var objectValues= new Object();

 SDK.REST.createRecord(objectValues, "<EntityName>", callBackFuction, function (error) { alert(error.message); });

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Dynamics365 Rocker Profile Picture
    7,755 on at

    You have to get name of form not id. Below link may help you:

    community.dynamics.com/.../crm2013-getting-current-form-name-via-javascript

  • Suggested answer
    Pawar Pravin  Profile Picture
    5,237 on at

    Hi ,

    Actually while creating record in CRM it never affect with form because form is not part of attributes. In other way if you want to open that record into two different form then you need to create one flag/option set with respective form name.

    While opening that record you can check flag to open form.

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi ,

    There is no parameter to pass form id in createRecord method , this is only for Opening any record like OpenEntityForm . Is there any specific reason you are  passing form id in create record ?

    If you still want to pass form id you can create a text field in the entity fill it the "objectValues" parameter , you can hard code the form id without any issue.

  • Verified answer
    Community Member Profile Picture
    on at

    Thanks all for the suggestions. I solved it doing following.

    I created new field on the form.

    While creating entity record, I set that variable to some unique value.

    I created 2 different forms

    On form load I added js code to check variable data

    and according to the data I change form navigation

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans