Consultor Eletrônico



Kbase P79213: How to run a Super Procedure from a JavaScript file in Dynamics
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/5/2004
Status: Unverified

GOAL:

How to run a Super Procedure from a JavaScript file in Dynamics

GOAL:

Example how to run code in a super procedure using JavaScript and a Dynamics Super procedure.

FACT(s) (Environment):

Dynamics

FIX:

It is possible to run a super procedure from a JavaScript file in Dynamics. Essentially it is exactly the same as running a plipp via a JavaScript file.

The steps required are as follows:
1. Create a new custom super procedure using the Appbuilder.
2. Add an internal procedure that will be invoked. As an example:

PROCEDURE Proc1:
DEFINE INPUT PARAMETER cMessage AS CHARACTER NO-UNDO.
OUTPUT TO c:\temp\websuper.txt.
DISPLAY "Proc1 " cMessage.
OUTPUT CLOSE.
END PROCEDURE.

3. Create a JavaScript file and add the call to the super procedure specifying the internal procedure to run. As an example:

function SuperCall()
{
alert("SuperCallX");
var call, target, flags, param;
call = 'proc1';
target = 'sports/super/websuper.p';
flags = 's';
param = "input character 'From SuperCall'";
apph.runOnServer(call,target,flags,param);
}

4. Add the JavaScript file to the Dynamic container 'JavaScripFile' property using the containers dynamic property sheet.

5. Choose a suitable event to run via a UI object to execute the JavaScript function call defined in the super procedure. For example, using the dynamic property sheet of a button on a dynamic viewer, set the 'onClick' event to call the function defined in 3 above. In this case 'SuperCall()'.

The container should then run on the Web UI, and when the button is selected result in a file called c:\temp\websuper.txt.