Skip to main content
Answer

Update sql Query Acumatica

  • March 16, 2021
  • 2 replies
  • 821 views

SadokHanini
Freshman II

Hello,


It’s possible to execute an update sql query by code in Acumatica?
I wanna update a field that exist in the database but not in the DAC

 

Thanks .

 

Best answer by Hughes Beausejour

There’s probably nothing blocking it:
Use Visual Studio with .NET and C# to query - Azure SQL Database & SQL Managed Instance | Microsoft Docs

However there is no built-in library in Acumatica to do so. Direct access to database bypass all security measures and increases risk of data corruption. The most direct method to interact with a database in Acumatica is the PXDatabase class. This requires a valid DAC class for minimal data integrity  validations: Direct Database Updates with PXDatabase – Acumatica.dev

Accessing directly the database from within an Acumatica customization is highly discouraged.

2 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • March 16, 2021

Hello Sadok,

This extended field might be available in “App_Runtime” folder in extended DAC. 

In your project solution, the same DAC you need to extend and add the same field and then by using this extended DAC, you can get this field in your graph and just do a cache update for that particular DAC.

 

Hope this helps!


Hughes Beausejour
Acumatica Employee
Forum|alt.badge.img+2
  • Acumatica Developer Support Team
  • Answer
  • March 16, 2021

There’s probably nothing blocking it:
Use Visual Studio with .NET and C# to query - Azure SQL Database & SQL Managed Instance | Microsoft Docs

However there is no built-in library in Acumatica to do so. Direct access to database bypass all security measures and increases risk of data corruption. The most direct method to interact with a database in Acumatica is the PXDatabase class. This requires a valid DAC class for minimal data integrity  validations: Direct Database Updates with PXDatabase – Acumatica.dev

Accessing directly the database from within an Acumatica customization is highly discouraged.