2

How to use LPAD or RPAD, I tried some examples from

https://help.salesforce.com/articleView?id=customize_functions_i_z.htm&type=0&language=en_US&release=206.5

LPAD( Account.Name , 2 )

Error: Formula result is data type (Text), incompatible with expected data type (true or false).

LPAD('my_company.com', 14, 'z')

Error: Formula result is data type (Text), incompatible with expected data type (true or false).

LPAD( Account.Name , 5 [, 'a'])

Error: Syntax error. Missing ')'

2
  • What is return type of your formula field
    – Reshma
    Commented Jan 23, 2017 at 6:27
  • Return type is text or string, I am New to salesforce and Just want to know how these validation Rule works, just need an example to try it. Commented Jan 23, 2017 at 6:34

1 Answer 1

1

Create a formula field with return type as Text. LPAD and RPAD returns a text value not boolean. See the image below. From doc:-

LPAD inserts characters you specify to the left-side of a text string. RPAD inserts characters that you specify to the right-side of a text.

string. enter image description here It will return output like this. Try with different values. enter image description here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .