26
Views
3
Comments
Solved
Passing objects by parameters

Are OutSystems objects passed by parameter passed-by-value or passed-by-reference?

mvp_badge
MVP
Rank: #72
Solution

Hi Asaph,

Object data types are passed by reference. You can read more in this documentation (I couldn’t find a newer version).

Input Parameters Passed as Reference

However, to avoid performance deterioration, when the action called is from the same module there are data types that are passed by reference:

  • Binary Data;
  • Object;

  • Lists.

For these data types, no copy is created, meaning that changes done inside the scope, are reflected in the caller scope.

Hope this helps.

Regards,

Nordin

Rank: #361

Hi Asaph,

As you can read in the document Nordin mentioned, normally OutSystems passes Input Parameters as Value, except when you are calling an action within the same module, than the input parameters of type binary data, object or list will be passed as reference.

Kind regards,

Hans