Activity Forums Salesforce® Discussions Salesforce Validation Rule while inserting a text value error

  • Sudhir

    Member
    June 9, 2017 at 2:50 am

    You may use something like this:  IF(RIGHT(Text_Field_API__c , 4) == 'Text', true, false)

  • Sudhir

    Member
    June 12, 2017 at 8:24 am

    Did this work for you.

  • Uday

    Member
    June 14, 2017 at 11:21 am

    Hi HARSHITA,

    Try this triggers code
    trigger TextError on Account (before insert) {
    public String res;
    for(Account a:trigger.new)
    {
    res=a.name.right(4);
    if(res!='text') {
    a.addError('last 4 digits must text');
    }
    }
    }

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos