I have tested the script using Sage CRM 7c and there is no problem. You do need to make sure that the script has been fully entered with the help function, the insertrecord function and updaterecord function correctly defined. The full "entity level with rollback" script would look like
////////////////////Helper Functions Start///////////////////////
function emailvalidation(x,y)
{
if (x.length>0)
{
apos=x.indexOf("@");
dotpos=x.lastIndexOf(".");
lastpos=x.length-1;
if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2)
{
Valid = false;
ErrorStr = CRM.GetTrans("colnames",y)+ " ["+x+"] "+ CRM.GetTrans("GenCaptions","BadMailAddress");
}
}
}
function phonevalidation(x,y)
{
re =/[^0-9]/;
r = x.match(re);
if (r)
{
Valid = false;
ErrorStr = CRM.GetTrans("colnames",y)+ " ["+x+"] "+ CRM.GetTrans("Errors","InvalidIntegerValue");
}
}
/////////////////////Helper Functions End///////////////////////
function InsertRecord()
{
// Handle insert record actions here
emailvalidation(FormValues("emai_emailaddressbusiness"),"emai_emailaddressbusiness");
emailvalidation(FormValues("emai_emailaddresssales"),"emai_emailaddresssales");
emailvalidation(FormValues("emai_emailaddresssupport"),"emai_emailaddresssupport");
phonevalidation(FormValues("phon_countrycodebusiness"),CRM.GetTrans("Link_CompPhon","Business"));
phonevalidation(FormValues("phon_areacodebusiness"),CRM.GetTrans("Link_CompPhon","Business"));
phonevalidation(FormValues("phon_numberbusiness"),CRM.GetTrans("Link_CompPhon","Business"));
phonevalidation(FormValues("phon_countrycodefax"),CRM.GetTrans("Link_CompPhon","Fax"));
phonevalidation(FormValues("phon_areacodefax"),CRM.GetTrans("Link_CompPhon","Fax"));
phonevalidation(FormValues("phon_numberfax"),CRM.GetTrans("Link_CompPhon","Fax"));
phonevalidation(FormValues("phon_countrycodeisdn"),CRM.GetTrans("Link_CompPhon","ISDN"));
phonevalidation(FormValues("phon_areacodeisdn"),CRM.GetTrans("Link_CompPhon","ISDN"));
phonevalidation(FormValues("phon_numberisdn"),CRM.GetTrans("Link_CompPhon","ISDN"));
phonevalidation(FormValues("phon_countrycodemodem"),CRM.GetTrans("Link_CompPhon","Modem"));
phonevalidation(FormValues("phon_areacodemodem"),CRM.GetTrans("Link_CompPhon","Modem"));
phonevalidation(FormValues("phon_numbermodem"),CRM.GetTrans("Link_CompPhon","Modem"));
phonevalidation(FormValues("phon_countrycodetoll_free"),CRM.GetTrans("Link_CompPhon","Toll_Free"));
phonevalidation(FormValues("phon_areacodetoll_free"),CRM.GetTrans("Link_CompPhon","Toll_Free"));
phonevalidation(FormValues("phon_numbertoll_free"),CRM.GetTrans("Link_CompPhon","Toll_Free"));
phonevalidation(FormValues("phon_countrycodehome"),CRM.GetTrans("Link_PersPhon","Home"));
phonevalidation(FormValues("phon_areacodehome"),CRM.GetTrans("Link_PersPhon","Home"));
phonevalidation(FormValues("phon_numberhome"),CRM.GetTrans("Link_PersPhon","Home"));
phonevalidation(FormValues("phon_countrycodemobile"),CRM.GetTrans("Link_PersPhon","Mobile"));
phonevalidation(FormValues("phon_areacodemobile"),CRM.GetTrans("Link_PersPhon","Mobile"));
phonevalidation(FormValues("phon_numbermobile"),CRM.GetTrans("Link_PersPhon","Mobile"));
}
function PostInsertRecord()
{
// Handle post insert record actions here
}
function UpdateRecord()
{
// Handle update record actions here
emailvalidation(FormValues("emai_emailaddressbusiness"),"emai_emailaddressbusiness");
emailvalidation(FormValues("emai_emailaddresssales"),"emai_emailaddresssales");
emailvalidation(FormValues("emai_emailaddresssupport"),"emai_emailaddresssupport");
phonevalidation(FormValues("phon_countrycodebusiness"),CRM.GetTrans("Link_CompPhon","Business"));
phonevalidation(FormValues("phon_areacodebusiness"),CRM.GetTrans("Link_CompPhon","Business"));
phonevalidation(FormValues("phon_numberbusiness"),CRM.GetTrans("Link_CompPhon","Business"));
phonevalidation(FormValues("phon_countrycodefax"),CRM.GetTrans("Link_CompPhon","Fax"));
phonevalidation(FormValues("phon_areacodefax"),CRM.GetTrans("Link_CompPhon","Fax"));
phonevalidation(FormValues("phon_numberfax"),CRM.GetTrans("Link_CompPhon","Fax"));
phonevalidation(FormValues("phon_countrycodeisdn"),CRM.GetTrans("Link_CompPhon","ISDN"));
phonevalidation(FormValues("phon_areacodeisdn"),CRM.GetTrans("Link_CompPhon","ISDN"));
phonevalidation(FormValues("phon_numberisdn"),CRM.GetTrans("Link_CompPhon","ISDN"));
phonevalidation(FormValues("phon_countrycodemodem"),CRM.GetTrans("Link_CompPhon","Modem"));
phonevalidation(FormValues("phon_areacodemodem"),CRM.GetTrans("Link_CompPhon","Modem"));
phonevalidation(FormValues("phon_numbermodem"),CRM.GetTrans("Link_CompPhon","Modem"));
phonevalidation(FormValues("phon_countrycodetoll_free"),CRM.GetTrans("Link_CompPhon","Toll_Free"));
phonevalidation(FormValues("phon_areacodetoll_free"),CRM.GetTrans("Link_CompPhon","Toll_Free"));
phonevalidation(FormValues("phon_numbertoll_free"),CRM.GetTrans("Link_CompPhon","Toll_Free"));
phonevalidation(FormValues("phon_countrycodehome"),CRM.GetTrans("Link_PersPhon","Home"));
phonevalidation(FormValues("phon_areacodehome"),CRM.GetTrans("Link_PersPhon","Home"));
phonevalidation(FormValues("phon_numberhome"),CRM.GetTrans("Link_PersPhon","Home"));
phonevalidation(FormValues("phon_countrycodemobile"),CRM.GetTrans("Link_PersPhon","Mobile"));
phonevalidation(FormValues("phon_areacodemobile"),CRM.GetTrans("Link_PersPhon","Mobile"));
phonevalidation(FormValues("phon_numbermobile"),CRM.GetTrans("Link_PersPhon","Mobile"));
}
function DeleteRecord()
{
// Handle delete record actions here
}