akkigpt
New Member.
475 views

using RAD functions in creating Java script (HPSM)

I want to create a java script to load .unl file.

so how to implement "$L.rc=simple.file.load( <unload file name>, <target file name>, <drop if already exists flag> )" in creating java script.

 

0 Likes
4 Replies
Acclaimed Contributor.. Jacob Heubner Acclaimed Contributor..
Acclaimed Contributor..

Re: using RAD functions in creating Java script (HPSM)

First, I would question why you need to do this.  But, the _how_ is pretty simple.

To call RAD functions inside javascript, preface the function with 'system.functions.' and then replace the '.' in the function with underlines.

So it should be something like:

var RC = system.functions.simple_file_load(pathToFile,targetFileName,dropFlag)

with 'pathToFile' being a valid path to the unload, 'targetFileName' being the appropriate dbdict name for the targeted unload, and 'dropFlag' being the appropriate true/false value

0 Likes
akkigpt
New Member.

Re: using RAD functions in creating Java script (HPSM)

Thanks Jacob,

I want to perform this because My requirement is to automatically load and unload .unl file without using hpsm gui.

I want to execute load and unload using command line sm.exe.

Can anyone please guide me how to unload using java script

 

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: using RAD functions in creating Java script (HPSM)

Hi Akkigpt,

Not sure whether the answer I provided to unload files from command solves your problem or not.

Would like to understand your requirement, why you want to use js to fulfill your requriement insteand of using the method I mentioned in

/t5/Service-Manager-Service-Center/how-to-unload-script-in-HPSM-using-command-prompt-or-program/m-p/6901052/highlight/false#M134316

let me know if I can help.

Ling-Yan

0 Likes
akkigpt
New Member.

Re: using RAD functions in creating Java script (HPSM)

Hi ling-yan,

I need java script because I am familier with JS and not have much knowledge on RAD function.

As how to code in HPSM taloring -> script i am not getting any guide or guidence on it.

Script you provided on 

/t5/Service-Manager-Service-Center/how-to-unload-script-in-HPSM-using-command-prompt-or-program/m-p/6900330#M134263

That was helpful but the parameter for predefined unl file and new unloaded unl file was passed from HPSM GUI Script, in my requirement i need to pass it from command line syntax

somewhere in below command.

sm.exe script.execute NULL NULL prepare_backup.script NULL -bg

 Is there any way that I can do it.

 

As in script library java script can be written and can be called from sm.exe and parameter can also be passed from command line itself. that is the reason I want java script.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.