You are missing a table.
Because you are talking about a many to many relationship.
How will you relate Customer 1 to both widgets and Customer 2 as well?
It's not possible without a join table.
That's a table that contains the Customer ID and the Widget Id.
And in your case you would have 4 records in that join table:
Widget 1 Customer 1
Widget 2 Customer 1
Widget 1 Customer 2
Widget 2 Customer 2
And then you can just delete whichever one you don't want anymore.
I automate this process so I'm not manipulating any records directly from the portal. I include an "x" at the end of each portal row with a script attached. The script runs a find in another window and prompts the user to delete or stop (with a nice disclaimer that the "widget" is not itself deleted). The script then deletes the join record, which removes it from the portal neatly.
Yes, I understand that - I referred to the linking table (or joining table) above.
So, imagine the Widget layout. It has a Portal to customers, and it shows two customers. How, from that portal, can I delete "Widget 2 Customer 2" from that joining table, without deleting the Customer 2 record itself?
Matt, that sounds like a good approach. I haven't done a script before - how would I refer to the correct customer ID and Widget ID in that script?
It's too bad this isn't supported out of the box, it seems like a common use case... Bento supported it easily.
Hi Tunesmith. It is a very common use case and it is used all the time.
It is supported out of the box. You just aren't doing it right :p
You don't base your portal on the customers table. But on the Join table.
I'll make you a quick video to explain.
Oh my gosh! Thanks, Guy. That is the light bulb - I didn't realize I could just pull in a "CustomerWidget" portal and then refer to the Customer names from there rather than the ids in the join table. I can put a button on each row to "delete portal row" without a dialogue box, too.
Although... I'm not sure if, from that Widget1 record, I can a) create a new Customer4 from that portal, or b) select an already-existing Customer3... still messing with it. :-)
You could add a script that allows you to create a new customer directly from within the widget layout, but that can't be done directly.
But if you are a little clever in coming up with a script that shouldn't be a problem. ;)
Thanks again Guy! I'm sure I'll review that a few times in the next few days. A perfect bit of mind-expansion there. ;-)