728x90
Custom Label에서 파라미터를 사용하여 변수를 지정하여 사용 할 수 있습니다.
Label name: MyTestLabel
Label value: Thank you, {0}, for your feedback.
List<String> parameters = new List<String>();
parameters.add('John');
String label = Label.MyTestLabel;
String value = String.format(label, parameters);
You can do it in one line like this as well:
String.format(Label.MyTestLabel, new String[]{'John'});
String.format(Label.MyTestLabel, new List<String>{'John'});
참고 :
https://salesforce.stackexchange.com/questions/40042/parameterized-custom-label
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_methods_system_string
728x90
'Salesforce > Development' 카테고리의 다른 글
Apex에서 종속 선택 목록 값 가져오기 (Get Dependent Picklist Values in Apex) (0) | 2022.04.20 |
---|---|
Safe Navigation Operator 안전 탐색 연산자(?.) (0) | 2022.04.19 |
String.isEmpty() & String.isBlank() & String.isNotEmpty() & String.isNotBlank() 차이점 (0) | 2022.04.18 |
세일즈포스 사용자 정의 알림 (Salesforce Custom Notification) 설정 및 구현 (0) | 2021.04.13 |
Salesforce Standard / Custom Object Mass Delete 기능 구현 (0) | 2021.03.15 |