Clearing contents of a table (RDMLX)

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
tcremieux
Posts: 4
Joined: Thu May 10, 2012 6:28 am

Clearing contents of a table (RDMLX)

Post by tcremieux »

Is there a way to clear the contents of a table without having to refresh the entire form? I was thinking that calling #COM_OWNER.SetTable again would rebuild the table. Ideally this would be something like #COM_OWNER.ClearTable Name('Table').

Currently, the only way I can achieve this is to specify #COM_OWNER.IsNewForm = True, which however clears the contents of any textbox on the form.

Thanks!
Paul

Re: Clearing contents of a table (RDMLX)

Post by Paul »

Thanks for posting this Tom. The way to clear a table using current beta versions would be to set the Row property to null. The Row property is not directly exposed in the LRNG_FORM ancestor but it can be accessed. Please try the following;

Code: Select all

#COM_OWNER.Set_Null Property('/Form.Fields.Table1.ROW')
There will be an RDMLX method or feature of Tables to do this in the future.

Note this post is for RDMLX LongRange Form views only.
Paul

Re: Clearing contents of a table (RDMLX)

Post by Paul »

I should add that 'Table1' will be replaced with the actual name of your table.
tcremieux
Posts: 4
Joined: Thu May 10, 2012 6:28 am

Re: Clearing contents of a table (RDMLX)

Post by tcremieux »

Thanks Paul. I used the Set method to set the ROW property to *NULL since there is no Set_Null. Works perfect.

Code: Select all

#COM_OWNER.Set Property('/Form.Fields.Table1.ROW') To(*NULL)
Paul

Re: Clearing contents of a table (RDMLX)

Post by Paul »

A new parameter, ClearRows, was added to the LongRange LANSA GA release. Set this parameter to True to clear all existing rows from a table before adding new ones.

For example;

Code: Select all

#COM_OWNER.Set_Table Name('/Form.Fields.Table1') Clearrows(True)
Post Reply