Sending a parameter to an application is always easy when done within the Scriptcase environment, but when working with external applications we must do it another way. That’s why using the GET type variables is a good option to receive external data in a Scriptcase Form when doing the interconnection between applications.

In Scriptcase there are three options for variables declaration: SESSION, POST and GET.

the application will be allowed to receive the value of the variable through the URL of our form. As a result, we can perform the tasks that we want within the form from initial values, since configuring initial values for the load of a new record (so that the user need to enter data already provided in external application) to more complex processes that require initial values to be started (for example:. End of the month in which the month and year to be processed within the events of our form).

All information needed to better understand the use of variables within Scriptcase can be found below by clicking here:

http://www.scriptcase.net/docs/en_us/v81/manual_mp.htm#form-applications/application/global-variables

The following example shows the Declaration of a variable and encoding in Scriptcase Events to act differently the pre-specified to receiving the variable. You can find more information about events in the link:

Declaration of Variable “Document”

Ambit -> GET

(Scope. Ambit, Sphere)

Configuration -> Optional (In case you are always expected to receive a variable, this option should be unchecked)

print-1

Event onApplicationInit

Within the Event is validated if the variable “Document” is nonzero. If you start the form to load a new record. We made this configuration using the SC_APL_CONF (documentation) macro which we need to indicate the name of the application, the property to be configured and the desired value for the property.

print-2

Event onLoad

Within the Event it is validated if the variable “Document” is different from empty. If you assign the value of the [Document] variable to the {Document} field and set the quoted field to read only, so that you can not edit the received value. We made this configuration using the C_FIELD_READONLY (documentation) macro, which should indicate the field of our application to be set to read-only.

taxid

Clicking on “run application” will show us the following window where it is possible to enter the variable that we set, if we leave blank and click on “form_cliente” the form will execute normally showing the records that contains the related table.

print-4 print5

To perform the tests we must modify the URL that we see in the browser excluding everything that precedes the name of our form and adding our variable and the desired value by prefixing the symbol “?”, As indicated in the following image.

Note that when you receive the variable a value, in addition to entering the “new record” move, it is set as read-only in the “Document” field and assigns the value that we send.

print-6

You might also like…

Deep Data: Creating Powerful Large Systems

Creating powerful large systems to support business processes in a cost-effective and accessible man...

How to recognize business models and processes from Deep Data Perspective

Listen to the podcast and learn how to recognize business models and processes from Deep Data Perspe...

Learn more about external libraries to improve your projects!

For those who ask themselves: " Which types of libraries can i use within Scriptcase? ", in this pos...

Comment this post

Get new posts, resources, offers and more each week.