AnsweredAssumed Answered

Set an Address as "Primary"

Question asked by wheelman1138 on Feb 21, 2019
Latest reply on Feb 23, 2019 by beverly

Hi All. I'm looking for, I guess, the best solution to tackle a task I am working on. I have a Contacts table. This has your standard contact information; Name, Shipping Address, Billing Address, etc.


What I'd like to do is be able to add alternate shipping addresses related to the record in my Contacts table but ALSO, more importantly, be able to change the "Primary" shipping address to one of the related records (without losing the current address).


I have a basic idea of how to accomplish this but I'm wondering if one of you FM veterans could show me how you would tackle this?


What I have now is 2 tables. Contacts and Alternate Shipping Addresses


From the Contacts table the user clicks a button to Add a Shipping Address which triggers a script:

Sets a variable $ContactID

Goes to a layout using the Alternate Shipping Addresses table

Creates new Record

Sets a field, Contact ID with the variable

Then enters find mode and performs a find for the same contact ID


I have a portal on the layout that shows records from the current table (Alternate Shipping Addresses).


My thought is that I need a check box in the portal row that when checked, triggers a script that sets variables based on the data in that row and then goes back to the contacts layout and sets those fields with the variables after grabbing the current shipping fields' data. But then I'd also have to uncheck whatever row WAS checked as the primary. That's where I'm getting hung up.


Any help with this would be greatly appreciated!