- Java Script - On change for lookup
- Posted by Ridhima Sood on July 27th, 2007
hi All
I have a lookup field on the form called parent account (standard crm field)
I want another field called subaccount type = bit to be updates to yes when
an account is selected in the parent account lookup.
not sure how to go about this. I dont know what syntax to use
i have tried - code from Michael Holne's website
if (
(window.opener != null) &&
(window.opener.parent != null) &&
(window.opener.parent.document != null) &&
(window.opener.parent.document.crmForm != null)) {
//This is the opportunity form
var parentForm = window.opener.parent.document.crmForm;
if(parentForm.all.parentaccountid.DataValue != null)
{
crmForm.all.new_subaccount.DataValue = true;
}
can someone pleasee pleasee help.
regards
Ridhima
- Posted by Imran on July 27th, 2007
I recomend
http://www.microsoft.com/dynamics/cr...tips/tips.mspx
and www.stunnware.com/crm2/ see lookup article.
--
Regards,
MS CRM Certified Professional
http://microsoftcrm3.blogspot.com
Chat with me on MSN / Gmail / Skype : ID Is :.. mscrmexpert@gmail.com
"Ridhima Sood" wrote:
- Posted by Ridhima Sood on July 29th, 2007
hi Imran
i couldnt find what i am looking for. can you please help.
regards
Ridhima
"Imran" wrote:
- Posted by Bertil on August 1st, 2007
Hi,
I think you're looking for this:
if (crmForm.all.parentaccountid.DataValue != null)
{
crmForm.all.new_subaccount.DataValue = true;
}
else
{
crmForm.all.new_subaccount.DataValue = false;
}
Put it in the OnChange event of the parent account field.
Good luck,
Bertil
"Ridhima Sood" wrote: