Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Retrieve field value from lookup with Javascript

$
0
0

Hi all,

unfortunately I am stuck with this code here.

From a Project I create a Case via a custom button (+ New Ticket - IT), it works fine.

I now need to add in my following Javascript, to lookup the account in this project and pass it to the case form

field "customerid", when Form is opening.

This goes beyond my knowledge of javascript at the moment, I am still learning.

functionopenItTicketForm (primaryControl) {

        varformContext = primaryControl;
     
        varrecordGuid = formContext.data.entity.getId().replace("{", "").replace("}", "");
     
        varrecordName = formContext.getAttribute("pde_name").getValue();
     
        varrecordType = "pde_project";
     
        varentityFormOptions = {};
     
        entityFormOptions["entityName"] = "incident";
     
        entityFormOptions["openInNewWindow"] = true;

        entityFormOptions["formId"] = "3962b5bd-1ad2-ed11-a7c7-000d3adf75ee";

        // Set lookup column
     
        varformParameters = {};
     
     
        formParameters["skt_pde_project"] = [{ id:recordGuid, name:recordName, entityType:recordType }];
        formParameters["skt_requestto"] = 921720001;

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

           
         
     
     }

Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images