You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Validation rule in Opportunity Revenue Displays Error For All Cases

We are writing a validation rule to indicate that Quantity cannot be in decimal and Unit Price cannot be below Zero while adding a product. The script is written in Opportunity Revenue Object but the validation is shown for all positive scenarios too (Even if Price is above 0 and quantity is not decimal)

Steps to reproduce:

App Composer -> Opportunity Revenue Object -> Server scripts -> Validation rules -> Object Rules.

Groovy script written:

def regexQty = /^[0-9]*$/

if (!Quantity.toString().matches(regexQty))

{

 return false;

}

if (UnitPrice<0)

return false;

}

return true

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!