Method Community

 

Delete or update specific record in grid

Last post 02-02-2011 3:29 PM by Phat Matt. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-27-2011 7:20 PM

    Delete or update specific record in grid

    Hello!

    I am trying to figure out in a string of actions how to either update or delete a specific record in a grid. I have a string of actions that inserts a new record into the estimateline grid on the estimate and enters a subtotal from the estimateline grid. I am trying to figure out how to update or delete and add back the same record once additional records have been added to the estimateline grid thus changing the subtotal.  I would need to specify the record as "equal to" or "contains" item name that needs to be updated and also reference the recordID to match the recordID of the screen.

    Any thoughts???
    Thanks a ton!

  • 01-28-2011 9:08 AM In reply to

    Re: Delete or update specific record in grid

    Answer

    Hi Phat Matt,

    Since both the Update and Delete actions in Method only support one where clause but you need 2 where clauses to get the results you are looking for I would first use the Retrieve Value from Table action and retrieve the RecordID for the Item you want to delete/update based on the Item Name and the RecordID for the current estimate (Value from Session Current Screen active record ID).  Once you have the RecordID stored in an action result you can use that value to update or delete the record.

    resultRecordID= Select RecordID from EstimateLine where Item = [Item name] and where EstimateRecordID= [Current Screen Active Record ID]

    -Michael

     

    Michael Melo
    Product Manager
    Method Integration Inc.
    Website: http://www.method.me
    LinkedIn: http://www.linkedin.com/in/MichaelMelo
  • 02-02-2011 3:29 PM In reply to

    Re: Delete or update specific record in grid

    It worked! You are a genious Michael! I never knew until a few minutes ago that you could add another "where" statement on retrieve value. I get excited when I learn new things. Thanks for the help!!!

Page 1 of 1 (3 items)