Functions chaining

#1

Is it possible to chain functions call so that to run them in one line, e.g. instead of this:

var o = SomeType.get('id');
o.someField = someValue;
o.merge();

to have something like:

SomeType.get('id').set('someField', someValue).merge()
0 Likes

#2

Yes, to do this you should use the putField or putFields type system functions.

Example:

SomeType.get('id').putField('someField', someValue).merge();
2 Likes