Posts

Showing posts from September, 2022

Remove irrelevant activities from timeline for a record, by removing the activity parties

Recently, I had faced an issue. A Contact record ABC was updated with email address 2 field to the Customer Service Email (customerservice@company.com) on the 10th of May. Upon investigating, one of the users intentionally updated this contact record. This led to all of the Customer Service emails getting tracked to the timeline of ABC's Contact record. The customer service email address was removed from the Contact record on 20th May. While no new emails are getting tracked to the timeline, but any replies to the already tracked emails are still syncing to the Contact daily. Potential Solution : A ticket was raised with MS for finding a solution to this issue. They proposed deleting and recreating the contact record, however, the contact contains several child records and the impact would be severe. So an alternate solution could be to remove the Contact (ABC) from the "To" field of the tracked emails, by running a script. Follo...

How to call AddUserToRecordTeam action using Web API

Nothing special, but I'm posting here a simple JS function that calls the AddUserToRecordTeam action using web API. It took some time for me, especially in setting/fixing the parameters. Posting here reference. /* entityId: Guid of entity record entityLogicalName: Logical name of the entity, like lead/contact etc userId: Guid of the systemuser templateId: team template id */ function createAccessTeam(entityId,entityLogicalName,userId,templateId) { var parameters = { Record: { [entityLogicalName+"id"]: entityId, "@odata.type": "Microsoft.Dynamics.CRM."+entityLogicalName }, TeamTemplate:{ "teamtemplateid": templateId, "@odata.type": "Microsoft.Dynamics.CRM.teamtemplate" } }; var req = new XMLHttpRequest(); req.open("POST", Xrm.Page.context.getClientUrl() + "/api/data/v9.1/systemusers("+userId+")/Microsoft.Dyn...