Skip to content

Instantly share code, notes, and snippets.

@eggsurplus
Created August 22, 2012 17:51
Show Gist options
  • Save eggsurplus/3427913 to your computer and use it in GitHub Desktop.
Save eggsurplus/3427913 to your computer and use it in GitHub Desktop.
Make a field required/not required in edit view of SugarCRM
function setFieldRequired(fieldName, req, msgStr){
if(!msgStr){ msgStr = fieldName; }
for(var i = 0; i < validate["EditView"].length; i++){
if(validate["EditView"][i][nameIndex] == fieldName) {
validate["EditView"][i][msgIndex] = msgStr;
validate["EditView"][i][requiredIndex] = req;
break;
}
}
}
@matthewpoer
Copy link

Now show us the opposite to make a required field not-so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment