Specify new Ebase variables

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

Vircos
Ebase User
Posts: 97
Joined: Thu Sep 13, 2007 6:07 am
Location: The Netherlands

Specify new Ebase variables

#1

Postby Vircos » Thu Jan 17, 2008 9:04 am

Is there a way to specify new Ebase variables besides the existing as $USER or $COMMAND_STATUS for example?

We want to use this feature for email adresses which are used much in the forms.

That way if the email adress changes, we only have to change the value of the variable.
0 x
What's the meaning of Justice...

AJDulk
Ebase User
Posts: 94
Joined: Fri Sep 14, 2007 12:18 pm
Location: The Netherlands
Contact:

User Variables

#2

Postby AJDulk » Fri Jan 18, 2008 9:03 am

If you are looking to set up constants within your application then you can use Environment Variables. These are set up in your web.xml file under your webroot/WEB-INF files.

Basically you define the variable using the following template:

Code: Select all

<env>
  <env>VAR_NAME</env>
  <env>VAR_VALUE</env>
  <env>java.lang.String</env>
</env>
where..

env-entry-name is the name of the environment variable. This name is case sensitive and should not contain spaces.
env-entry-value is the value for the environment variable
env-entry-type is the type for the environment variable. In 3.4.0 only java.lang.String is supported.

To use this in your form you reference the VAR_NAME with $ENV_ prepended, thus $ENV_VAR_NAME. You may also use it directly using && as in &&$ENV_VAR_NAME.

See the Ebase Documentation (linked to above) for a more detailed description.
0 x

Vircos
Ebase User
Posts: 97
Joined: Thu Sep 13, 2007 6:07 am
Location: The Netherlands

#3

Postby Vircos » Fri Jan 18, 2008 9:27 am

I did not know this was already a part of the Ebase documentation.
Sorry for that.

Oh and Rotterdam rules :lol: thanks for the reply.
0 x
What's the meaning of Justice...

Vircos
Ebase User
Posts: 97
Joined: Thu Sep 13, 2007 6:07 am
Location: The Netherlands

#4

Postby Vircos » Tue Apr 15, 2008 9:44 am

Is it also possible to specify a new system variable. We want a system variable for the "Last updated date" of a form. This date can be found under the form properties - Info.
0 x
What's the meaning of Justice...

AJDulk
Ebase User
Posts: 94
Joined: Fri Sep 14, 2007 12:18 pm
Location: The Netherlands
Contact:

"Last updated date" system variable.

#5

Postby AJDulk » Wed Apr 16, 2008 9:20 am

While I am not sure how to set up a system variable, it is possible to do the same using a database resource on your repository.

In the designer:
1. Go to IT Elements - Databases - UFS.
2. Click "Import from schema".
3. Select your repository from the "Select schema" scheme (if presented).
4. Select the FORMS table.
5. Change the "Import as Resoure Name" to whatever the resource should be called.
6. Adapt the resource as necessary. Use FORM_ID in the where clause and remove unnecessary mappings if desired (that is: everything exept FORM_ID and LAST_UPDATED_DATE in this case).
7. Add this to the resource that is used in the form.
8. Create a field in the form that will contain the "form id" and "last updated date" and link these to the resource created above.
9. Create a script that sets the field created for "form id" to $FORMID and do a fetch on your database resource.
10. Add the script to a relevant event.
0 x


Who is online

Users browsing this forum: No registered users and 58 guests