Javascript Bundles Documentation

Hi,

I'm trying to start developing bundles in javascript for SAGE X3, but there is a lack of documentation...

Does anyone have some documents that could be useful to me?

Best Regards

Parents Reply
  • 0 in reply to Vad

    Hi Vad,

    Meanwhile only way we managed to deploy was to follow examples provided in documentation and then deploy to the syracuse/bin/node_modules folder.
    After restarting service, and with the debugger assistance, you should be able to get the response (RESHEAD and RESBODY) from the EXEC_JS method which will be very helpful to get the call right in the first attempts.

    regards

Children
  • 0 in reply to jfazenda

    Hey ifazenda!

    After calling EXEC_JS it gives error 403: "The module 'bundles/testmodule/index' is not authorized to be called from X3 in RESHEAD 

    Restarting syracuse services doesnt fix error.

    Do you know possible solution?

    Thank you

  • 0 in reply to Vad

    Hi Vad,

    Think you probably missed one step.
    In package.json file, you must declare/publish your extension.

    Should be something like this:

    (package.json file)

    {
        ( ... other content)

        "sage":
            {
                "x3":
                    {
                        "extensions":
                            {
                                "4gl-apis":
                                    [
                                        {
                                            "module": "./<path to your source from bundle root>._js"
                                        },
                                        {
                                            "module": "./<path to your source from bundle root>.js"
                                        }
                                    ]
                             }
                     }
             }
    }

    In your case you need "module": "./testmodule/index.js" (or ._js)

  • 0 in reply to jfazenda

    It works! Thank you!