Discussions

Expand all | Collapse all

Copy Records to new table and Delete with automation

  • 1.  Copy Records to new table and Delete with automation

    Posted 10-30-2019 09:38

    I have a quotes and dealer orders table. When a user creates a quote there is an "order" button.  My goal is to have that sit in their quotes table until they hit order and then that disappears from "quotes" and goes to "Dealer Orders" Table.

    I have an automation set up that copies certain information from that quote (name, address, material information) to the dealers table when the order button is pressed (triggering a field to show "approved", which triggers the automation). 
    After that the automation changes that field back to "sent" rather than approved so the automation doesnt copy over every quote- just the one ordered. 

    Lastly I have an action in the automation that deletes the record that has "sent" in that field. 

    Am I doing that right or is there a different way I should go about this. 

    As of now my automation is triggering and deleting from my quotes table, but it never shows up in my Dealer orders table and gives me an error after the automation is ran. 



    ------------------------------
    Mike Klausing
    ------------------------------


  • 2.  RE: Copy Records to new table and Delete with automation

    Posted 10-30-2019 12:37
    I think what might be an easier way of doing this for me is to create a filter that filters all quotes and only shows the ones that havent been ordered yet.

    ------------------------------
    Mike Klausing
    ------------------------------



  • 3.  RE: Copy Records to new table and Delete with automation

    Posted 10-30-2019 13:41
    Edited by Evan Westbrook 10-30-2019 13:41
    Mike,

    You're on the right track with not wanting to delete the data. How about something like this?

    1. Make sure "Quotes" is related to "Dealer Orders" one to many
    2. Pull in any relevant "Quotes" fields to "Dealers Orders" with Lookup Fields through  [Related Quote]
    3. Update the automation to copy only [Record ID#] on a "Quotes" record to [Related Quote] on a new "Dealer Orders" record
    4. Create a summary field on "Quotes" to count the # of "Dealer Orders" records related to a Quote.
    5. Set up a filter on "Quotes" so that a record is hidden if [# of Dealer Orders] > 0
    Instead of managing adding, moving, and deleting data, you're creating information once and relating one record to another. The parent record is then hidden by virtue of if it has a related child record. This will also make things easier to debug in the event that the Automation fails.

    ------------------------------
    Evan Westbrook
    PRIME Developer
    Harder Mechanical Contractors Inc.
    Portland OR
    ------------------------------



  • 4.  RE: Copy Records to new table and Delete with automation

    Posted 10-30-2019 23:44
    @Evan Westbrook solution should give you the desired outcome instead of going for deleting the data unless there is a need to do so.

    ------------------------------
    Babi Panjikar
    ------------------------------



  • 5.  RE: Copy Records to new table and Delete with automation

    Posted 04-10-2020 05:52
    Hi
    I'm in a similar situation and found this thread as i was orientating for solutions.

    In my case the situation is about submitted change requests including budgets including currency exchange rates n relation to projects.
    I was thinking  to build something like Mike described in his initial post. Reason to do so is that I need to make sure in some way that projects managers (PM) cannot mess with budgets and details after approvals have been granted
    I believe this would be  easiest to manage to move and thus freeze the data incl costs and exchange rates to a new table where these group of PM's only have read access.

    I will also build a quick test app around Even's suggestion to see how that works out.

    Open for suggestions and experiences from others out there who faced similar issues as there is no need to re-invent the wheel.

    Thanks JWS


    ------------------------------
    Jan-Willem S
    ------------------------------