2

So my component has an attribute defined like this:

<aura:attribute name="accountId" type="String" default="" />

that holds the value of a lookup lightning:inputField. I am setting the parameter like so:

createDataExport.setParams({"accountId" : component.get('v.accountId')});

and the backend controller looks like this:

@AuraEnabled
public static String startExport(String accountId) {

and yet I am still getting the error Value provided is invalid for action parameter accountId of type 'String'. I have also tried changing over to type Id but no dice. I've also made sure that the attribute is populating properly, and it is.

Any help is appreciated.

1

I figured it out, you need to get the value of the attribute this way because an array proxy is returned by default:

createDataExport.setParams({"accountId" : component.get('v.accountId')[0]});
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.