locked
How to open child window RRS feed

  • Question

  • Hi All,

    i have to open new service activity window from my custom entity's event.

    i am using window.open method to open new service activity window, but i m getting error if i pass multiple parameters like

    window.open('/activities/serviceappointment/edit.aspx?cusID={customer_lookup[0].id}&customername=lookupItem[0].name&cutype=customer_lookup[0].typename','','dialogHeight:600px;dialogWidth:900px');

    is it the correct way or i am missing something ............
    thanks in advance..........
    mahender
    Monday, April 20, 2009 6:50 AM
    Moderator

Answers

  • Hi All,

    thanks for response it's done now.

    i was just missing organization name( i am working on multiorganization)
    mahender
    Monday, April 20, 2009 10:24 AM
    Moderator

All replies

  • Hi,

    You need to seperate form values from your static URL (if that was understandable ...?)

    window.open('/activities/serviceappointment/edit.aspx?cusID=' + crmForm.ObjectId + '.etc...','','dialogHeight:600px;dialogWidth:900px');

    http://msdn.microsoft.com/en-us/library/cc150850.aspx

    Morten
    Monday, April 20, 2009 7:14 AM
  • You should remove the parameters from the initial string value used in the window.open.

    window.open('/activities/serviceappointment/edit.aspx?cusID={' + customer_lookup[0].id + '}&etc

    In addition, you might even have to use the entire form object and cast these values to string values (crmForm.all.customer_lookup[0].id.toString())

    Monday, April 20, 2009 7:15 AM
  • Hi i am using like this

    window.open('/activities/serviceappointment/edit.aspx?custid={'+crmForm.all.asu_contactid[0].id.toString()+'}

     

    &custname='+crmForm.all.asu_contactid[0].name.toString()+','','dialogHeight:600px;dialogWidth:900px');

    but getting error  on ISV file

    i am using this on buton's javascript in ISV file




    mahender
    Monday, April 20, 2009 7:25 AM
    Moderator
  • I'm not sure whether you can access crmform objects from ISV, since the form itself isn't loaded when the ISV is set.
    You can send parameters through ISV by using PassParams="1" but this is only for the record ID and objecttypecode to catch.

    Try using JS in the onload of the form to change the value of the button (all objects are loaded in onload, so you should be able to access the button using getElementById)

    Monday, April 20, 2009 7:31 AM
  • Hi Daniel/Mahain,

    You can use the values directly as Mahain is describing. But you probably have a typo or something that cause the error.

    I usuall put code behind a fields change event in the form where I place the ISV button when developing ISV button scripts; since it's time consuming to import customizations; find error etc.

    So if you put your code on one of the fields change events ... do it bit by bit (parameter by parameter); until you get it right. (i.e. just hard work solution .. sorry mate); then as you have this working copy your open.window command into your ISV config.

    Morten

     

     

     

     

    Monday, April 20, 2009 7:45 AM
  • Hi All,

    thanks for response it's done now.

    i was just missing organization name( i am working on multiorganization)
    mahender
    Monday, April 20, 2009 10:24 AM
    Moderator