web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested Answer

workflow: check if value already exists and update record

(0) ShareShare
ReportReport
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 

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

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

    <entity name="incident" >

    instead of

    <entity name="case" >

  • Pankaj Gogoi Profile Picture
    3,177 on at

    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

  • irenegr Profile Picture
    165 on at

    Thank you!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 22 Super User 2026 Season 1

#2
Suriyanarayanan V Profile Picture

Suriyanarayanan V 15

#3
CU19070926-0 Profile Picture

CU19070926-0 10

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans