Milos Nikolic
Milos Nikolic

Reputation: 383

How to get current page context in CRM using JavaScript

I have to pass data to lookup field in CRM.

There is section with the buttons i made on account card. I also made some lookup fields on the account card. On click i have to pass some data to lookup field.

Here is the code i use to pass the data to lookup field, but i don't know how to get info about current page context. Is there any function doing that?

    var lookup = new Array();
    lookup[0] = new Object();
    lookup[0].id = recorid;
    lookup[0].name = recordname;
    lookup[0].entityType = entityname;
    Xrm.Page.getAttribute("attributename").setValue(lookup);

Upvotes: 0

Views: 1284

Answers (1)

Jordi
Jordi

Reputation: 1470

It is Xrm.Page.context.

More info here

Upvotes: 1

Related Questions