-1

there are two custom fields which are Total fee and invoiced fee, for job object i need add validation rule so that Invoiced fee always less than total fee, user cannot able issue invoice greater than total value. but now because of business needs i need to change my validation according to following scenarios.

senario 1: invoiced fee always less than equals to Total fee

    Total_fee__c = $100
    Invoiced_fee__C = $90 something like this

Senario 2: But in Some cases user already issued invoices even though Total_fee__c=0, so for this kind of records we need to excuse validation rule or we can have one more condition with exact opposite way, like invoiced fee can greater than Total fee

in a simple logic

if(Total_fee__c=0)
        { 
        Invoiced_fee__C>Total_fee__c
        }
        else(Total_fee__c !=0){Invoiced_fee__C<=Total_fee__c)
        }

Data type of both fields are number , Please someone gave me validation rule for this senario.

3

Validation rules trigger when the formula evaluates to true, so I think you really just need to check that total fee is not zero and Invoiced Fee is greater than Total Fee.

AND(Total_Fee__c>0, Invoice_Fee__c>Total_Fee__c)

Remember, in formulas, you rarely need to use IF, because the results of AND, OR, NOT, <, >, <=, >=, <>, and != can all be used as direct Boolean values.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.