2 Replies Latest reply on Feb 15, 2011 8:37 AM by DanielClark

    Problem with changing Record Name with associated Portals



      Problem with changing Record Name with associated Portals


      I have a Purchase Order Layout table, with an associated Line Items table. The Purchase Order table has a primary key field field called PO Number - this is also a key field in the line items table, so that when a Line Item is created in the Portal on the Purchase Order layout - that line item is now "married" to that PO via that PO Number field. However, I notice that if I mis-type the PO Number originally - then add a bunch of line items - then go back and fix my PO Number - all of the line items in my portal disappear. I understand that they are married to the "original" PO Number - so when I change it back to the mis-spelled one, they come back. How do I get it so that I can change the PO Number and the field in the line items changes with it (and by extension they stay on that PO no matter how many times I re-type the PO Number)? Thanks.

        • 1. Re: Problem with changing Record Name with associated Portals

          Best approach is to not use a value in your Purchase Order record that is entered by hand. This approach leaves you vulnerable to this complication. Instead, define an auto-entered serial number that you use to link a PO record to its line item recprds. Hide this field, you don't need to put it on any layout where it can be edited. Keep your hand entered PO Number so that you can print it out on your layouts, just don't use it in the relationship.

          If you insist on using a hand entered value as your primary key, first put a unique values validation rule on it so you can at least catch errors where the PO number duplicates a value in an existing record. Then, to change the value without loosing the related records, you must first find those related records on a layout where you have their PO Number field exposed for editing, you change them to the new PO number. When you return to your PO layout, the line items have been "divorced" from your current PO. Update the PO Number field for the PO record and they will reappear. Fail to do this exactly right, and you'll either get records linked that shouldn't be linked--possibly mixed in with those that should or you may still find that they are all missing--hence my advice to avoid the problem in the first place.

          • 2. Re: Problem with changing Record Name with associated Portals

            Ah, ok gotchya, yea, thats probably best to make a unique serial number field - I'll do that. Thanks again!