<@U29PVMVAR> I think I figured it out. I just need...
# suitescript
d
@erictgrubaugh I think I figured it out. I just need to verify.
e
Here's what I had to do for some buttons I had in an INLINE HTML field
Copy code
define([...], function (...) {

// other stuff

    function toButton(applicant) {
        /* XXX When this client script is attached via `form.clientScriptModulePath`, the click handler function
         * is not exported correctly into the browser global context, so supportApplicant() is undefined. This
         * workaround requires the module at runtime as well in order to property invoke supportApplicant()
         */
        var onclick = "require([\"" + CLIENT_PATH + "\"], function(mod){mod.supportApplicant(" + applicant.id + ");})";
        return [
            "<button type='button' id='btn_", applicant.id,
            "' onclick='", onclick, ">",
            "</button>"
        ].join("");
    }

    function supportApplicant(id) {
      // awesome click handles
    }
 
    exports.supportApplicant = supportApplicant;
    return exports;
});
toButton
just ouputs the HTML of the button that I then pass to
setSublistValue()
for the Inline HTML field
had to do that
require()
mess within the
onclick
attribute
d
Thanks Eric. Part of my issue is the file path in the SDN is different from that of the path when bundled.
e
ah sure
I think with
require()
you should still be able to use the
/.bundle123/
or whatever that syntax is for SuiteApps, but I've never done it myself
d
I've used the /.bundle123/ before. It works.