You need to sign in to do that
Don't have an account?
gtuerk_greensaas
Using composite sObject Tree in Composite request
I'm able to create an Order using the resource /services/data/v43.0/composite/tree/order, passing into the body some standard Order fields and a custom object related record set. So that works.
I'm able to create a composite request using the resource /services/data/v43.0/composite/ that generates a custom object, reads it back, generates another custom object. These with simple posts with data including the fields to be filled on the object. So that works.
What I can't do is to chain a composite call to resource /services/data/v43.0/composite and includes one of the transactions as a Post to the tree resource. Has anybody else solved this? The tree resource has slight syntactical differences (records is the root, rather than just the first field on the object), and I've tried each way, but to no avail. Here's a sample of my
{
"allOrNone" : true,
"compositeRequest" : [{
"method" : "POST",
"url" : "/services/data/v43.0/sobjects/Service__c",
"referenceId" : "NewService",
"body" : {
"Name" : "Insert Product Name here",
"Status__c" : "Ordered",
"Technical_Contact__c" : "003Z000002wpIVVIA2",
"Account__c" : "001Z000001MCkgLIAT"
}
},{
"method" : "GET",
"referenceId" : "NewServiceInfo",
"url" : "/services/data/v43.0/sobjects/Service__c/@{NewService.id}"
},{
"method":"POST",
"url":"/services/data/v43.0/composite/tree/Order",
"referenceId":"NewOrder",
"body": {
"AccountId" : "001Z000001MCkgLIAT",
"EffectiveDate" : "2018-08-01",
"Status" : "Draft",
"Ordered_Service_Components__r" : {
"records":[{
"attributes" : {"type":"Service_Component__c", "referenceId":"ref2"},
"Monthly_Recurring_Revenue__c": 800,
"Status__c":"Pending Install",
"Service__c":"a08Z0000006Z52DIAS",
"Product_Pricing_Item__c":"a05Z00000097NjzIAE"
}]
}
}
}]
}
Any suggestions or commentary from SFDC product are welcome
I'm able to create a composite request using the resource /services/data/v43.0/composite/ that generates a custom object, reads it back, generates another custom object. These with simple posts with data including the fields to be filled on the object. So that works.
What I can't do is to chain a composite call to resource /services/data/v43.0/composite and includes one of the transactions as a Post to the tree resource. Has anybody else solved this? The tree resource has slight syntactical differences (records is the root, rather than just the first field on the object), and I've tried each way, but to no avail. Here's a sample of my
{
"allOrNone" : true,
"compositeRequest" : [{
"method" : "POST",
"url" : "/services/data/v43.0/sobjects/Service__c",
"referenceId" : "NewService",
"body" : {
"Name" : "Insert Product Name here",
"Status__c" : "Ordered",
"Technical_Contact__c" : "003Z000002wpIVVIA2",
"Account__c" : "001Z000001MCkgLIAT"
}
},{
"method" : "GET",
"referenceId" : "NewServiceInfo",
"url" : "/services/data/v43.0/sobjects/Service__c/@{NewService.id}"
},{
"method":"POST",
"url":"/services/data/v43.0/composite/tree/Order",
"referenceId":"NewOrder",
"body": {
"AccountId" : "001Z000001MCkgLIAT",
"EffectiveDate" : "2018-08-01",
"Status" : "Draft",
"Ordered_Service_Components__r" : {
"records":[{
"attributes" : {"type":"Service_Component__c", "referenceId":"ref2"},
"Monthly_Recurring_Revenue__c": 800,
"Status__c":"Pending Install",
"Service__c":"a08Z0000006Z52DIAS",
"Product_Pricing_Item__c":"a05Z00000097NjzIAE"
}]
}
}
}]
}
Any suggestions or commentary from SFDC product are welcome
Did you get any solution of this yet?
Or we have to break only these calls?