Difference between revisions of "Making Company Mandatory for Contact Records"
(Created page with ' To make selecting the Company when creating or editing contacts you must create a custom field of type Custom Field Type: Special – Browser Script and place it on a custo…') |
|||
(3 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
+ | To make selecting the Company when creating or editing contacts you must create a custom field of type [[Custom Field Type: Special – Browser Script]] and place it on a custom field on all contacts via [[Global Settings]] > [[User & Contact Settings]] > Contact Custom Fields. (Terminology may be different in your copy of [[SmartSimple]]) | ||
− | + | <pre> | |
− | + | function savefunc(frm){ | |
− | |||
− | |||
− | function savefunc(frm) | ||
var element=frm.companyid; | var element=frm.companyid; | ||
if((element&&frm.companytxt) && frm.companytxt.style.display!="none" && !frm.companytxt.readonly &&(element.value.length==0||element.value==0)){ | if((element&&frm.companytxt) && frm.companytxt.style.display!="none" && !frm.companytxt.readonly &&(element.value.length==0||element.value==0)){ | ||
Line 11: | Line 9: | ||
} | } | ||
} | } | ||
+ | </pre> | ||
+ | |||
+ | ==See Also== | ||
+ | * [[Making Contact Standard Fields Mandatory]] | ||
+ | * [[Making Company Standard Fields Mandatory]] | ||
[[Category:JavaScript]] | [[Category:JavaScript]] |
Latest revision as of 13:33, 13 August 2013
To make selecting the Company when creating or editing contacts you must create a custom field of type Custom Field Type: Special – Browser Script and place it on a custom field on all contacts via Global Settings > User & Contact Settings > Contact Custom Fields. (Terminology may be different in your copy of SmartSimple)
function savefunc(frm){ var element=frm.companyid; if((element&&frm.companytxt) && frm.companytxt.style.display!="none" && !frm.companytxt.readonly &&(element.value.length==0||element.value==0)){ alert("You must select the Organisation for this contact before saving."); return false; } }