Skip to main content

Notifications

Service | Customer Service, Contact Center, Fie...
Suggested answer

workflow: check if value already exists and update record

Posted on by 165

When user opens a new case, I need to check if the serial number of the new case already exists in order to change the priority of the case. I use Kaskela's solution to do this and I think the best way to do it is to use query to get a single value (what I actually want to get is a true or false boolean). Serial Number is a lookup field, so it will be always a GUID - 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) but I have to make the query using as input the name attribute of the serial number (i.e. SN00105GH)

this is the fetchXML I use so far:

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" >
    <entity name="case" >
        <attribute name="title" />
        <link-entity name="abc_serialnumber" from="abc_serialnumberid" to="abc_serialnumberid" link-type="inner" alias="ac" >
            <filter type="and" >
            <condition attribute="abc_name" operator="like" value='{Serial Number(Case)}' />

           </filter>

      </link-entity>

     </entity>

</fetch>

I get the error 'Case' entity doesn't contain attribute with Name = 'abc_serialnumberid' and NameMapping = 'Logical', which is true because 'abc_serialnumberid' belongs to 'abc_serialnumber' entity, but I am not sure how I should do it. Any help would be greatly appreciated 

  • irenegr Profile Picture
    irenegr 165 on at
    RE: workflow: check if value already exists and update record

    Thank you!

  • Pankaj Gogoi Profile Picture
    Pankaj Gogoi 3,177 on at
    RE: workflow: check if value already exists and update record

    Hello,

    you should replace the to="abc_serialnumberid" with the column name of the case entity unless you gave the name as abc_serialnumberid.

    As suggested, you need to change the case to incident. Here is a fetch xml for quick reference.

    fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">

     <entity name="incident">

       <attribute name="title" />

       <attribute name="ticketnumber" />

       <attribute name="createdon" />

       <attribute name="incidentid" />

       <attribute name="caseorigincode" />

       <attribute name="new_serialnumber" />

       <order attribute="title" descending="false" />

       <link-entity name="new_serialnumber" from="new_serialnumberid" to="new_serialnumber" link-type="inner" alias="ad">

         <filter type="and">

           <condition attribute="new_name" operator="eq" value="{Serial Number(Case)}" />

         </filter>

       </link-entity>

     </entity>

    </fetch>

    Best Regards

    PG

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: workflow: check if value already exists and update record

    Hello,

    Schema name for Case is incident. Try to use following line

    <entity name="incident" >

    instead of

    <entity name="case" >

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