I’m new to servoy, and javascript, and have spent a long time looking at posts related to this subject, but can’t seem to find the answer I’m looking for. I think it’s a fabulous application but I’m still learning all the ins and outs.
I have a solution that involves a personnel table, proposal table and a grants table. I have tabs set up that will display a personnel record and the related proposals and grants for that record. In the proposals form I have a button (called approved) that when clicked on, I would like to create a method that takes the contents of the proposal table and updates the grants table with all the similar fields. I have relations setup between proposals, grants and personnel. I’ve tried the fsUpdater method, but it doesn’t know about the grants fields, and I’ve tried the getDataSetByQuery, to retrieve the field contents, but I don’t see a function to write the query back to the grants table.
After posting this in the programming forum, I got the following reply, but when I tried it, I got a new grants record, but the fields were all null
From the proposals table you can set fields of the related record in the grants table using:
Syntax:
relationship_name.field_name = field_name
Example:
proposals_to_grants.company_name = company_name
The method I tried was :
forms.grants.controller.newRecord()
proposals_to_grants.account_manager = manager
proposals_to_grants.lastname = pi_lastname
where account_manager is in the grants table and manager is in the proposals table. I even added in the forms.grants in front of the proposals syntax, but the same result - nulls.
Any help with this would be greatly appreciated. Until I sort out what I’m doing wrong, I’m dead in the water.
Thanks
Graham