AnsweredAssumed Answered

Validate Discount amount with Unit price in Quote line items

Question asked by Vijayakumar S on Feb 5, 2018
Latest reply on Feb 6, 2018 by Vijayakumar S

Hi,

 

I am using sugar 7.9 version. I am trying to validate the quote line item based on the below criteria.

 

If Discount amount is greater than Unit price then I need to show a error message like `Total Discount amount should be less than or equal to the Unit price`.

 

I tried to achieve this using

 

'validation' => array(
'type' => 'range',
'min' => '0',
'max' => '$discount_price,
),

It's not working as expected. 

But both the fields are in currency datatype. So I am not sure How to achieve this validation.

 

Thanks in advance

Outcomes