Open form in custom widget?

7
How can you open a form from a custom widget? I know how you can load a form as a resource in the xml, but how do you open one? Preferably without having to use a microflow? openForm:function(){ var context = this.createContext(); console.log(context); mx.ui.executeAction({ target : "Screen", params : { title : "My form", uilocation : "window", targeturl : "forms/en_US/MyFirstModule/personnewedit.mxf", targetparams : { mxcontext : context } } }); },
asked
1 answers
3

Hi Pieter,

Try this:

var context = this.createContext();
mx.ui.executeAction({
    target     : "Screen",
    params     : {
        title      : "My form",
        uilocation : "content" || "window",
        targeturl  : "url_to.mxf",
        targetparams      : {
            mxcontext : context
        }
    }
});

Edit: Are you getting an error? I think this.createContext() only creates an empty context, you still need to set the entity and obj id to it. You can also check the Navigation Tree widget, which opens forms, as an example.

answered