Formula or what?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rampo
    Junior Member
    • Feb 2023
    • 8

    #1

    Formula or what?

    Hello, I don't know how to implement this simple feature: I have an entity called "DemoUnits" and I would show a field called "Availability" which is a boolean, and I would change the status of "Availability" in TRUE if all tasks related to "DemoUnits" are completed. Can I do it with a formula or what? Thanks for the help
  • victor
    Active Community Member
    • Aug 2022
    • 1093

    #2
    If we are talking about a default Task entity and a Demo Unit, it has an automatically created Relationship,

    Click image for larger version  Name:	image.png Views:	0 Size:	51.7 KB ID:	123705then we will just need to equate the total number of Tasks in one Demo Unit to the Tasks that have the status "Completed". And if these values are the same, then we change the value of the "Availability" field to "true".

    HTML Code:
    $completed = entity\countRelated('tasks', 'completed');
    $all = entity\countRelated('tasks');
    
    if ($all == $completed) {
        availability = true
    }
    Last edited by victor; 12-23-2025, 11:00 AM.

    Comment

    Working...