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.
Specify new Ebase variables
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 97
- Joined: Thu Sep 13, 2007 6:07 am
- Location: The Netherlands
-
- Ebase User
- Posts: 94
- Joined: Fri Sep 14, 2007 12:18 pm
- Location: The Netherlands
- Contact:
User Variables
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:
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.
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>
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
-
- Ebase User
- Posts: 97
- Joined: Thu Sep 13, 2007 6:07 am
- Location: The Netherlands
-
- Ebase User
- Posts: 97
- Joined: Thu Sep 13, 2007 6:07 am
- Location: The Netherlands
-
- Ebase User
- Posts: 94
- Joined: Fri Sep 14, 2007 12:18 pm
- Location: The Netherlands
- Contact:
"Last updated date" system variable.
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.
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 57 guests