Get UID from instance, get instance from UID

Get UID from instance
var uid = inst.uid;

Get instance from UID
var uid2inst = function (uid)
{
    if (uid == null)
        return null
    return this.runtime.getObjectByUID(uid);  
}

It will return an instance or null.

3 comments:

  1. In what script does this code exist?

    ReplyDelete
  2. My guess is somewhere the runtime.js. Yes?

    ReplyDelete
  3. Looks like that's the only place I can get a this.runtime ref. So Ok then :-)

    ReplyDelete