I am trying to pass multiple opp Ids in order to link a file that is getting uploaded to those opps. I have my list of records Ids that I am passing to the apex but I am getting an error, {message: "Value provided is invalid for action parameter 'recordIds' of type 'LIST'"}
In my javascript I have the list of recordIds which is as follows: 4 here is recordIds [{"id":"0068A00000BaRAQQA3"},{"id":"0068A00000BaRASQA3"}]
Here is my javascipt:
//from button to add new file
handleClick(){
const recordIds = this.oppIdsToLink;
const {base64, filename, recordId} = this.fileData
console.log('4 here is recordIds ' + JSON.stringify(recordIds));
uploadFile({ base64, filename, recordId, recordIds }).then(result=>{
this.fileData = null
let title = `${filename} uploaded successfully!!`
this.toast(title)
})
console.log('after the uploadfile');
}
here is my simplified apex where the recordIds is null (the other vars are populated):
public static string uploadFile(String base64, String filename, String recordId, List<String> recordIds) {
system.debug(logginglevel.info, '!! 1 here is the recordId ' + recordId);
system.debug(logginglevel.info, '!! 1 here is the recordIds ' + recordIds);
system.debug(logginglevel.info, '!! 1 here is the filename ' + filename);
}
Any help would be greatly appreciated!