Method CRM Try it FREE
 Method CRM Help Center
 Search  
Overview
Getting Started Checklist
Customization
Best practices
Consulting checklist and scoping
Glossary of common terms
Design Mode layout
Examples of Scoping
Method FAQ


collapse all | expand all
How to delete multiple records while looping through a grid
Solution No. 194

We're going to create a simple page to delete leads that are no longer needed with our client.  We'll be using the grid and button objects along with an action set that will loop through all checked rows deleting only those.  We'll also add in a popup message to confirm the delete and a refresh grid action to show any changes.


Solution 

  1. Click Customize > Screens.

  2. In the Screen name box, type your screen name.

  3. Click Continue.

  4. Select the Table customers.

  5. Add a Tab Link to your home screen.

    TIP: Create a Tab called DEVELOPING and put all copied screens and new screens you’re building into this tab.  It helps keep you organized and hides incomplete pages from users who shouldn’t see it.

  6. Click Add Screen.

    TIP: On your brand new screen, start by clicking the number 5 in the section header then add several blank rows.  Starting with additional space on the designer screen will help you layout nicer pages.
     
  7. Click Add Objects

  8. Drag Grid1 out to your designer page.

  9. Drag Button1 out to your designer page.

  10. Inside the Grid1 object, click Edit.

    • Step 1 of 9: Grid Properties:
      - Enable checkbox column.

    • Step 2 of 9: Grid Columns:
      - Click Field.  Select the field FirstName.  Click Insert Column.
      - Click Field.  Select the field LastName.  Click Insert Column.
      - Click Field.  Select the field Email.  Click Insert Column.

    • Step 3 of 9: Filters:
      - Choose from a list of available fields: EntityType.
      - Click Insert Filter.
      - Field: EntityType.
      - Filter: Contains.
      - Get value from: Type In.
      - Type "lead" in the box.

    • Click Save & Close.

    • Click Finish.

  11. Inside the Button1 object, click Edit.

  12. In the caption box type "Delete".

    TIP: Caption names are also used as reference names inside actions.  It’s a good idea to give descriptive names to all objects on the page.

  13. Click Next.

  14. Click Add Action and select Action: Start Loop Through Grid.

    • Under Grid/Table select Customer.

    • Under Include select Only checked rows.

    • In the box Internal Note: type in what this action does.

    • Click Save & Close.

    TIP: Add notes for every action you use, no exceptions!  Notes are like comments to another screen designer.  Be clear, be descriptive.

  15. Click Add Action and select Action: Delete Record From Table.

    • Under Select Table: select Customer.

    • Under Where Field select FullName.

    • Under the next drop down select Equal To.

    • Under Value: select Value From Row.

    • Under the next drop down select FullName.

    • In the box Internal Note: type in what this action does.

    • Click Save & Close.

  16. Click Add Action and select Action: End Loop Through Grid.

    • In the box Internal Note: type in what this action does.

    • Click Save & Close.

  17. Click Add Action and select Action: Refresh Grid.

    • Under Grid select Customer.
    • In the box Internal Note: type in what this action does.

    • Click Save & Close.

    TIP: You can reorder actions by clicking the number and typing in the new number for that action.  All other actions with move to accommodate.
     
  18. Click Add Action and select Action: Show Message.

    • In the box Type your mesage here, type your message.

    • Under the message, select the option: Provide Yes / No option to the user? ('No' will mean no further actions get processed).

    • In the box Internal Note: type in what this action does.

    • Click Save & Close.

  19. Click Move up for Show Message so it comes first.

    TIP: To quickly reorder actions, click on the number in your action list and type in the number you would like to move the action to then press Enter.

  20. Click Move down for Refresh Grid so it comes last.

  21. Click Finish.

  22. Click Publish.

  23. Click Save & Close.

 

Was this article helpful?