Workflow/BPMN: Scheduled Trigger (Formula Field Support)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rabii
    Active Community Member
    • Jun 2016
    • 1296

    #1

    Workflow/BPMN: Scheduled Trigger (Formula Field Support)

    Lately come across a use case where i couldn't build a report for a scheduled workflow due to report requirements as needed to pull data of an entity (X) which the target entity and needed to get only the X records that have a certain status and linked to one account where no other x records exist with other status and created after previous condition. tried complex expression. So in order to get those records it would be easy to do so using formula. Wonder if it is technically possible to use formula on scheduled trigger as another options rather than having only reports. formula field should returns collection of ids to be run by the workflow/bpmn.

    This would help a lot to build complex formula to get records and pass them to workflow.

    Thanks
    Rabii
    Here to help :)
  • lazovic
    Super Moderator
    • Jan 2022
    • 1046

    #2
    Hi rabii,

    Please tell me if I understand correctly that you need to find a certain number of records related to some entity (target entity) and perform certain manipulations with these records?

    Comment

    • rabii
      Active Community Member
      • Jun 2016
      • 1296

      #3
      Hey lazovic

      Thanks for your intervention.

      I need to find a collection of the target entity based on certain conditions (Select only records that met a condition). Here is my need, i have an entity called (Visit) which is linked to account through a one to many (one account has many visits). the visit entity has visitPeriod field (Date) and a status field (Planned - In Progress - No Resources - Completed). I need a collection of visits that meet the conditions below:

      - visit period (before June 2022)
      - status = 'No Resources'
      - should be last record on related account - meaning if there are any other visit with visit period > june 2022 and status != 'No Resources' then this should not be added to the collection.

      I hope this make sense.

      I have tried using complex expression but not found proper method to pull the data. Only way to meet the conditions is to use record/exist

      PHP Code:
      !record\exists('Visit''accountId='accountId'createdAt>'createdAt'visitPeriod>''2022-06-01''status!=', list('No Resources')) 

      Hence way i think having a formula field to find records and returns their Ids would help in such situation.
      Rabii
      Here to help :)

      Comment

      Working...