Difference between revisions of "Making Contact Standard Fields Mandatory"
From SmartWiki
m |
(→See Also) |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | #Go to the [[Contact and Account Standard Fields|Contact Standard Fields]] settings page from the [[Global Settings]] page. | |
+ | #Select the standard field you want to make mandatory. | ||
+ | #Check off the "Mandatory" checkbox. | ||
+ | #Hit Save. | ||
+ | |||
+ | ----- | ||
+ | |||
+ | ''Alternate method:'' Create a custom field of type [[Custom Field Type: Special – Browser Script]] and place it on the same entity that you'll be using it. For contacts, you'll want to put the custom field in via [[Global Settings]] > [[User & Contact Settings]] > Contact Custom Fields | ||
<pre> | <pre> | ||
− | function | + | function savefunc(frm){ |
− | + | var element=frm.uaddress; | |
− | + | if(element&&element.value.length==0){ | |
− | + | alert("Address is empty!"); | |
− | + | return false; | |
− | + | } | |
− | + | element=frm.phone; | |
− | + | if(element&&element.value.length==0){ | |
− | + | alert("Phone is empty!"); | |
− | + | return false; | |
− | + | } | |
− | + | element=frm.ucity; | |
− | + | if(element&&element.value.length==0){ | |
− | + | alert("City is empty!"); | |
− | + | return false; | |
− | + | } | |
− | + | element=frm.ucountry; | |
− | + | if(element&&(element.value.length==0||element.value=="0")){ | |
− | + | alert("Country is empty!"); | |
− | + | return false; | |
− | + | } | |
− | + | element=frm.email; | |
− | + | if(element&&element.value.length==0){ | |
− | + | alert("Email is empty!"); | |
− | + | return false; | |
− | + | } | |
− | + | return true; | |
− | + | }</pre> | |
− | } | ||
− | |||
− | |||
+ | ==See Also== | ||
+ | * [[Contact_and_Account_Standard_Fields#Mandatory|Contact and Account Standard Fields]] | ||
+ | * [[Making Company Standard Fields Mandatory]] | ||
+ | * [[Making Company Mandatory for Contact Records]] | ||
[[Category: Custom Fields]][[Category:JavaScript]] | [[Category: Custom Fields]][[Category:JavaScript]] |
Latest revision as of 15:10, 15 July 2013
- Go to the Contact Standard Fields settings page from the Global Settings page.
- Select the standard field you want to make mandatory.
- Check off the "Mandatory" checkbox.
- Hit Save.
Alternate method: Create a custom field of type Custom Field Type: Special – Browser Script and place it on the same entity that you'll be using it. For contacts, you'll want to put the custom field in via Global Settings > User & Contact Settings > Contact Custom Fields
function savefunc(frm){ var element=frm.uaddress; if(element&&element.value.length==0){ alert("Address is empty!"); return false; } element=frm.phone; if(element&&element.value.length==0){ alert("Phone is empty!"); return false; } element=frm.ucity; if(element&&element.value.length==0){ alert("City is empty!"); return false; } element=frm.ucountry; if(element&&(element.value.length==0||element.value=="0")){ alert("Country is empty!"); return false; } element=frm.email; if(element&&element.value.length==0){ alert("Email is empty!"); return false; } return true; }