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
Trif Cristian 7Trif Cristian 7 

how this method works?

Hi, I have a very basic question.. But I don't know whats happening in this method, I know its an embarrassing question.

public String conversionPageDescription {
        get {
            return Label.CONTACT_CONV_MSG_TEXT_DESCRIPTION.replace('{1}', pageForm.contact.FirstName + ' ' + pageForm.contact.LastName);
        }
    }

Best Answer chosen by Trif Cristian 7
Trif Cristian 7Trif Cristian 7
I found my answer, it's an apex property: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_properties.htm

All Answers

Raj VakatiRaj Vakati
This metod will do the following actions 

1.  Return the values to the calling place ( VF page)
2 . Return value is coming from the CONTACT_CONV_MSG_TEXT_DESCRIPTION Label 
3. You are updating the label data dynamicall with the fomrate option .. Menas 
Your label is conatins value {1} Hello --> it will replace outout with contact firstname followed by hello  and last name 

Refer this link 

https://egarakesh.wordpress.com/2016/08/12/salesforce-parameterized-custom-labels/
 
Trif Cristian 7Trif Cristian 7

Yes, but this line is a variable, conversionPageDescrption it's a string variable, right?
 

public String conversionPageDescription {
 

How it transforms from a string variable  into a method? I thought a method need to have parameters like this, for example: 
 

public String conversionPageDescription () {}

 
Trif Cristian 7Trif Cristian 7
I found my answer, it's an apex property: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_properties.htm
This was selected as the best answer