Add a button to the portal row (or define one of the existing fields in the portal row a button) and let it perform this script step:
Set Field [ target field: Contact::accountID ; calculated result: Account::ID ]
where in Account::ID Account is the Account table occurrence of the selection portal, and ID is the name of the Account table's primary key.
Hi erolst- thanks for the suggestion.
I tried what you recommended....but I ran into a few issues....the button didn't do anything.
Maybe I should back up one step to make sure the relationships are correct.
I am in the contacts layout...based on the contacts table.
I want to make sure all contacts are related to an account. For example:
Account: Apple Computers
Contact: Tim Cook
Conact 2: Jony Ive
We are going to a trade show this weekend and we plan on using this database to capture new leads.
I am certain someone will create a contact without having the time to create the account and relate the contact to the correct account record (if one already exists).
I plan on going back later and relating the contacts to the correct account.
I want to display a portal (on the contact layout) showing all accounts. From this portal (list of all accounts) we will select the correct account the contact belongs to. If necessary....we will create a new account...(hopefully from a button in the popover where the portal is displayed).
I created a new TO....related to the contacts table to show all accounts called "all accounts popover" with AccountID from the contacts table as the fk and AccountID from the new TO...based on accounts with AccountID as the pk.
Attracted is screenshot.
script should work unless your context is incorrect. correct context of the account is from the popup ... the TO ...All Accounts Popover
script step is .......
Set Field [ target field: Contact::_AccountIDfk ; calculated result: All Accounts Popover::__AccountIDpk]