RDMLX Offline Nested Tables

Please do not use to report errors- use your regional help desk.
Please mark posts as being for RPG or RDMLX (LANSA) developer.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
Post Reply
MarcusLancaster
Posts: 48
Joined: Wed Nov 06, 2013 1:28 am

RDMLX Offline Nested Tables

Post by MarcusLancaster »

Hi all.

I've got an offline form, which shows a table of Employees. Each row is realised as a form and the Employee information (unique employee number, name, address etc) is formatted within that form (into labels, textboxes etc). That all works fine.

What I need to do is add an additional table to each form/row to hold Skills for each employee. So there will be an inner table for every row in the main "outer" table.

I've created this visually, but can't work out the syntax I need to ensure that the inner table binding SQL WHERE clause picks up the outer table's employee number... in other words how do I refer to the Employee Number from the "outer" table as part of the binding SQL WHERE clause for the inner table?

The SQL Binding syntax for the "inner" table;

#Com_Owner.Set_Binding Name(LIST_EMPLOYEES.COL%1.CONTENT.FIELDS.LIST_SKILLS) Property(ROWLIST) BindToType(SQL) BindTo('SELECT ROWID,COLSkillCode,COLSkillDescription FROM TBLSkills WHERE TBLSkills.COLEmployeeNumber = &(FLD:TBLEmployees.COLEmployeeNumber)')

only ever picks up the skills for the very first employee in the outer table.

There must be a way to do this... I just can't find an example which describes the syntax.

Anybody done this? If you have, I'd really appreciate any info, code snips etc that you've got.

Cheers.

Marcus.
MarcusLancaster
Posts: 48
Joined: Wed Nov 06, 2013 1:28 am

Re: RDMLX Offline Nested Tables

Post by MarcusLancaster »

Update - I found the problem and can confirm that the code I used DOES work;

#Com_Owner.Set_Binding Name(LIST_EMPLOYEES.COL%1.CONTENT.FIELDS.LIST_SKILLS) Property(ROWLIST) BindToType(SQL) BindTo('SELECT ROWID,COLSkillCode,COLSkillDescription FROM TBLSkills WHERE TBLSkills.COLEmployeeNumber = &(FLD:TBLEmployees.COLEmployeeNumber)')

My issue was down to a buried, duplicated binding entry which was taking precedence - in other words the code I thought I was running, wasn't being used... of course, no errors were generated, because the duplicate code was "valid" - it was just the wrong code!

Just wanted to advise that the code sample is good, and that nested visual tables do work!

Cheers.

Marcus.
Post Reply