Skip to main content
13-Aquamarine
June 9, 2021
Solved

How to programmatically set tags to recent entities?

  • June 9, 2021
  • 1 reply
  • 975 views

Hello, I want to tag with "Recent tag" the last modified entities I have used

How to do this using a script?

 

What I was thinking is 

query all entities and if they have been used inside a date range, then execute a service to tag them

Please share some sample code to accomplish this task.

Best answer by abjain

@EM_9923519 : You can try using SpotlightSearch service which is present inside SearchFunctions resource .It gives list of all entities along with last modified date. This service can be used inside your custom service where you can provide date range and can also sort by lastmodifieddate with ascending or descending order. Please also refer this article: https://www.ptc.com/en/support/article/CS180125

 

1 reply

abjain15-MoonstoneAnswer
15-Moonstone
June 9, 2021

@EM_9923519 : You can try using SpotlightSearch service which is present inside SearchFunctions resource .It gives list of all entities along with last modified date. This service can be used inside your custom service where you can provide date range and can also sort by lastmodifieddate with ascending or descending order. Please also refer this article: https://www.ptc.com/en/support/article/CS180125

 

15-Moonstone
June 14, 2021

@EM_9923519 :If the previous response answered your question, please mark it as the Accepted Solution for the benefit of others with the same question.