Retrieving associated entity of a generalization in widget

0
For a custom widget I am building I have an object A -which is the contextobject of my widget- which is a specialization of another object B. This generalization object B has an association to an object C of which I need one specific field to be able to use in my widget. I thought it would work if I used: A.getReference("ModuleName.B_C") to retrieve the GUID of this object C, but sadly it doesn't. Is this the right way of doing this?
asked
2 answers
0

If you use getSuperEntities() does the object B appear? You could also try getReferenceAttributes() to see all references.

answered
0

See for example: refkit.mpk (input reference selector)

    this.getReferredObject(this.sourceObject.getAttribute(this.objreference));

getReferredObject : function(guid) {

    console.log(this.id + ".getReferredObject");

    this.currentValue = guid;

    if(guid) {
        mx.processor.get({
            guid     : guid,
            callback : dojo.hitch(this, function(obj) {
                this.setDisplayValue(obj.getAttribute(this.objattribute));
            })
        });
    } else {
        this.setDisplayValue("");
    }
},

you can use get() instead of getAttribute()

answered