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

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

custom workflow activity

(1) ShareShare
ReportReport
Posted on by 255

I am very new for writing custom workflow activity

can anybody tell me how can i retrive last modified related records from subgrid for perticular record using fetch xml.

Scenaro:

i have case entity and Case-contact

case entity have subgrid of Case-contact

i want to retrive last modified Case contact if case have multiple Case contacts.

can anyone share code for this.

I have the same question (0)
  • Verified answer
    Pawar Pravin  Profile Picture
    5,237 on at
    RE: custom workflow activity

    Hi Mona,

    I would suggest you to create query in advance find as shown in below snapshot.

    add sub-grid entity as "Look For" and add related entity. 

    pastedimage1574334078434v1.png

    then click on edit column and add sort column with modified 

    pastedimage1574334242386v2.png

    query should look like below

    	
    	
    	
    	
    	
    	
    	
    	
    	
    	
    	
    	

  • Verified answer
    Naveen Ganeshe Profile Picture
    3,397 User Group Leader on at
    RE: custom workflow activity

    Hello Mona,

    See below fetch. It will return you only the last modified record:

      
        
            
            
        
         
        
      
    
    

    Also, don't forget to change the attribute: "incidentfieldname" and entity name "casecontact" with the actual ones. 

    Hope it will help you

  • Mona Chavan Profile Picture
    255 on at
    RE: custom workflow activity

    Thanks all for reply.

    now for the last modified client contact i have related appointment activities.

    from these activities i need to pickup last modified appointment .

    but in advance find  i am not able to get "modified on" attribute for  for appointments in edit columns

    so i can use two fetch xml

    1)to get last modified client contact (only for client contact)

    2) To get appoitments related to retrived client contact by passing id to this fetch xml

    Is this right?

  • Suggested answer
    Pawar Pravin  Profile Picture
    5,237 on at
    RE: custom workflow activity

    I can see "modified on" in advance find

    pastedimage1575015379719v1.png

    Anyway if you are unable to see in advance find still you can add it manually in fetchxml.

  • Mona Chavan Profile Picture
    255 on at
    RE: custom workflow activity

    Yes it is visible when i search Appointment  separately in "Look for" , but if i am looking in one advance find it self with the relation from case-->Client contact-->appointments

    the its is not visible. refer the screen shot below.

    Note:in filter criteria i need to select client contcats base on mentioned conditions as well

    ad1.PNG

    ad2.png

    so to get Appointments last modified from above fetch i am not able to add "modified on" column for appointment entity.

    so is it good to write two fetch xml

    step 1) to get last modified client contact

    step 2)fetch last modified Appointmnet and passing the step 1 client contact id to this fetch.(i will get last modified appointment for the client contact if there are multiple appointments)

    what am i thinking is right?

  • Suggested answer
    Pawar Pravin  Profile Picture
    5,237 on at
    RE: custom workflow activity

    Yes, I think you should have to use two different fetchxml if that is the case if you are unable to see it in add column

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 258

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 178

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 142 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans