Research ( research_account_no, researcher_name, amount, status ....)
Expenses (research_account_no, invoice_no, invoice_date ....)
Relational field : research_account_no
Hello Mayor, attach a script such as this to a button above your portal:
Set Variable [ $accountNo ; Research::research_account_no ]
Go To Layout [ layout based upon Expenses ]
New Record Request
Set Field [ Expenses::research_account_no ; $accountNo ]
... now, you can stay on this Expenses layout to enter the detail and then have a button to take you back to Research or, what many people do if all the Expense fields are in that portal, is return to the portal to enter the detail. So to return, finish your script with:
Go To Layout [ original layout ]
Go to Portal Row [ Last ]*
Go to Field [ the field to begin entering data ]
* this is based upon an unsorted portal
My layout setting (layout setup) is "showing records from" table Research and I intend
to add new record for expenses in the same layout. So, I cannot add new record to table expenses.
When I change to "showing records from" table Expenses, Records from research cannot be displayed.
Correct me if I'm wrong. Is we show data from 2 table (research & expenses) in same layout,
we cannot add new record in expenses if layout setup is set to showing records from Research.
You can add records in a *related* table, if that option is checked in the relation between the two tables. Either place the fields directly in the layout, or create a portal.
If you would have tried my script, you would have found that it would work. Most Developers script new records as I've shown but you CAN use the relationship by checking in the relational graph to 'Allow Creation of Related' and then just type into the portal.
Either place the fields directly in the layout, or create a portal.
Well, placing the related field directly on the layout would not work here because it is indicated that there will be many expense records and a field placed on the layout will only ever show the first one (according to the relationship sort or natural sort order of creation date). A portal is certainly required no matter how the new record is created.