The M-Files Community will be updated on Tuesday, April 2, 2024 at 10:00 AM EST / 2:00 PM GMT and the update is expected to last for several hours. The site will be unavailable during this time.

This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Where is user by assign to from worfklow?

Hello guys,

I cannot found the property with user which have assigned object by workflow.- not object type Assign to (10)

I try see "all" by this script in automatic value:

For i=-2000 To 2000
  If PropertyValues.IndexOf(i) > -1 Then
    If not PropertyValues.SearchForProperty(i).TypedValue.IsNULL() Then
      objFile.Write CStr(i) & " : " & CStr(PropertyValues.SearchForProperty(i).TypedValue.DisplayValue) & vbCrLf
    End If
  End If
Next

I thought, the property 44 (MFBuiltInPropertyDefAssignedTo) has the value, but it's empty - no in "objFile".

Where is info about assing to user?

Thanks,

O.

  • When an object is assigned in a workflow to a user, that user is added to "Assigned to" (44) -property. If a separate assignment is used, the object will refer to the assignment via "Workflow assignment" (79) -property, which will have the "Assigned to" -property. When the object moves from the from that state where the assignment is set or if user marks the assignment "as complete", "Assigned to" will be emptied, and thus it can be empty. 

  • Hi Juha,
    thanks for answer.

    I tried it one more time, thoroughly.
    I have object with task from workflow (approval the invoice), this state gives the task to user - I see the user in the column "Task for/Assigned To" (44) .



    My script shows:

    0 : NAME OF OBJECT ... POJIŠTĚNÍ-vozidla  Dod:  Kooperativa pojišťovna, a.s., Vienna Insurance 
    20 : 30.03.2021 11:49
    21 : 16.04.2021 15:18
    23 : USERNAME
    25 : (external sourcej)
    38 : NAME OF WORKFLOW
    39 : NAME OF STATE
    40 : 15.04.2021 10:56
    81 : 16.04.2021 15:18
    100 : NAME OF CLASS
    1043 : 720
    ... many CLIENT PROPERTIES >1000

    I tried show properties from the object links by relations:

    I see in the log the object types: 0, 105, 106, 107 and many others CLIENTS OBJECT TYPES 

    So, still is valid: I can't find info about Assigned to from workflow.

    Thanks for idea,
    Olda

  • Are you using the Assigned to option in workflow? or Create separate assignment?

    If you are using assignment classes, you will not find the Assigned to information on the primary object. 

    So as Juha mentioned, it depends on how you do assignments.

  • Hi Radu, I use Assigned to in workflow, not separate assignment.

  • Where do you have that script? Automatic value on the object that is in the workflow? The automatic values are calculated before assignment the object is assigned so the value is not there yet

    https://www.m-files.com/user-guide/latest/eng/execution_order_of_scripts.html

    -------
    The user modifies the property values and changes the workflow state of an object:

    1. The BeforeCheckOut event
    2. The AfterCheckOut event
    3. The BeforeSetProperties event
    4. Property value validation
    5. Calculating automatic property values <- The value is calculated here
    6. The AfterSetProperties event
    7. The BeforeCheckInChanges event
    8. Previous workflow state postconditions
    9. New workflow state preconditions
    10. Workflow state actions <- The assignment is added here
    11. The BeforeCheckinChangesFinalize event
    12. The AfterCheckInChanges event
    13. The AfterCheckInChangesFinalize event
    14. The BeforeReturnView event

    --------

    If you do any versioning for the object, do you then see the assigned to values in the script?

  • Hi Juha,

    very good question!
    My script is in automatic property values and I thought the assignment is static value - if assignment was created in older version, it doesn't matter what technique I read properties in the new version.

    I tried it read on event BeforeCheckinChanges .... IS FILLED.

    Thank you for your patience.

    Have a nice day,

    Olda