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
Daniel B ProbertDaniel B Probert 

=CODE equivalent in Salesforce

Hey,

 

I currently have an excel formula that generates a random code based on the salesforce id.

 

i'm keen to move this into salesforce but can't find what formula would do the same.

 

this is the formula - imagine that A2 is the salesforce id.

 

=CODE(MID(A2,11,1))&"."&CODE(MID(A2,12,1))&"."&CODE(MID(A2,13,1))&"."&CODE(MID(A2,14,1))&"."&CODE(RIGHT(A3))

 

The mid bit works fine I just can't find what formula I can use for the CODE.

 

Any help welcomed.

 

dan

liron169liron169
Hi,

I don't think SF have equivalent function for this.
You can write such, but it will require apex code.