Using Patch to update a SQL record

  • Using Patch to update a SQL record

    Posted by John Heck on April 2, 2021 at 4:16 pm
    • John Heck

      Member

      April 2, 2021 at 4:16 PM

      Hello, I am trying to Patch a single record in the Orders table in SQL.Ā  There is an Orders gallery and the gallery consist of an OrderID, CustomerName, SalesRep, Picked, CompletedDate.Ā  I would like to have a date picker field in the CompletedDate column and a check box for the PIcked column so that it is an edit in the gallery.Ā  I cannot get my Patch command to work when I update either field.Ā  Each column is independent of the other column and only one can be selected at a time and the CompletedDate can not be selected until the Picked column is completed.Ā  The system keeps giving an error the Record cannot be found.Ā 

      Patch(‘[dbo].[Orders]’
      Ā  Ā  Ā  Ā  Ā {OrderID: galOrders.Select},
      Ā  Ā  Ā  Ā  Ā {CompletedDate: datepickerfield}
      );

      I can get it to work using a form to be displayed over the gallery and using the SubmitForm(frmComletedDate) or SubmitForm(frmPicked) then selecting the save button.Ā  I was trying to get away from using the form.

      Thank you in advance for your help.
      Kind regards,
      John

      ——————————
      John Heck
      ——————————

    • Warren Belz

      Member

      April 5, 2021 at 1:18 AM

      Hi ,
      The syntax required for Patch would be

      Patch(
         '[dbo].[Orders]',
         {OrderID: galOrders.Selected.OrderID},
         {CompletedDate: datepickerfield.SelectedDate}
      )?

      ?

      ——————————
      Warren Belz
      Queensland Australia
      ——————————
      ——————————————-

    • John Heck

      Member

      April 7, 2021 at 7:57 AM

      Hello Warren,

       

      Thanks for the information.  That is exactly what I had tried.  It seems to be working now a day later, closed the app and then opened it the next day and it is working.

       

      Thanks for the help and confirmation on this.

       

      Kind regards,

      John


      John Heck
      Senior Project Engineer

      —————————————————————————————————–

      Center for Computer Resources, LLC

      Main: 248-284-7100 | Fax: 248-284-7101 | Direct: 248-284-7185

      Support: servicedesk@ccr1.com or CLICK HERE

       

      ——————————————-

    John Heck replied 4 years, 5 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Using Patch to update a SQL record’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!