Require a number greater than 0 on string variable on Record Producer

MBMRED
Tera Contributor

Scenario:

  1. Record Producer for a demand on the ESC
  2. Q1: Is this a capital project (y/n)
    1. If yes, make Est Capital Expense mandatory and non-zero.
  3. Est Capital Expense
    1. SLT
    2. Validation Regex=Number

For Est Capital Expense, how do I force users to enter a value >0 to submit this form?

  • I have a UI policy to make it mandatory
  • I have second UI Policy that I want to clear the value and throw an error if the value is empty or if they enter a zero. (This is what I can't get to work)

Any ideas or options for me to explore?  

 

2 REPLIES 2

MBMRED
Tera Contributor

NOTE: the goal of this field is to map to the demand form as a currency.  Demand manager will update the Est Capital Expense as they work the demand. This will then map to the project when the demand is approved and the project created.   

Hope this helps with the context.  

Thanks for your time and help!

 

Joe Wong
Tera Guru

Is your cost field a Floating Point Number?  If so, your UI Policy should work.  I have the following setup in my PDI.

uipolicy.jpg
 

 

Then add this to your "if true execute" script:

 

g_form.clearValue("your_variable");
g_form.showFieldMsg("your_variable", "Cost must be greater than 0","error");

 

As you mentioned, you get the mandatory part working, this should get the less than 0 part working for you.

 

Hope this helps.