Skip to content

Instantly share code, notes, and snippets.

@jechlin
Created October 20, 2015 19:45
Show Gist options
  • Select an option

  • Save jechlin/6347df8da08c4c3478b9 to your computer and use it in GitHub Desktop.

Select an option

Save jechlin/6347df8da08c4c3478b9 to your computer and use it in GitHub Desktop.
def purchaseAmount = getFieldByName("Purchase Amount")
def relationshipField = getFieldByName("Relationship Type")
def gsm = getFieldByName("GSM")
def isStrategic = relationshipField.getValue().toString() == "Strategic"
def moreThanTenK = purchaseAmount.getValue() as Long
if (isStrategic || moreThanTenK) {
gsm.setRequired(true).setHidden(false)
}
else {
gsm.setRequired(false).setHidden(true)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment