1

I am passing following parameter to a form

var parameters = {};  
    //Set the Parent Customer field value to “Contoso”.  
    parameters["regardingobjectid"] = orderID;  
    parameters["regardingobjectidname"] = formContext.getAttribute("name").getValue();
    parameters["regardingobjectidentitytype"] = "salesorder";
    
  
    // Define the entity name to open the form  
    var entityFormOptions = {};
    entityFormOptions["entityName"] = "email";
    entityFormOptions["formId"] = "GUID";  

    // Open the form
    Xrm.Navigation.openForm(entityFormOptions, parameters).then(
        function (success) {
            console.log(success);
        },
        function (error) {
            console.log(error);
        });  

However, following line of codes doesn't work as it sets the entity type to default one which account instead of Sales Order

 parameters["regardingobjectid"] = orderID;  
    parameters["regardingobjectidname"] = formContext.getAttribute("name").getValue();
    parameters["regardingobjectidentitytype"] = "salesorder";

What will be the parameter I need to set for the Entity Type here?

Akshay
  • 11
  • 4
  • In your code above `***parameters["regardingobjectidentitytype"] = "salesorder";***` Is this commented? This should not be commented. In addition your orderID does this return Guid as string? – AnkUser Dec 16 '22 at 12:56

1 Answers1

1

Try this instead. It should be regardingobjectidtype and not regardingobjectidentitytype. This will setup the “regarding” lookup as sales order record in opened email form. Read more

parameters["regardingobjectidtype"] = "salesorder"; // Table name.