Skip to Content

$Batch Operation in OData for Account

Hello,

I'm trying to have batch operation for Account which includes services CorporateAccountCollection, ObjectIdentifierMappingCollection and CorporateAccountIdentificationCollection. I'm getting error message "Creation of entities with different authorization is not allowed in single transaction using this service." Here is my body:

--batch

Content-Type: multipart/mixed; boundary=changeset

--changeset

Content-Type: application/http

Content-Transfer-Encoding: binary

POST CorporateAccountCollection HTTP/1.1

Content-Type: application/json

Content-ID: 2

Content-Length: 10000

{ "Name":"Testing Batch Operation MB", "RoleCode":"CRM000", "CountryCode":"US" }

--changeset

Content-Type: application/http

Content-Transfer-Encoding: binary

POST ObjectIdentifierMappingCollection HTTP/1.1

Content-Type: application/json

Content-ID: 2 Content-Length: 10000

{ "RemoteIdentifierDefiningSchemeCode": "888", "RemoteBusinessSystemID": "CAMS", "RemoteObjectID":"M.123456.0000" }

--changeset

Content-Type: application/http

Content-Transfer-Encoding: binary

POST CorporateAccountIdentificationCollection HTTP/1.1

Content-Type: application/json

Content-ID: 2

Content-Length: 10000

{ "IDTypeCode":"Z001", "IDNumber":'9999999999' }

--changeset--

--batch--

Do we need to reference the account object id from first call?

Thanks.

Regards,

MB

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Aug 14 at 06:29 PM

    Hi Mohanbabu,

    not sure and a bit confused concerning the error message, but yes, reading the documentation I would say to create the Identification you need the object ID from the Account and do the POST to another Endpoint using CorporateAccountCollection.

    Regarding the ObjectIdentifierMappingCollection there's no documentation available but as I can see in the OData Explorer, the ObjectID has "nullable:false", so I think you also have to provide it there, too, to do the POST.

    BR Tobias


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 20 at 03:38 AM

    Hi Mohan,

    CorporateAccountIdentification is a child entity of CorporateAccount. The system is expecting a link for CorporateAccountIdentification entity inorder to post the record in the system. In order to achieve this, you need to use the Deep Insert in Batch.

    Sample Payload :

    --batch
    Content-Type: multipart/mixed; boundary=changeset
    
    
    --changeset
    Content-Type: application/http
    Content-Transfer-Encoding: binary
    
    
    POST CorporateAccountCollection HTTP/1.1
    Content-Type: application/json
    Content-ID: 2
    Content-Length: 10000
    
    
    { "Name":"Testing Batch Operation MB", 
      "RoleCode":"XXXXX", 
      "CountryCode":"US", 
      "CorporateAccountIdentification" :
    
    
    [{ "IDTypeCode":"XXXXXX", "IDNumber":"9999999999" }]
    }
    
    
    --changeset--
    --batch--
    

    Similarly, Find the Parent Entity of ObjectIdentifierMappingCollection and tried to pass the data using Deep Insert Format.

    Regards,

    Palani.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.