Monday, August 4, 2008

crm 4.0 look up

editing the values of look up based on parent lookup is possible.

sample code to do it,

var lookupItem = new Array;

// This will get the lookup for the attribute primaryid on the Account form.
lookupItem = crmForm.all.new_customerlogbookid.DataValue;

if ( lookupItem[0] != null )
{

var cutomerID = lookupItem[0].id;

var entityForList = "new_bd_oppurtunity";
var attribForFilter = "new_customerlogbookid" ;
var idToFetch = cutomerID;

try{

var fetchStr = "" +
" " +
" " +
" " +
" " +
"
" +
"
" +
"
";

} catch ( e ) { alert(e); }

crmForm.all.new_oppurtunityid.lookupbrowse = 1;
crmForm.all.new_oppurtunityid.AddParams("search", fetchStr);


} else { alert("No values"); }

No comments: