i have a josn str, when i deserializeObject i got the error"The type of object cannot be set."
[DataContractAttribute]
class RPS_SF_Product_Response
{
real totalSize;
boolean done;
List records;
[DataMemberAttribute('totalSize')]
public real parmtotalSize(real _totalSize = totalSize)
{
totalSize = _totalSize;
return totalSize;
}
[DataMemberAttribute('done')]
public boolean parmdone(boolean _done = done)
{
done = _done;
return done;
}
[DataMemberAttribute('records'), DataCollectionAttribute(Types::Class, classStr(RPS_SF_ProductLine_Response))]
public List parmrecords(List _records = records)
{
records = _records;
return records;
}
}
[DataContractAttribute]
class RPS_SF_ProductLine_Response
{
str Id;
str Name;
str ProductCode;
[DataMemberAttribute('Id')]
public str parmId(str _Id = Id)
{
Id = _Id;
return Id;
}
[DataMemberAttribute('Name')]
public str parmName(str _Name = Name)
{
Name = _Name;
return Name;
}
[DataMemberAttribute('ProductCode')]
public str parmProductCode(str _ProductCode = ProductCode)
{
ProductCode = _ProductCode;
return ProductCode;
}
}
productCheck={
"totalSize": 2,
"done": true,
"records": [{
"Id": "01t5C000006BiJQQA0",
"Name": "All-Purpose Whipped Topping For Bread, Pastry and Cake (Avos",
"ProductCode": "01314"
}, {
"Id": "01t5C000006BiK5QAK",
"Name": "All-Purpose Whipped Topping For Bread, Pastry and Cake (Avos",
"ProductCode": "01314"
}]
}
RPS_SF_Product_Response Product_Response;
Product_Response = FormJsonSerializer::deserializeObject(classNum('RPS_SF_Product_Response'), productCheck);