DawnRene3
3 years agoQrew Trainee
How to prepopulate a current user field to a related record?
I have been trying to prepopulate an add button to take the current user and automatically add a new related record and user to a child table.
I have three tables - Contract Coaches (synced table from another app, key field cb_id). Contract Coaches is a Parent to Contractor Projects. Contractor Projects is a parent to Project Bids. Contract Coaches is a parent to Project Bids. In the Contactor Projects table I have a button, Bid Yes, to Add a record to the Project Bids table and prepopulate the Project Bid yes/no field (which it does) but also prepopulate the related Contract Coaches field with the current user so they don't have to pick from a dropdown. There are no related Contract Coaches from the Contractor Bids table as Contractor Projects data is filled in by the Project Manager.
This is my current button formula:
URLRoot() & "db/" & [_DBID_PROJECT_BIDS] & "?a=API_GenAddRecordForm&_fid_17=" & URLEncode ([Record ID#])
& "&_fid_67="& URLEncode([Current User])
& "&_fid_22="& URLEncode("Yes")
& "&z=" & Rurl()
where fid_67 is the reference proxy, Contract Coach - cb_id for the Related Contract Coach. I've tried different proxy fields and I still can't get it to related to the Contract Coach record with the current user. Step-by-step instructions would be appreciated! I know I'm off somewhere. Thanks!
------------------------------
Dawn Rene
------------------------------
I have three tables - Contract Coaches (synced table from another app, key field cb_id). Contract Coaches is a Parent to Contractor Projects. Contractor Projects is a parent to Project Bids. Contract Coaches is a parent to Project Bids. In the Contactor Projects table I have a button, Bid Yes, to Add a record to the Project Bids table and prepopulate the Project Bid yes/no field (which it does) but also prepopulate the related Contract Coaches field with the current user so they don't have to pick from a dropdown. There are no related Contract Coaches from the Contractor Bids table as Contractor Projects data is filled in by the Project Manager.
This is my current button formula:
URLRoot() & "db/" & [_DBID_PROJECT_BIDS] & "?a=API_GenAddRecordForm&_fid_17=" & URLEncode ([Record ID#])
& "&_fid_67="& URLEncode([Current User])
& "&_fid_22="& URLEncode("Yes")
& "&z=" & Rurl()
where fid_67 is the reference proxy, Contract Coach - cb_id for the Related Contract Coach. I've tried different proxy fields and I still can't get it to related to the Contract Coach record with the current user. Step-by-step instructions would be appreciated! I know I'm off somewhere. Thanks!
------------------------------
Dawn Rene
------------------------------