Answered by:
Problem with contact Multiple Edit

Question
-
Hi
I have written a javascript which add a ondblclick event for a filed in CRM Form 'field1'. It is working fine if i am opening single contact entity edit. But if i am selecting multiple contacts and i select edit option the attachevent is throughwing javascript error. Please help to solve this issue
Thanks
Shaik
Friday, February 29, 2008 9:29 AM
Answers
-
Hi.
If you are qualifying your code using crmForm.FormType property then you need to address this in your code.
The script should run on both occasions, there should be no difference between bulk edit and single edit.
If you bulk edit the crmForm.FormType == 6
If this is an update form then the crmForm.FormType == 2
For example:
//form onload event
document.all.name.attachEvent( "ondblclick" , OnNameDblClick );
function OnNameDblClick()
{
alert( crmForm.FormType ); 6 if bulk 2 if update
}Cheers,
Adi
- Marked as answer by DavidJennawayMVP, Moderator Thursday, March 26, 2009 5:55 PM
Friday, February 29, 2008 10:39 AM
All replies
-
javascript only work for single value.
for multiple operation you have to run action - use isv.config and add button, then on that button click javascript or .net assembly to perform actions you want.. and save that.
Regards,
Imran
http://microsoftcrm3.blogspot.com
Friday, February 29, 2008 9:45 AMModerator -
Hi.
If you are qualifying your code using crmForm.FormType property then you need to address this in your code.
The script should run on both occasions, there should be no difference between bulk edit and single edit.
If you bulk edit the crmForm.FormType == 6
If this is an update form then the crmForm.FormType == 2
For example:
//form onload event
document.all.name.attachEvent( "ondblclick" , OnNameDblClick );
function OnNameDblClick()
{
alert( crmForm.FormType ); 6 if bulk 2 if update
}Cheers,
Adi
- Marked as answer by DavidJennawayMVP, Moderator Thursday, March 26, 2009 5:55 PM
Friday, February 29, 2008 10:39 AM -
I suppose you don't want to fire the event when you bulk edit it
In this case, you need to change the JS event:
if(crmForm.FormType != 6 ) // bulk edit
{
// put the ondbclick() event here;
}
Regards,
Jim
Friday, February 29, 2008 10:42 AMModerator