Page 1 of 1

Insert value from main table into "Allow add

Posted: Tue Jan 16, 2018 1:20 am
by mpol_ch

Hi,
How can i auto insert the value from main table into allow add?
I have a table with lookup link and activated option "Allow add".

Main table field=Nr with value MLJ33
Allow add table field=Ref

When I click + sign (Allow add) then I want to have in Ref "MLJ33" inserted.

Any idea?

mpol_ch


Re: Insert value from main table into "Allow add

Posted: Tue Jan 16, 2018 12:09 pm
by arbei

It is not supported to pass the value to the "Add option" dialog box.


Re: Insert value from main table into "Allow add

Posted: Tue Jan 16, 2018 1:36 pm
by kirondedshem

Ive tested that the Allow add option still uses the field settings->default add value if set. So create a function in global code to auto determine what value to set during allow add, then put the function as the default add value for the ref field in field settings. Now the ref field will have that value during every add form to the main table as well as during allow ad option.

If the value to set in ref field is somehow dependent on the add form in which the allow add option si called then maybe save any values you need in a session and then use the session values to auto determine the value you need.