Forum Discussion
Eric_J_Hansen
9 years agoQrew Cadet
Here is something you could try:
On the Sales Table, you want to change the 'Add Survey' button that probably looks something like this:
URLRoot() & "db/" & [_DBID_SURVEYS] & "?a=API_GenAddRecordForm&_fid_13=" & URLEncode ([Record ID#])& "&z=" & Rurl()
(where field # 13 on the surveys table is your 'related sales' field / the reference field from the sales table and [record id#] is the key field on the sales table)
to something like this:
URLRoot() & "db/" & [_DBID_SURVEYS] & "?a=API_GenAddRecordForm&_fid_13=" & URLEncode ([Record ID#])
& "&_fid_11=" & URLEncode ([Related Customer])
& "&z=" & Rurl()
(where field # 13 on the surveys table is your 'related sales' field / the reference field from the sales table and where field # 11 on the surveys table is your 'related customer' field / the reference field from the customers table and [record id#] is the key field on the sales table)
From the customer table, the add survey button wouldnt be an ideal place to add a survey from because a customer might have many sales. If there is only one sales record, or if you would always want to populate the most recent sales record into the survey, you could use a summary field for the maximum of the record id# on the sales table, and pass that through to your 'related sales' field in the method I described above.
If you need help - my contact info is in my profile.
Good luck!
On the Sales Table, you want to change the 'Add Survey' button that probably looks something like this:
URLRoot() & "db/" & [_DBID_SURVEYS] & "?a=API_GenAddRecordForm&_fid_13=" & URLEncode ([Record ID#])& "&z=" & Rurl()
(where field # 13 on the surveys table is your 'related sales' field / the reference field from the sales table and [record id#] is the key field on the sales table)
to something like this:
URLRoot() & "db/" & [_DBID_SURVEYS] & "?a=API_GenAddRecordForm&_fid_13=" & URLEncode ([Record ID#])
& "&_fid_11=" & URLEncode ([Related Customer])
& "&z=" & Rurl()
(where field # 13 on the surveys table is your 'related sales' field / the reference field from the sales table and where field # 11 on the surveys table is your 'related customer' field / the reference field from the customers table and [record id#] is the key field on the sales table)
From the customer table, the add survey button wouldnt be an ideal place to add a survey from because a customer might have many sales. If there is only one sales record, or if you would always want to populate the most recent sales record into the survey, you could use a summary field for the maximum of the record id# on the sales table, and pass that through to your 'related sales' field in the method I described above.
If you need help - my contact info is in my profile.
Good luck!