You need to sign in to do that
Don't have an account?
Syed Moin Pasha
unable to fetch currencyTypes in apex class in the MultiCurrency Disabled org
Hi,
I am beginner in lightning
unable to fetch currencyTypes in apex class in the MultiCurrency Disabled org
Here is my Code
@AuraEnabled
public static List<selectOptions> getCurrencies(){
List<selectOptions> options = new List<selectOptions>();
boolean IsmultiCurrencyEnabled = Schema.getGlobalDescribe().containsKey('CurrencyType');
if(IsmultiCurrencyEnabled){
List <CurrencyType> currencies = Database.Query('SELECT IsoCode FROM CurrencyType');
for(CurrencyType a : currencies){
options.add(new SelectOptions(a.IsoCode,a.IsoCode));
}
}
return options;
}
Error : Invalid type: CurrencyType
Please help me out with this
I am beginner in lightning
unable to fetch currencyTypes in apex class in the MultiCurrency Disabled org
Here is my Code
@AuraEnabled
public static List<selectOptions> getCurrencies(){
List<selectOptions> options = new List<selectOptions>();
boolean IsmultiCurrencyEnabled = Schema.getGlobalDescribe().containsKey('CurrencyType');
if(IsmultiCurrencyEnabled){
List <CurrencyType> currencies = Database.Query('SELECT IsoCode FROM CurrencyType');
for(CurrencyType a : currencies){
options.add(new SelectOptions(a.IsoCode,a.IsoCode));
}
}
return options;
}
Error : Invalid type: CurrencyType
Please help me out with this
Greetings to you!
This object is for multicurrency organizations only. CurrencyType represents the currencies used by an organization for which the multicurrency feature is enabled.
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_currencytype.htm
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas