Method Community

 

Duplicate Estimate Button

Last post 12-08-2010 12:31 PM by akoumjian. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 12-08-2010 10:57 AM

    Duplicate Estimate Button

    I'm adding a "Duplicate" button to a custom Estimate screen. Here is the process I've created:

    1. Insert Records into Estimate Table (this copies the necessary values from screen and places them into a new Estimate. This part seems to work)

    2. Loop through EstimateLine Grid

    -- Insert Records into EstimateLine table. I insert what I believe are the necessary values from the rows. I also insert the EstimateRecordID as the screen's RecordID. I figure this is how it knows to associate the EstimateLine with the Estimate record.

    When I go to the newly created Estimate, it is missing all of the EstimateLine rows. Am I looping through the wrong grid/table? I have unchecked options such as "Only include checked rows".

     

     

  • 12-08-2010 11:03 AM In reply to

    Re: Duplicate Estimate Button

    Answer

    Easy fix I think.  Sounds like you are doing is inserting the ORIGINAL EstimateRecordID into the EstimateLine.  That will make the new Estimatelines associate themselves with the original Estimate!

    Instead, look at the first insert action, where you are inserting into the Estimate table.  You'll see there is an Action Result field there.  This action result will hold the NEW EstimateRecordID.  Call this something like "resultNewEstimateRecordID".

    Then when you are inserting into EstimateLine, and it is asking you for the EstimateRecordID, use Action Result: resultNewEstimateRecordID.  Then you'll be all set.

    Paul

  • 12-08-2010 12:31 PM In reply to

    Re: Duplicate Estimate Button

    Of course. I was hoping it was a simple mistake such as this. Seems to be working now.

Page 1 of 1 (3 items)