You need to sign in to do that
Don't have an account?
Will Jones 18
Create Nested JSON string to pass Opportunity Contact Roles
I'm looking to pass all contacts on an opportunity to an external system when an opp is saved/updated. The JSON format is below. What is the best way to achieve this?
Example output:
[
{
"opportunity_contact_role_id":"",
"contact_id":"",
"role":"",
"is_primary":""
},
{
"opportunity_contact_role_id":"",
"contact_id":"",
"role":"",
"is_primary":""
}
]
Example output:
[
{
"opportunity_contact_role_id":"",
"contact_id":"",
"role":"",
"is_primary":""
},
{
"opportunity_contact_role_id":"",
"contact_id":"",
"role":"",
"is_primary":""
}
]
You can create a wrapper class for that and then JSON.serialize method in apex.