Hello everybody I am currently working on a Flow that receives the Id from the record where the LWC action is and pass it to the LWC.
The LWC is a form that shows some lightning-input and lightning-comboboxes and some of this lightning-input are empty so the user can fill them, but there are other lightning-input that I want to default show the value of the name and other fields from the record.
And also I want that every time the user clicks in the action button to show the Form with the populated fields I am troubling.
So in my apex class I created the next wrapper to return it to the LWC:
@AuraEnabled(cacheable= True)
public static WraperSObject getInformation(Id recordIdFlow){
MySObject information = new MySObject();
information = [SELECT Id, Name FROM MySObject WHERE Id =: recordIdFlow];
WraperSObject wrapperPS = new WraperSObject();
wrapperPS.name = puntoSuministro.Name;
return wrapperPS;
}
public class WraperSObject{
@AuraEnabled public String id{get;set;}
@AuraEnabled public String name{get;set;}
}
And in my .js I have the next code:
cups; //variable where I want to put the value that comes from the wrapper.
wiredRecord;
@wire(getInformation,{recordIdFlow: 'recordId'})
wiredInfo(result){
this.wiredRecord = result;
console.log('information from wrapper'+ result);
//dont know how to assign the value from the wrapper in the js variable
}
And in my .html the field is this:
<lightning-input type="text" label="CUPS" max-length="22" name="cups"></lightning-input>
Could anybody help me?
Thanks