Wednesday, 9 January 2013

retrieve data of lookup field in crm 2011

for this we need to download the xrmservicetoolkit.

after download we will get 3 .js files.
1. jquery.js

just add these three as webresource.

write on javascript function;

function AlertGUID() {

    var primaryContactGUID ="parentcustomerid").getValue()[0].id;
var cols=["lastname"];
var retrievedaccount = XrmServiceToolkit.Soap.Retrieve("account", primaryContactGUID, cols);
var name = retrievedaccount.attributes['lastname'].value;



add these function as webresource.

downloaded webresorce add to the form in onload.
and custom function will give on the onchage of lookup filed.

then run.
for debug. press F12 in the form and 
select your code on : Formscript 
click on debugg. put pointer.

No comments:

Post a Comment