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:

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.


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]});

Thanks for the insight. I applied this to LWC.

HTML Code:

<lightning-record-edit-form object-api-name="object_API_name">
     value ={value} 

JS Code

        this.property = (event.detail.value)[0];

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.