You need to sign in to do that
Don't have an account?
Hector Alanis
How to fill wrapper class attributes
I want to to fill this class but I can't reach wrapper attributes:
I try
but told me: FATAL_ERROR System.ListException: List index out of bounds
what I'm doing wrong...
how I fill all object?
public class PricingMotor_cls { public Double cost; public OrderItems[] orderItems; //Wrapper for OrderItem public class OrderItems { public Integer quantity; public CashAmounts creditAmounts; } //Wrapper CashAmounts public class CashAmounts { public Double totalPrice; public OrderConditions[] orderConditions; } //Wrapper OrderConditions public class OrderConditions { public String conditionType; public Decimal amount; } }
I try
List<ISSM_DeserializePricingMotor_cls.OrderItems> abc = new ISSM_DeserializePricingMotor_cls.OrderItems[1]; abc[0].quantity = 1;
but told me: FATAL_ERROR System.ListException: List index out of bounds
what I'm doing wrong...
how I fill all object?
To accomplish what you want, you have to create a new instance of PricingMotor_cls and then create a new instance of List<OrderItems>. Try this code below:
I hope you find this solution helpful. If it does, please mark as Best Answer to help other too.
Regards.
All Answers
To accomplish what you want, you have to create a new instance of PricingMotor_cls and then create a new instance of List<OrderItems>. Try this code below:
I hope you find this solution helpful. If it does, please mark as Best Answer to help other too.
Regards.
I am running into a similary query. What if there is another list inside orderItems. How can I add to it?