+ Start a Discussion
SandrineSandrine 

intialization of custom label in test class

Hello

If i have custom label.
How should i intialize in test class ?
Best Answer chosen by Sandrine
Amit Chaudhary 8Amit Chaudhary 8
Hi Sandrine,

you can not intialize  custom label value by apex class. For same below idea ia raised. Please vote for same if you need same
1) https://success.salesforce.com/ideaView?id=08730000000DgpGAAS

BUt you can use the existing custom label value in your test classes.
1) https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_variables_global_label.htm
2) https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_customlabels.htm

Let us know if you need more help

All Answers

SandrineSandrine
i do not want to test it

I want to intialize Label.<custom label name> = something ?
sfdcMonkey.comsfdcMonkey.com
hi Sandrine
we can not update custom label value via apex
you can vote for this issue on success communities
https://success.salesforce.com/ideaView?id=08730000000DgpGAAS
thanks
let me inform if it helps you :)
Amit Chaudhary 8Amit Chaudhary 8
Hi Sandrine,

you can not intialize  custom label value by apex class. For same below idea ia raised. Please vote for same if you need same
1) https://success.salesforce.com/ideaView?id=08730000000DgpGAAS

BUt you can use the existing custom label value in your test classes.
1) https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_variables_global_label.htm
2) https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_customlabels.htm

Let us know if you need more help
This was selected as the best answer