Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Unanswered

Quick Create: Appointment (Xrm.Navigation.openForm)

(1) ShareShare
ReportReport
Posted on by 6
I can open the Quick Create: Appointment not problem and I can pre-populate some fields with no problem. I am have trouble populating the regardingobjectid field. I have step thru the JavaScript and I can see the information needed to populate that field but it keeps displaying "No Name" in the lookup field.
 
This is a simplified version of the JavaScript
 
function appointmentQC() {  
    debugger;
    try {
        var entityFormOptions = {};
        entityFormOptions["entityName"] = "appointment";
        entityFormOptions["useQuickCreateForm"] = true;  
        var formParameters = {};
        formParameters["subject"] = Xrm.Page.data.entity.attributes.get("subject").getValue();
        formParameters["regardingobjectid"] = Xrm.Page.data.entity.attributes.get("regardingobjectid").getValue()[0].id;
        formParameters["regardingobjectname"] = Xrm.Page.data.entity.attributes.get("regardingobjectid").getValue()[0].name;
        formParameters["regardingobjecttype"] = Xrm.Page.data.entity.attributes.get("regardingobjectid").getValue()[0].entityType;  
    // Open the form.
        Xrm.Navigation.openForm(entityFormOptions, formParameters).then(
            function (success) {
               //alert(success);
            },
            function (error) {
                //alert(error);
            });
    }
    catch (err) {
        alert(err.message);
    }    
}
  • Suggested answer
    Sachin Jadhav Profile Picture
    Sachin Jadhav 131 on at
    Quick Create: Appointment (Xrm.Navigation.openForm)
    I think you ca build the whole regarding object value upfront and send it in the form parameters like follows.
     
    recId = <record id to be set in regarding>;
    recEntityName = <schema name of the entity for above recId>;
    recName = <Name of the entity for above recId>;
     
    var regardingValue = new Array();
    regardingValue[0] = new Object();
    regardingValue[0].id = recId;
    regardingValue[0].name = recName;
    regardingValue[0].entityType = recEntityName;
     
    var formParameters = {};
    formParameters["regardingobjectid"] = regardingValue;

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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans