Highlighted
Absent Member.. Absent Member..
Absent Member..
616 views

Button to fill a table

Jump to solution

Hello

 

I have created a array of structure in the cm3r file which has two character fields.  I have a table control on the Change form to fill this array structure and to make it easier for user to fill this table I like to add a button next to it which will trigger a fill to this structure.  The link is ready and the table can be filled successfully with the fill button but how can I create this button to start the fill process for this table?

 

regards

Gretar

0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.
Absent Member.

Re: Button to fill a table

Jump to solution

Create a Display Option with the following values:

 

Screen ID: cm.view.display

Modifies Record: true

Action: do nothing

GUI Option: 123

Text Option: 123

Bank: 1

Default Label: Fill Table

Condition: true

 

Pre Rad Expressions:

$L.custom.field=<name of the field used in the Fill>

$L.custom.link=<name of the link record>

$L.custom.action="fill"

$L.max=lng(denull(<structure name> in $L.filed))+1

 

RAD Application: us.link

Parameter Names: record, name, string1, prompt, index

Parameter Values: $L.filed, $L.custom.field, $L.custom.link, $L.custom.action, $L.max

View solution in original post

Tags (2)
7 Replies
Highlighted
Absent Member.
Absent Member.

Re: Button to fill a table

Jump to solution

If the primary goal is to have a Fill button closer to the Table object, then all you need to do is set the Button ID to 9 (GUI Option for the Fill button).

 

1. Place the button on the form

2. Populate the following Properties:

Caption: Fill Table

Button ID: 9

3. Save changes to the form

 

This button will function the same as the Fill button in the Toolbar. This means users will still need to place the cursor in the desired row before clicking the button.

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Button to fill a table

Jump to solution

Thanks for your comments

 

I dont want users to need to place the cursor in the desired row before clicking the button.  How can I have the button place the cursor in the first empty row and trigger the link?

 

regards

Gretar

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Button to fill a table

Jump to solution

Create a Display Option with the following values:

 

Screen ID: cm.view.display

Modifies Record: true

Action: do nothing

GUI Option: 123

Text Option: 123

Bank: 1

Default Label: Fill Table

Condition: true

 

Pre Rad Expressions:

$L.custom.field=<name of the field used in the Fill>

$L.custom.link=<name of the link record>

$L.custom.action="fill"

$L.max=lng(denull(<structure name> in $L.filed))+1

 

RAD Application: us.link

Parameter Names: record, name, string1, prompt, index

Parameter Values: $L.filed, $L.custom.field, $L.custom.link, $L.custom.action, $L.max

View solution in original post

Tags (2)
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Button to fill a table

Jump to solution

Hi

 

Thanks for your details of the display option.  I have created it and set the button ID on the form to 123 but the button is inactive on the form when testing this.  Is something missing to have it active so I can press it?

 

regards

Gretar

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Button to fill a table

Jump to solution

The "Fill Table" option itself should be displayed in the Toolbar or Options menu. Is it visible and does it work when selecting it?

 

The most common issues related to an inactive button are the wrong Button ID and/or Display Option condition not evaluating to true.

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Button to fill a table

Jump to solution

It works now after restarting the SM client 🙂

 

I enhanced this by adding these calc in the display option to fill into the row where the cursor is if its in the table else fill it in the end row.

 

if nullsub(cursor.field.name(), "empty")#"<field in table to find or fill from>" then ($L.max=cursor.line(1)) else ($L.max=nullsub(lng(denull(<structure> in $L.filed)), 0)+1)

 

then this in the link line to have it fill based on the value where the cursor is.

 

if nullsub(cursor.field.name(), "empty")#"<field in table to find or fill from>" then ($L.idx=nullsub(cursor.line(1), 1);$c=$L.idx in <field in structure to base fill/find on> in $File;$query="<field in target file> like \""+$c+"*\"") else ($query=true)

 

Thanks very much for your help 🙂

 

regards

Gretar

0 Likes
Highlighted
Valued Contributor.
Valued Contributor.

Re: Button to fill a table

Jump to solution

I do have same requiremet to use fill function in table column..I tried your steps, but its not wiorking

 

Can you please provide screenshots?

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.