Set value of new or existing record from a value on an open form from another table

I would like to do the following:

  1. Open a form named “ServiceLog 2” (new or exiting record)

  2. Click on an inline behavior action to open another view “Expenses” and the KEY column use the value from the KEY column of the record being viewed on the open form “ServiceLog 2”. When done with the view “Expenses”, return to the open form “ServiceLog 2”.

  3. Solved

  4. Needs solving

What’s the question? Or do you have one?

1 Like

I do not know how to solve #2.
What expression can I use to have the KEY column of “Expenses” default to the value of the KEY column of the open form “ServiceLog 2” when adding or editing a record in “Expenses” ?

( #3 and #4 were labeled as #1 and #2 but autocorrect must have changed them without me noticing )

You need to a reverse reference between the ServiceLog 2 and Expenses with isPartOf set to TRUE.

Unfortunately, I am not familiar enough with it and would need more details on how to do that.

How is your table structure for both tables? Can you give a screenshot?

  • Add a ServiceLog column (physical) to the Expenses table.
  • Regenerate the column structure.
  • Expand the column structure
  • Set the column type to REF, choose Service Log table and turn on isPartOf property.
    Save the editor. When you create a ServiceLog record, you can create as many as Expense records and it will always return back to the ServiceLog form.
3 Likes

That works great. Thank you so much.

3 Likes

You’re welcome

Hello Levent,

I have encountered something that I need to change but do not know how.

When adding a new “Related Expense” from the inline section of the Details view of ServiceLog, the label shows “Add”, which is fine ( 1st image attached ).
When adding a new “Related Expense” from the edited Form of ServiceLog, the button label shows “New Complaint”, which is not what I want ( 2nd image attached ).

I believe this is a remnant of the original structure of the sample app before I made numerous changes.
A field in the ServiceLog table was originally named “Complaint” but is now named “Subject”, but I don’t know if this is related to my issue.

I need to change the button label to be “Add” or “New” or something similar.

I have looked in many places but have not found where to make the needed changes.

Thanks, Bill

image

image

@Bill_Hyde
Check the Localize setting for New appearing in the ref/reverse ref columns

1 Like

Success. Thanks so much.

1 Like

You’re welcome.