AugForums.com

An Acumatica User Group

  • Free
    • Start Here
    • Rolodex
    • Podcast
    • Blog
    • Forums
  • Paid
    • AugSQL
    • GI Course
    • GI Library
    • Consulting
  • Register
Acumatica Forums

By using this website, you agree to our Terms of Use (click here)

Forums
AUG Forums
Everything Else
Run an SQL Script a...
 
Notifications
Clear all

Questions Run an SQL Script at Time of Save

 
Everything Else
Last Post by Tim Rodman 2 years ago
6 Posts
4 Users
1 Reactions
2,629 Views
RSS
Jeff T
Posts: 8
 Jeff T
Topic starter
September 23, 2019 4:21 pm
(@jt)
Member
Joined: 7 years ago

Is there a way thru Acumatica customization projects to run an SQL script dynamically? Probably the best way to explain this is the use case scenario.

We are using Acumatica to create new stock items. But we have a 2nd SQL database (not-Acumatica) that needs to know when a new stock item has been created and copy the data over. Ideally upon saving the new stock item in Acumatica an SQL script is run that pushes the necessary info over to the other SQL database. Is this possible within the bounds of the built in Acumatica customization projects? Or would it require more in depth customization?

Topic Tags
SQL customization
5 Replies
Fernando Amadoz
 Fernando Amadoz
(@fernando-amadoz)
Joined: 5 years ago

Active Member
Posts: 4
October 18, 2019 12:39 pm
Reply toJeff TJeff T
Posted by: @jt

Is there a way thru Acumatica customization projects to run an SQL script dynamically? Probably the best way to explain this is the use case scenario.

We are using Acumatica to create new stock items. But we have a 2nd SQL database (not-Acumatica) that needs to know when a new stock item has been created and copy the data over. Ideally upon saving the new stock item in Acumatica an SQL script is run that pushes the necessary info over to the other SQL database. Is this possible within the bounds of the built in Acumatica customization projects? Or would it require more in depth customization?

@jt, given that the second DB is a non-Acumatica DB, you will not have (direct) access to it from the framework.

I can think of a couple of workarounds:

1. The trigger suggested by @carl-brooks 
Acumatica does not encourage the use of SQL objects i.e. SQL views, stored procedures, triggers, etc. for 2 main reasons: i) your application is no longer DB-agnostic. ii) your application would no longer be certifiable by Acumatica.
Having said that, it's my impression that you are looking to do this as a one-time-only requirement. In which case, the SQL trigger is certainly worth looking into.

2. As a second alternative, if you have access to the non-Acumatica DB via an API, you could create an Acumatica processing page that would get executed periodically in order to sync the data.
Pros: you would be able to manage it from the framework.
Cons: the sync would not occur immediately. It would depend on your process recurrence.

 

Reply
Jeff T
 Jeff T
(@jt)
Joined: 7 years ago

Member
Posts: 8
October 18, 2019 2:43 pm
Reply toFernando AmadozFernando Amadoz
Jeff T

@fernando-amadoz Thank you for the information. I think my best option is via API. 

Reply
Tim Rodman reacted
Carl Brooks
Posts: 121
 Carl Brooks
September 23, 2019 7:48 pm
(@kingcarlos)
Estimable Member
Joined: 5 years ago

Would you not use a SQL trigger at DB level rather than through the Accumatica framework? 

Reply
Tim Rodman
Posts: 3192
 Tim Rodman
Admin
October 17, 2019 8:04 pm
(@timrodman)
Famed Member
Joined: 10 years ago

For a framework option, message @fernando-amadoz at SkyKnack. I know he's done stuff syncing data between Acumatica Tenants.

Reply
Tim Rodman
Posts: 3192
 Tim Rodman
Admin
September 23, 2023 6:23 pm
(@timrodman)
Famed Member
Joined: 10 years ago

This is now possible with AugSQL (click here). With AugSQL, you can trigger a SQL script with a Business Event in Acumatica.

Reply
Forum Jump:
  Previous Topic
Next Topic  
Related Topics
  • Allow user to only see their own Journal Transactions
    6 months ago
  • Create new field in PO with default values
    10 months ago
  • Is it possible for acumatica to automatically pull up the customer information and show it as a pop up ?
    11 months ago
  • Adding a Customer Status w/Logic attached
    1 year ago
  • Add Project Inventory ID into Employee Time Cards screen
    1 year ago
Topic Tags:  SQL (4) , customization (14) ,
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,518 Topics
  • 10.9 K Posts
  • 5 Online
  • 2,309 Members
Our newest member: Jason Rhodes
Latest Post: Table linkage for adding a customer location note to the SO Shipment form
Forum Icons: Forum contains no unread posts Forum contains unread posts
Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Online Members

 No online members at the moment

Acumatica Forums

Terms of Use & Disclaimers :: Privacy Policy

Copyright © 2025 · AUG Forums, LLC. All rights reserved. This website is not owned, affiliated with, or endorsed by Acumatica, Inc.

‹›×

    ‹›×