Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Related emails are not showing in UCI

(0) ShareShare
ReportReport
Posted on by 40

Hi All

We have a customization to show all related emails for any specific Email(to show all replies, forwarded emails). Related emails showing in a subgrid of the Email form. This is perfectly working fine with classic interface. But related emails are not showing in UCI. Email entity is added to sitemap. Could you help me to understand what else I need to do for make it work.

Regards

Saman

  • Suggested answer
    RE: Related emails are not showing in UCI

    This is solved by intercepting FetchXML. Values for custom attributes not passed from the UI. No change for plugin code as it was debeloped to support FetchExpressions. Source code as below.

    function SetReleatedEmailSubgrid(executionContext) {

    var isUnified = isUCI();

    if (isUnified) {

    var formContext = executionContext.getFormContext();

    var objSubGrid = formContext.getControl("RelatedEmails");

    var entityId = Xrm.Page.data.entity.getId();

    if (objSubGrid == null) {

    setTimeout(SetReleatedEmailSubgrid(executionContext), 2000);

    return;

    }

    //cc_relatedemailsid is a custom field

    var FetchXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false' returntotalrecordcount='true' page='1' count='4' no-lock='false' >" +

    "<entity name='email' >" +

    "<attribute name='statecode' />" +

    "<attribute name='subject' />" +

    "<attribute name='to' />" +

    "<attribute name='from' />" +

    "<attribute name='statuscode' />" +

    "<attribute name='prioritycode' />" +

    "<attribute name='createdon' />" +

    "<order attribute='createdon' descending='true' />" +

    "<filter type='and' >" +

    "<condition attribute='cc_relatedemailsid' operator='eq' value='" + entityId + "' />" +

    "</filter>" +

    "<attribute name='activityid' />" +

    "<link-entity name='email' from='activityid' to='cc_relatedemailsid' alias='bb' >" +

    "<filter type='and' >" +

    "<condition attribute='activityid' operator='eq'  value='" + entityId + "' />" +

    "</filter>" +

    " </link-entity>" +

    "</entity>" +

    "</fetch>";

    objSubGrid.setFilterXml(FetchXml);

    objSubGrid.refresh();

    }

    }

    function isUCI() {

    return Xrm.Internal.isUci()

    }

  • RE: Related emails are not showing in UCI

    Hi Henry

    Thanks for response. As you suggested Issue was with FetchXml.There was nothing wrong with RetrieveMultiple Plugin  as it developed to support fetchexpressions. Solution wans Intercept the fetchxml with by passing custom attributes. Source code added to below.

    Regards

    Saman

  • Verified answer
    Henry J. Profile Picture
    Henry J. 5,237 on at
    RE: Related emails are not showing in UCI

    Hello Saman,

    Can you share details on how this was implemented on the email form?
    I'm assuming that there could be more than just a subgrid, perhaps JavaScript functions using unsupported or deprecated methods? Maybe plugins triggering on the RetrieveMultiple message?

    Thank you
    Henry

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,602 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,340 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans