You need to sign in to do that
Don't have an account?
Pedro Salles
How to put a list in the parameter for class and use its variables?
Hello everyone,
I am new to SF and am trying to solve the following problem:
I have a JSON and I need to pass the data to a list, then use it as my class parameter.
I've managed to pass JSON to a List, but when I put it in the class, it throws the following error:
"global methods do not support parameter type of List<contractFat.Contract>"
My code:
Thanks
I am new to SF and am trying to solve the following problem:
I have a JSON and I need to pass the data to a list, then use it as my class parameter.
I've managed to pass JSON to a List, but when I put it in the class, it throws the following error:
"global methods do not support parameter type of List<contractFat.Contract>"
My code:
@RestResource(urlMapping='/updateFaturamento/*') global class contractFat { public class ContractJSON { public List<Contract> Contract; } public class Contract { public String idSalesForce; public String dtEmissao; public String nrContrato; public String vlVenda; public String vlDevolucao; public String qtTotalClientes; public String qtClientesAtivosMes; public String flagMensal; } public ContractJSON parse(String json) { return (ContractJSON) System.JSON.deserialize(json, ContractJSON.class); } @HttpPatch global static String updateFaturamento(List<Contract> Contratos) { RestRequest req = RestContext.request; RestResponse res = RestContext.response;Can anyone help me with this problem?
Thanks
Best Answer chosen by Pedro Salles
Raj Vakati