0

I'm trying to pass an apex defined variable from LWC to flow, the class looks like this:

public class Subs {
    @AuraEnabled
    public String name{get;set;}
    @AuraEnabled
    public List<PhoneNumber> numbers{get;set;}
    @AuraEnabled
    public String iccid{get;set;}

    public Subs(String name, List<PhoneNumber> numbers, String iccid){
        this.name = name;
        this.numbers = numbers;
        this.iccid = iccid;
    }

}

it looks like that once I add the List PhoneNumber salesforce flow cant handle it since its another class.

I'm having the following error: The Lightning Component c:dataListPOC generated invalid output for field selectedSubs. Contact your administrator with these details: Flow encountered an error when processing and converting between data types. Please check the flow and ensure all data types are matched correctly.

is this possible to pass this complex apex objects to flow or flow only allows primitive variables inside the object?

Than you

0

So, Just understand why.

I dont know why but if PhoneNumber class has a constructor without params, it works.

public class PhoneNumber {
@AuraEnabled
public String country{get;set;}
@AuraEnabled
public String numberX{get;set;}

public PhoneNumber(String country, String numberX){
    this.country = country;
    this.numberX = numberX;
}

public PhoneNumber(){

}

}

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.