People Goal 5 - Part 5: Delete a portal row

Document created by Kedar on Feb 4, 2015Last modified by communitymanager on May 12, 2015
Version 10Show Document
  • View in full screen mode

 


Now that you’ve created a script to add a portal row, let’s create one that deletes a portal row. That way, if the user creates a row they don't want, they have an easy way to dispose of it.  Here’s what you’ll do:

 

  • Create the button in your portal

  • Create the script for the button

  • Format the button to look like a trashcan

  • Test the button by deleting a portal row

 

You’ll make some improvements to your button script in Part 7, at which point your script should resemble “Delete Portal Row” in the example solution.

 

 

Goal:

 

Add a button that deletes a row from your portal.

 

 

Steps:

 

Create the button and script

 

  1. Make sure you are viewing your Main Detail layout in Layout mode.

  2. Make sure you have .375 inches of open space on the right-hand side of your first portal row.

  3. Select the Button tool from the status toolbar.

  4. Draw a square in that open space to create a button, making it about .375 inches wide.

    A Button Setup dialog window appears.

  5. From the first row of options, choose the second one -- to display an icon only.
    button icon only.png
  6. Choose the second trashcan icon from the grid of icons.
    button icon trashcan.png
  7. Use the slider to change the icon size to 16 pt.
    button icon slider 16pt.png


  8. Choose Perform Script for the Action.
    button action perform script.png

    A Specify Script dialog window appears. You're going to create a new script now.


  9. Click the + button in the lower left of the dialog window.
    pasted-image-7.png

    An Edit Script… dialog window appears. It's like a simplified version of the Script Workspace, without the left pane, just the center and right ones.

  10. Name the new script:  Delete portal row, then press Enter.

  11. Add a Delete Portal Row script step from the right pane.

    The “Delete Portal Row []” script step appears as the first line of your script.

  12. Click the OK button in the lower right of the Edit Script… window to dismiss it.

  13. Click the OK button in the lower right of the Specify Script… window to dismiss it.


Resize and position the button


 

  1. Using the Inspector > Appearance tab > Graphic area, change the Fill drop-down to "None".

  2. Using the Inspector > Appearance tab > Graphic area, change the Line drop-down to "None".

    Now let's repeat those for the Hover display state. Any changes you make will only affect formatting when the mouse is hovering over the button. This gives cues to the user about interactivity (that is, the fact that it's a button).

    The display state is the second drop-down below the Style option near the top of the Inspector.

  3. Using the Inspector > Appearance tab, change the display state to "Hover".
    button hover display state.png


  4. Using the Inspector > Appearance tab > Graphic area, change the Fill drop-down to "None".

    Next you'll change the object component so that the actual button icon is being formatted, rather than the square area defined by the button.

    This is the first drop-down below the Style option near the top of the Inspector.

  5. Using the Inspector > Appearance tab, change the object component to "Button: Icon".


  6. Using the Inspector > Appearance tab > Graphic area, change the Fill drop-down to a bright orange.
    button icon hover color orange.png

    Next you'll change some basic aspects of the button that don't require you to specify a display state.

  7. Using the Inspector > Position tab > Position area, change the Width and Height of the image to precisely .375 inches.

  8. Using the Inspector > Position tab > Position area, enter the following text into the Tooltip box:  Delete [Secondary tablename]

    The example solution uses “Delete Activity”.

  9. Align the button to that it’s vertically centered in the portal row.



Test the button


  1. Enter Browse mode.

  2. Hover over the button to check whether it turns bright orange.

  3. Create a new row in your portal, entering some data to identify it.

  4. Click the trashcan to run your script.

    When setting up the button, you did not select the Perform without dialog option, so the following message appears:
    delete portal row.png

  5. Choose the “Delete” button.


Your portal row is deleted. Let’s continue to work on this script in Part 4.


      

      

Attachments

    Outcomes