• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 9. Extending the Interface with ... > Deleting Records in a Related File

Deleting Records in a Related File

When you create records using a portal (See Chapter 6, About Portals), you may want to be able to delete specific records (portal rows) in the other file. For example, if a customer cancels an order, you'll need to remove the entry from the sales database. Rather than going to the related file and searching for the record to delete, you can create a button to delete the record without leaving the first file.

To delete records in a related file:

Go to the layout that contains the portal. Choose View > Layout Mode (Ctrl+L/Command-L).

Double-click the portal. When the Portal Setup dialog box appears, make sure that the “Allow deletion of portal records” box is checked (Figure 9.16). Click OK.

Figure 9.16. The portal must be set to allow deletion of rows.

While in the portal, follow the steps in 'To create a button for a script” on page 184, but in the Specify Button dialog box, scroll down to the Records section and choose Delete Portal Row (Figure 9.17). Do not check Perform without dialog because you want to be able to cancel the choice if you've made a mistake.

Figure 9.17. You want to have a warning before the row is deleted, so leave the Perform without dialog option unchecked.

When you click the button a dialog box appears. If you click Delete, the portal row and its related record will be deleted from the other database. If you click Cancel, it won't be.

At the flashing cursor, type X (the universal icon for Delete). To add emphasis, make the X bold (Figure 9.18).

Figure 9.18. The bold X gives you a visual cue as to what the button does.

Choose View > Browse Mode (Ctrl+B/Command-B).

Test the button by clicking it in any row that you want to delete. The warning dialog box will appear to confirm the deletion (Figure 9.19).

Figure 9.19. The row will not be deleted unless you confirm the choice.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint