Open new window on some event

i was just trying to open new service activity window on some event  & and after that i was trying to set customers according to the parent contact id

i was just trying with‘/activities/serviceappointment/edit.aspx’);

and i write following code to access paraent contactid look on form load event of service activity window.

// to create lookup array

var customer_lookup=new Array();

// to check for new form

if (crmForm.FormType == 1)
 // Check to confirm that the window.opener is present.
 if (window.opener)
  // Get the values of the parent form.
  var oParentCrmForm = window.opener.document.all.crmForm;
//To check Window.opner is calim entity or not

//10000 objectTypecode for my custom entity you can query ur organization database to check your custom entity’s objectTypecode

if (oParentCrmForm && oParentCrmForm.ObjectTypeCode == 10000)
var customer_lookupItem= new Object();[0].id;


but i got one confusion when i was trying to open new service activity from action menu i was getting the customers name but when i was trying to open new service activity through my custom button it was not populating …..

after some time i compare both the url Oppsssss i was missing organization name as i was working on multiorganization …….

so i changed my URL fo‘/’+ORG_UNIQUE_NAME+‘/activities/serviceappointment/edit.aspx’);

and finally it was working ……….


Leave a comment

Filed under MS CRM & Javascript

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s