You need to sign in to do that
Don't have an account?
ifthikar Ahmed 1
pls clarify
Hi..
i am new to salesforce ,
in visual force , while using controller to get the object fields from an object 2 typs of methods are used
1.
public Account getAccount() {
return account;
}
2.
public Account account { get; private set; }
does they both do the same job and which place we hv to go with the 1st method and for which place do we have to go with 2nd , pls explain
i am new to salesforce ,
in visual force , while using controller to get the object fields from an object 2 typs of methods are used
1.
public Account getAccount() {
return account;
}
2.
public Account account { get; private set; }
does they both do the same job and which place we hv to go with the 1st method and for which place do we have to go with 2nd , pls explain
Link: https://youtu.be/J3SNz1DPoAM
All Answers
Please refer the below link. This will help you to clear all your doubts.
http://www.forcetree.com/2009/07/getter-and-setter-methods-what-are-they.html
Hope this will help you. If does, then mark it as the best answer so it can also help others in the future.
Many Thanks,
Sunil Rathore
Thank you
it does help yet i am not getting a clear picture,
Get and Set are properties to read and write the values respectively. To set their accessibility within or outside of the class,
we use private, public, protected access modifiers.
Please go through below links to analyse difference between them.It may be helpful for you.
Link: http://www.sfdcpanda.com/getter-and-setter-methods-in-salesforce/
Link: https://developer.salesforce.com/forums/?id=906F0000000Au38IAC
Link: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_controller_getter_methods.htm
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha
www.kdeepali.com
Link: https://youtu.be/J3SNz1DPoAM