SAP Open Connectors

Microsoft Dynamics - Create Objects Attached to other Objects

Microsoft Dynamics allows for the creation of objects that can be attached to other objects. For example, one can create a Contact with Activities attached to the Account. Another example is creating an Account and then creating a Case attached to that Account. The Activity and the Case are independent objects that can be created without having to be attached to another object as well. 


Img 1 - A Task (which is a type of Activity) attached to a Contact


In SAP Open Connectors, you can create this Task using the Swagger on the Microsoft Dynamics connector instance. 


If you would like this Task to be attached to an Account, or a Contact (or another object that allows Tasks to be attached to it), the minimum Task create body looks like this:

{

 

  "fetchMetaInfo": true,

 

  "attributes": {

 

    "regardingobjectid": {

 

      "id": "41xxxxxx-bxx9-exx1-axx9-00xxxxxxxxxa4",

 

      "lookup": "contact"

 

    },

 

    "subject": "newest task"

 

  }

 

}





To create a Case attached to an object, the body is a little different. Here is the payload for creating a Case on an Account object. You can change the name of the object in the lookup value.


{

 

  "attributes": {

 

    "title": "New Case",

 

    "description": "description here",

 

    "customerid": {

 

      "id": "7xxxxxxxxd-cxx6-exx1-axxx2-00xxxxxxxxdd",

 

      "lookup": "account"

 

    }

 

  },

 

  "fetchMetaInfo": true

 

}