How to access field variables from a multi-row form?

Hi,

I am trying to build an array of variables from a multi-row form. I want to create a local variable array called $job_id[] (for example) from the list of rows available in the multi-row form. Therefore, on load, I want this array populated with the available job_ids and when a row is either added or deleted, I want a subsequent change to this array.

Any help on this would be appreciated.

Regards.

Viral Shah

Hey Vhshah, you will just need to write the php and JS code to create and manipulate the array. There is no way around that.

Just do not forget that any variables you create are only available in the event itself and must be declared as session globals to be available to other events during runtime.

To do this, declare the global using [global_var] = array(); and then go to Application -> Globals and configure it to be session variable.

Then you can pull this array from your global variable and make changes to it, and put it back in to this global variable once you are done to save the changes.

If you need more help please provide more details about your code.

Thanks for your reply Proper.

What I am trying to do is allocate a job between resources. Therefore, I have a master-detail setup with the job details as the master and a grid edit form as the detail. In the detail I have a select for resource and another field for allocation percentage. I need to ensure that the resource is not repeated and the total allocation is 100%.

On the validate event I wanted to build an array of allocation percentages entered so that I could check if it is equal to 100 or not. Also I wanted to build an array of resources used which can be used to determine if there are any duplicates. Ideall, when I insert a new row, I would like to not show a resource in the select once it is already used in a row above.

Some help with sample code would be very useful. Thanks a lot.

Regards.

Viral Shah