Skip to main content

Notifications

Service | Customer Service, Contact Center, Fie...
Answered

Macro fails to update regarding in Customer Service Workspace

Posted on by 25

Hi,

I created a script agent, a step and a macro in Customer Service Workspace to convert an email in a case.

I start with an email session and it will be my anchor tab.

I use a new form to fill fields and then save it. I create the case and I use three fields of data to create a lookup, for example:

  • customerid: ${accountid}
  • customeridtype: account
  • customeridname:  MyCompany

In a second step I would like to update the regardingobjectid field of the email in the same way, but it fails.

  • Register Id: ${anchor.activityid}
  • Entity name: email
  • regardingobjectid: ${incidentid} (I use dynamic value from the previous save)
  • regardingobjectidtype: incident
  • regardingobjectidname: Case (I use odata to find the name)

It fails and I don't know why. I see the execution history of the macro and it says that the problem is the update register box,  but it just shows data of fileds (GUIDs are correct), no explanation about the problem.

I changed dynamic value for odata slug, avoid to use customeridname, odata.bin format and I write data directly and the result is fail.

How can I update the regardingobjectid field in an email from a macro?

Thanks.

  • Suggested answer
    cmoreno8 Profile Picture
    cmoreno8 25 on at
    RE: Macro fails to update regarding in Customer Service Workspace

    Hi, I'm very happy to have found a solution!

    Testing and testing and more testing, and finally I have found a solution and it works.

    I modified the email regarding lookup data:

    • Attribute name: regardingobjectid_incident@odata.bind 
      • Here I use the entityname (incident) in the fieldname (regardingobjectid_incident) because the regarding could be a lot of entities and you have to fix
    • Attribute value: /incidents({$odata.incident.incidentid.?$filter=_customerid_value eq '${accountid}'&$orderby=createdon desc&$top=1})
      • I have created an incident, but:
        • it isn't an anchor tab
        • I haven't any slug to refer
        • ${Session.CurrentTab.<entityId>} doesn't work
        • I haven't its incidentid directly
        • it's just related with its customer
      • Then I have to found the incidentid with a "surrealistic" odata sentence

    If you know a better solution (easier and trusted) to find the incidentid, please, tell me. 

    And ... surprise! it works, it found the incidentid and stored the regarding lookup with the incident.

    A lot of thanks to regex91 , because I read his/her post     and with its solution of a Former Member I found the solution.

  • cmoreno8 Profile Picture
    cmoreno8 25 on at
    RE: Macro fails to update regarding in Customer Service Workspace

    Hi,

    First I create a new register, an incident (${accountid} is a custom slug with the account GUID).

    pastedimage1686650702915v2.png

    I save the incident and it works fine and the incident is created.

    pastedimage1686651018495v5.png

    And the problem is when I try to fill the regarding lookup in the email (I opened the email as an email session, then it is the ${anchor} register and I also changed the regardingobjectidtype by incident directly).

    pastedimage1686651148118v6.png

    The result is:

    pastedimage1686651314663v7.png

    To check the data I attach the save data of the execution.

    Thanks for your help.

  • Verified answer
    Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    RE: Macro fails to update regarding in Customer Service Workspace

    Hi Carlos,

    Could you share screenshots about the macro steps and execution history?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans