Answered by:
CRM 2011: automatic open a contact form after a account was saved

Question
-
Hi,
our users often generate accounts without any contact. So we want our CRM to automatic open a Contact form after the account was saved.
In 4.0 we used a JS, but in 2011 it does not work. The code is in an external htlm Page, which is called onsave and should do this. But it tells me that i have no access on the opener object.
function Wait(){ if (opener.crmForm.ObjectId != null) { opener.locAddRelatedToNonForm(2, 1, opener.crmForm.ObjectId, ''); return; } setTimeout("Wait()",100); }
If i run the same code in the onload event it works fine. Can anyone help me?
Thx
Monday, October 24, 2011 12:02 PM
Answers
-
here is a patter for jscript for this:
1. Use an update call in jscript in onsave of entity to switch a bit attribute to true upon save.
http://mileyja.blogspot.com/2011/04/how-to-use-update-requests-in-net-and.html
2. Do a retrieve or retrievmultiple call in jscript in onload of entity to determine if field is true.
http://mileyja.blogspot.com/2011/05/how-to-retrieve-users-systemusers-for.html (JSCRIPT, C#)
http://mileyja.blogspot.com/2011/04/how-to-use-retrieve-messages-in-jscript.html (JSCRIPT C#)
3. If field is true, open window and then set it to false using another update call in jscript.
Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Marked as answer by mycapi Thursday, October 27, 2011 9:41 AM
Monday, October 24, 2011 3:51 PMModerator -
Thanks for the idea.
I now added a new attribute, set it in onsave to 1, and in onload I read it, open a contact and set the attribute back to 0.
- Marked as answer by mycapi Thursday, October 27, 2011 9:41 AM
Thursday, October 27, 2011 9:41 AM
All replies
-
here is a patter for jscript for this:
1. Use an update call in jscript in onsave of entity to switch a bit attribute to true upon save.
http://mileyja.blogspot.com/2011/04/how-to-use-update-requests-in-net-and.html
2. Do a retrieve or retrievmultiple call in jscript in onload of entity to determine if field is true.
http://mileyja.blogspot.com/2011/05/how-to-retrieve-users-systemusers-for.html (JSCRIPT, C#)
http://mileyja.blogspot.com/2011/04/how-to-use-retrieve-messages-in-jscript.html (JSCRIPT C#)
3. If field is true, open window and then set it to false using another update call in jscript.
Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Marked as answer by mycapi Thursday, October 27, 2011 9:41 AM
Monday, October 24, 2011 3:51 PMModerator -
Thanks for the idea.
I now added a new attribute, set it in onsave to 1, and in onload I read it, open a contact and set the attribute back to 0.
- Marked as answer by mycapi Thursday, October 27, 2011 9:41 AM
Thursday, October 27, 2011 9:41 AM