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
Ravichandra sindheRavichandra sindhe 

generic function to replace varibale values in a message text in apex

Hi All

i am planning to write one generic function to replace varibale values in a message text.

Example :

i am keeping message text in a table

1.i pass message Id to getch message text from a table

2.once i get message text from table.

messagetext: *%variable1%* number chnaged along with customer *%variable2%* name

so i pass input parameters like below

param[0];:'Home';
Param[1]:'Ravi';

pass these params to to replace those messagetext variable values .

and get the fuinal text

 

so how much ever i pass param values mu generic function should take those values and replace the varibale and give me the text.

 

so please do help me