Skip to content

Instantly share code, notes, and snippets.

View noorsyyed's full-sized avatar
💭
Trying to make some impact

Noor Syed noorsyyed

💭
Trying to make some impact
View GitHub Profile
@noorsyyed
noorsyyed / createActivityAttachment.js
Created September 29, 2021 19:41 — forked from pawelgradecki/createActivityAttachment.js
How to create an attachment using WebApi in Dynamics 365
var activityId = "059C0532-906C-E711-9409-00155D018D00";
var activityType = "appointment"; //or any other entity type
var entity = {};
entity["objectid_activitypointer@odata.bind"] = "/activitypointers(" + activityId + ")";
entity.body = "ZGZnZA=="; //your file encoded with Base64
entity.filename = "test";
entity.subject = "test";
entity.objecttypecode = activityType;