A A A
C  C  Off 

Using Formulas In Iron Speed - Part 1

Rather than having to write your own custom code, Iron Speed provides you with the functionality to be able to use their new Formula's Tab.

There are many things that can be done with this, such as computing values on the fly, concatenating string values and assigning values to the current logged in user.

The purpose of values being computed this way are to take the strain away from the database, but the over head is instead passed to the server.

Having migrated an existing application to Iron Speed 7.1.1, I discovered that on numerous pages, setting the value of a DropDownList by settings it's text attribute to look to the URL was no longer functioning.

So, rather than having to write my own code, I decided to use the formulas tab to take the strain away from me.

We can see here that I am attempting to pass across a ClientID in the URL:
 URL
My page has a Client DDL which populates from a Client table from the database.  The idea is to use this ID being passed across and to make this the only value in the DDL.

Click the Drop Down List in Iron Speed Designer (whilst in Design Mode) that you would like to apply this to, then select "Database" from the "Populate from" Treeview then navigate to the formulas section and click "Query.." 

Selecting "Add WHERE Clause..." allows us to add our own where clause to the Drop Down List. From here, you can select your Database, Table, column, operator and in our case, a formula.


The following diagram shows the completed formula: 

Where Clause 

Also, remove the static list item  from the "Static list" in the "Populate from" Treeview:

 

Building and running the application and navigating to the correct page gives us the following result:

Result

We see here that the only value in the DDL is the ID that has been passed across via the URL!

This type of customization is useful for adding a child record and relating it to the parent, or for passing the ID of a record across the URL from a button click event, which is also very easy to setup!

Ricci

 
  • Facebook
  • Twitter
  • Digg It!
Leave a comment
Close

Enter your details and click subscribe to sign up to our newsletter

 *
   
 
 

* Required Field

Subscribe