function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sakthivelsakthivel 

Need Help on lpad formula

i want to convert 1 to 001 by workflow or anything..

 

My custom field name -  Number_of_Vacancies

 

i used this formula

 

lpad( Number_of_Vacancies2__c ,3,'0')

 

giving error, to change the filed type to text

 

lpad( text(Number_of_Vacancies2__c) ,3,'0') Not helping.. any idea ? ?

Best Answer chosen by Admin (Salesforce Developers) 
harsha__charsha__c

Hi sakthivel,

 

Salesforce by default removes the leading 0's from a number value.

 

So, you can achieve it by making the field type to "TEXT' and use the same formula you used i.e. lpad( Number_of_Vacancies2__c ,3,'0')

 

After making it to TEXT type, you can apply a validation rule in order the field allows only numeric values, if you need.