cancel
Showing results for 
Search instead for 
Did you mean: 

in RAP/OData how do I do a deep create through an association when the parent record already exists?

pmcfarling
Participant
0 Kudos

I can do a deep create using a POST.

{
   "d":{
      "purchasingdoc":"4500000006",
      "purchasingdoccategory":"F",
      "to_mapping":[
         {
            "att_key":"000d3ade-0d5b-1edc-91dd-2a7d7610bc29",
            "att_name":"52.222-21",
            "cat_name":"",
            "fieldtype":"003",
            "fieldTypeText":"CLAUSE LIBRARY",
            "description":"Prohibition of Segregated Facilities",
            "externalversion":"001",
            "internal_external":"0"
         },
         {
            "att_key":"000d3ade-0d5b-1edc-89f6-3f820d83d786",
            "att_name":"1.1.1.1",
            "cat_name":"Quality Clauses",
            "fieldtype":"003",
            "fieldTypeText":"CLAUSE LIBRARY",
            "description":"CLAUSE #1",
            "externalversion":"001",
            "internal_external":"0"
         }
      ]
   }
}

But I cannot seem to figure out how to send an array of mappings in for a purchasing document that already exists.

I can send them individually via a POST through the association. i.e. .../header(db_key=guid'000d3ade-0d5b-1eec-aabf-74507beeecc2')/to_mapping

with a payload of


{
"att_key":"000d3ade-0d5b-1edc-91dd-2a7d7610bc29",
"att_name":"52.222-21",
"cat_name":"",
"fieldtype":"003",
"fieldTypeText":"CLAUSE LIBRARY",
"description":"Prohibition of Segregated Facilities",
"externalversion":"001",
"internal_external":"0"
}

but I cannot figure out how to send multiple in.

Am I going to have to send them in separately via a changeSet?

This can be accomplished quite easily with EML but doesn't seem possible via a OData.

vishal96719
Newcomer
0 Kudos

Hi Team,
We have a similar requirement for posting multiple Items using Deep insert.
While we have successfully utilized RAP OData deep insert for single-item records, multiple-item records are proving to be a challenge. Specifically,  we are getting an error for duplicate key with multi-item records.
I would be grateful if you could provide insights on whether it is currently possible to post multiple items via RAP OData Deep Insert. Alternatively, please advise if we still need to use SEGW ODATA for Deep Insert.
@Andre_Fischer @volkerdrees 
Thanks,
Vishal

Accepted Solutions (1)

Accepted Solutions (1)

volkerdrees
Product and Topic Expert
Product and Topic Expert

Hello Paul,

I guess this is (currently) not possible like in the deep-create case.
What you can do instead is to have multiple create-by-association requests bundled into one changeset, which is then also mass-processed on the RAP backend.

Something like:

--change_set
POST header(<your_id>)/to_mapping
{
   "property":"value" , ...
}

--change_set
POST header(<your_id>)/to_mapping
{
   "property":"value" , ...
}

--change_set
POST header(<your_id>)/to_mapping
{
   "property":"value" , ...
}

--change_set--

Best Regards, Volker

Answers (0)