Highlighted
Absent Member.. Absent Member..
Absent Member..
329 views

Is it possible to add a table to a form in which the elements in a column can be added?

Dear folks,

Here's what I want to do: I need to add a table to a form that contains two columns.  In the first column you have a five lines for five different tasks; in the second column you have the amount of time for completion of each task.  At the bottom of the second column I want to add a total of all the values in this column.  Any suggestion of how I might be able to accomplish this?

Best regards,

Ulises

Tags (1)
0 Likes
3 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Is it possible to add a table to a form in which the elements in a column can be added?

If the Column value will be the same always (five) you can try the below JS.  Return the below JS to an array field. 

function timeCalc()

{

var x = new Array();

x.push(23);

x.push(43);

x.push(56);

x.push(132);

x.push(136);

x[5] = x[0]+x[1]+x[2]+x[3] +x[4];

print("The X values : " +x);
return x;

 

}

--AB

Kindly assign kudos if the post is helpful!
Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..

Re: Is it possible to add a table to a form in which the elements in a column can be added?

Hi Ulises, how's it going at Mc? I typed up a reply the other day and apparently lost it...

A few questions: Should every field in this table be editable, or every field except the total field? Is the total supposed to be calculated as the user fills in the other five times, or on some action like record save? Does the total field have to be in the table also, or can it be a separate field below the table? Any other particulars about the table and/or controls you want on it?

Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Is it possible to add a table to a form in which the elements in a column can be added?

Thanks for the answer; I decided against using a table and used Javascript code to  just add the fields I wanted to.

 

Regards,

Ulises

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.