[Variables] Copy by value or reference in Timer/Debug/action

[Variables] Copy by value or reference in Timer/Debug/action

Hello community,

I have a question regarding the behaviour of local variables of Datatype "Record".

Imagine that I have an action and it contains: (solely an academic example)

  (1) "GetEntityA_ById" that returns the value/reference a record of type EntityA;
  (2) Set my local variable "RecordA" = "GetEntityA_ById".Record
  (3) Invoke action "ModifyRecordA" with input parameter as local variable "RecordA"
    (3.1) This action will invoke another action "ActionUpdateEntityARecords"
      (3.1.1) Action "ActionUpdateEntityARecords" executes an Advanced query that, for each record from EntityA, changes its values.
  (4) Print local variable "RecordA".
  (5) ??

Can you tell me if the copy is/should by value or by reference in this scenario?

EDIT: I already read the artitle in: http://www.outsystems.com/help/servicestudio/6.0/Designing_Actions/Assign_Values_to_Variables.htm
and I am still unsure as i get some "random" results depends on Debug or execution within Timers.

Kind regards
Hi Alexandre,

Records are assigned (and passed as inputs) by value. So your local variable will have the same value in 2 and 5.

If you can replicate a sample where you having strange behaviors we can try to understand why.

João Rosado
Just for reference (no pun intended), you can read more about it in Service Studio Help.