GuidoPreite / DRB

Dataverse REST Builder
MIT License
101 stars 14 forks source link

Support for activity parties while creating new activity type entities like email, appointment etc.... #24

Closed jatinnchhatbar closed 7 months ago

jatinnchhatbar commented 7 months ago

While creaing new appointment , the DRB Editor doesn't allow selection of appointment_activity_parties Web API supports one to many relationship activity parties entities included in the web API call

see the example here

https://xrmdynamicscrm.wordpress.com/2020/06/18/dynamics-crm-365-web-api-add-required-peopleactivity-party-to-an-appointment/

{
    "scheduledstart": "2017-05-18T09:00:00Z",
    "scheduledend": "2017-05-18T09:30:00Z",  
    "subject": "subject title",  

    "appointment_activity_parties": [
        {      
            "participationtypemask": 5,      
            "partyid_contact@odata.bind": "/contacts(xxxxxxx)"    
        },    
        {      
            "participationtypemask": 5,      
            "partyid_systemuser@odata.bind": "/systemusers(xxxxx)"    
        }  
    ]
}

similarly while creating new email activity the editor should allow the selection of activity parties like https://community.dynamics.com/blogs/post/?postid=f324587f-6069-425c-85b9-df5f487a010b https://www.cloudfronts.com/blog/d365-enterprise/d365-general/creating-an-email-activity-in-ms-crm-through-webapi/

{
    "description" : "Email Created",  ///Email Body
    "regardingobjectid_account@odata.bind" : "/accounts(69C38067-EDB7-E811-A961-000D3A363C81)",
    "subject" : "Test Email Creation", 
    "email_activity_parties" : [
        {
            "partyid_systemuser@odata.bind" : "/systemusers(CED2E02D-188E-4AA8-B6E2-D746E9B370C1)",
            "participationtypemask" : 1  ///From Email
        },
        {
            "partyid_account@odata.bind" : "/accounts(69C38067-EDB7-E811-A961-000D3A363C81)",
            "participationtypemask" : 2  ///To Email
        }]
}

Reference may be helpful

https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/reference/activityparty?view=dataverse-latest

https://learn.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/activityparty-entity?view=op-9-1

GuidoPreite commented 7 months ago

Hi @jatinnchhatbar, the code you posted is to create 1:N relationship records when creating a new record, it applies to all relationships and not only activity parties, for example the same syntax can be applied when creating account and contacts together. Adding this feature is not planned