locked
CRM Form and IFrame RRS feed

  • Question

  • Hi,

    I have situation why my project which i need help with.

    In the CRM Lead Form we have added a new tab section which loads an IFRAME and webapplication inside the IFRAME.  The webpage gets some inputs from the user and saves it into an entity relating to the Lead Entity.

    The issue i'm facing is that when the new Lead Form is clicked, the LeadID is null in onSave() method of the main Form. This is where i do a postback to the webform everytime the user clicks the save button.  But when the new lead is created i'm unable to do this.  I tried to do this in the onLoad() if its a new Lead form, but i'm unable to get reference to the IFRAME controls at this point because it's not rendered.

    ANy suggestions/advice to solve this problem?

    Regards,



    Wednesday, April 29, 2009 1:00 AM

Answers

  • Not sure if this is your case but, If the lead and the IFRAME (other entity) are tied up in a 1:1 relationship then

    What I usually do is create an extra field on both entities that holds a temporary token (e.g. lead.new_reltoken and otherentity.new_reltoken). Then when the lead is saved for the first time (FormType = 1 and before the data is sent to CRM) I set the new_reltoken on each entity with the same value (could be userid + date for example). This way the saving of each entity can be done asynchronously, you don’t need to save the lead entity in advance and the user can click on the save and close or save and new buttons (which is a problem if you tie up the entities from the client side).

    The last step is to write a lead post create plug-in, search the other entity by token and set the other entity lookup with the leadid.

     

    This concept is similar to the way annotation work with a new entity. You can create new annotation before a lead actually exists then the lead and annotations are bind together on the server. 


    After the lead is saved and the leadid already exists you can set the other entity IFRAME url with the leadid as parameter and load the other entity by leadid.

     

    Hope this helps.

     

     


    Blog: http://mscrm4ever.blogspot.com/ Website: http://gicrm.upsite.co.il/
    Wednesday, April 29, 2009 1:56 AM

All replies

  • Not sure if this is your case but, If the lead and the IFRAME (other entity) are tied up in a 1:1 relationship then

    What I usually do is create an extra field on both entities that holds a temporary token (e.g. lead.new_reltoken and otherentity.new_reltoken). Then when the lead is saved for the first time (FormType = 1 and before the data is sent to CRM) I set the new_reltoken on each entity with the same value (could be userid + date for example). This way the saving of each entity can be done asynchronously, you don’t need to save the lead entity in advance and the user can click on the save and close or save and new buttons (which is a problem if you tie up the entities from the client side).

    The last step is to write a lead post create plug-in, search the other entity by token and set the other entity lookup with the leadid.

     

    This concept is similar to the way annotation work with a new entity. You can create new annotation before a lead actually exists then the lead and annotations are bind together on the server. 


    After the lead is saved and the leadid already exists you can set the other entity IFRAME url with the leadid as parameter and load the other entity by leadid.

     

    Hope this helps.

     

     


    Blog: http://mscrm4ever.blogspot.com/ Website: http://gicrm.upsite.co.il/
    Wednesday, April 29, 2009 1:56 AM
  • Hi,

    Thanks for the reply.  Yes that's exactly is the case (1:1 relationship).
    This is what i had in mind but hoped there may be another quick way. Anyhow I Will give this a go.

    Thanks again.
    Wednesday, April 29, 2009 2:46 AM