FPL Syntax

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

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

FPL Syntax

#1

Postby Segi » Wed Nov 25, 2015 12:11 am

I primarily use JavaScript but have a specific need for a table filter expression under a repeater that has to be written in FPL and have no idea if/how to accomplish this.

I have 3 SQL Server tables that I need to incorporate into a repeater.

Server:
---------------
ServerID int (primary key)
ServerName

ServerRoles:
---------------
RoleID int (primary key)
RoleName

ServerRoleAuthorizations:
-----------------------------
ServerID
RoleID

I want to display this information in this form using a repeater:
Server Roles (repeater)
Servers (Only servers that have this role)

As you can see, the Servers table does not have a Role column. The association between a server and role is done in ServerRoleAuthorizations which is an intermediary table.

I want to write a filter expression that would link the Server table with that role.

How can this be done ?
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Wed Nov 25, 2015 9:37 am

You need two ebase tables:

ROLES: linked to your ServerRoles DB table
columns: RoleId, RoleName

SERVERS: a join of your Server and ServerRoleAuthorizations table (joined by serverId)
columns: serverId, serverName, roleId

Add a Repeater linked to the ROLES table.
Within this add a second Repeater or Table control linked to SERVERS, in the filter expression enter: SERVERS-ROLEID=ROLES-ROLEID

Call fetchTable() on both tables.
0 x


Who is online

Users browsing this forum: No registered users and 29 guests