Method getReference example

I was reading the scripting documentation and I wonder how the methods getReferences(ids, callback) and getReference(id, callback) work.

This is what I have:

Schema 1:

  • code (int)
  • name (string)

Schema 2:

  • name (string)
  • reference (Schema 1)
  • codification (string)

I would like to autogenerate the field codification with a string like “H-XXX”, where XXX should be the value of the field code of the reference (Schema 1).

I was trying this in Create of Schema 2:

getReference([0], callbacktest);

function callbacktest(valuecontent){ = “H-” + valuecontent[0].data.code.iv;

But I get the message “Failed to create content. Please reload”.

Do you have any examples of how to use this methods?


Please use code formatting for code and use the template for new support requests. I will help you then, but I need answers to the questions that you will see when you select the “Support” category.