Call script method from another folder

Hello folks Slight smile

Is there any way I can call in folder A a method from a script in folder B?

Something like this?

I'm writing an entry point which must be written in X3 folder. 

We have library scripts in not X3 folder. Instead of copying those library scripts also in the X3 folder I would prefer to call them from X3 folder.

Best regards

Bense

  • 0

    Hello Bense,

    My best advice would be to not add code to X3 Folder directly or performing any other change  - not only because this goes against Sage's best practices but also because it could lead to problems with the solution moving forward with Upgrades / Updates. I appreciate every business is different but I strongly believe we need to keep in mind what can be done vs what should be done. 

    Without knowing your system architecture would be hard to provide you the best approach however my guess based on your question is that you have multiple Folders that are using the same functionality and you do not want to replicate the code in each of them. 

    If all the Folders are "LIVE" - they are different companies using separate Folders instead of built in the same for "x" reason - and they also have the same development and you want to reduce risks on consistency - I would suggest creating a "Vertical" or SPV Development:

     X3 => VERTICALFOLDER => LIVE 

    This means that Sage would run your LIVE code and if not there, find it in VERTICALFOLDER and if not there then go to X3. Same with Reports.

    So you would achieve what you are aiming by having the code centralized in VERTICAL Folder.

    However if you have multiple Folders - shared with LIVE - For instance LIVE / DEV / TEST - I would encourage to replicate the code and implement version controls in your system to keep this consistency with the corresponding documentation and auditing.

    Main reason is because Ideally you should have DEV and TEST in separate Servers to mitigate risks and also help with patch update test processes.

  • 0 in reply to Ramon Pairau

    Good morning Ramon,

    Thank you very much for your answer. 

    Yes generally we avoid adding code or any development to X3 folder as it is not recommended and can cause problems on updates. The entry point and the script for managing batch tasks must be unfortunately be in the X3 folder https://online-help.sageerpx3.com/erp/12/wp-static-content/static-pages/en_US/OBJ/ADC_SERVEUR.htm#APE_20_10.

    We have 3 separate environments. DEV, TEST and PROD. On each environment we have a corresponding folder and the X3 and SEED folder. 

    Do I understand correctly that I could use then scripts from vertical folder in X3 folder? 

    I'm not sure if I can call directly code from another folder in X3 script (like in the screenshot above) but what I think wold be possible that for example in a mask, window and other objects the standard executes the defined vertical development scripts.

    Kind regards

    Bense