You need to sign in to do that
Don't have an account?
M.sf
How to get select option return type in aura enabled methods?
If the return type in aura enabled method is returning and error and not able to solve. Is there any options apart from adding new class to enable aura to select option class?
@AuraEnabled
public List<SelectOption> getObjDetails() {
//do something
}
@AuraEnabled
public List<SelectOption> getObjDetails() {
//do something
}
Try making your function as static as below,
@AuraEnabled
public static List<SelectOption> getObjDetails() {
//do something
}
Thanks for reply. I tried that previosuly no luck Below is the error.
Error: Compile Error: Return type does not support AuraEnabled at line ** column **
yes you can
check similar post here for return select options from auraEnabled methods
http://www.sfdcmonkey.com/2016/12/05/how-to-fetch-picklist-value-from-sobject-and-set-in-uiinputselect/
Hops it helps
thanks
You can do a workaround to SelectOption class, by creating a your custom SelectOption class. See below, this a very simple with label and value options only, you can build on this and add new constructors and variables.
Now you can use this class for your getPicklistValue Method. See Below: