Solomon Cloud Solutions

  • Services
  • Software Solutions
    • Beyond Software
    • Dynamics SL >
      • Account Central
      • All-In-One Project Invoice
      • Audit Utility
      • Mobile Time and Expense
      • Notifications
      • Project Invoice Posting Selection
      • Salesforce Integration
      • Transaction Import Automation
      • Two Factor Authentication
      • Web Apps Reports
      • Web Apps ROI Scheduler
    • Strategic Partners
  • Partner Portal
  • News & Events
  • About Us
    • Board of Directors
    • Careers
    • Community
    • Our History
    • Mission & Values
    • Testimonials
  • Contact Us
  • Services
  • Software Solutions
    • Beyond Software
    • Dynamics SL >
      • Account Central
      • All-In-One Project Invoice
      • Audit Utility
      • Mobile Time and Expense
      • Notifications
      • Project Invoice Posting Selection
      • Salesforce Integration
      • Transaction Import Automation
      • Two Factor Authentication
      • Web Apps Reports
      • Web Apps ROI Scheduler
    • Strategic Partners
  • Partner Portal
  • News & Events
  • About Us
    • Board of Directors
    • Careers
    • Community
    • Our History
    • Mission & Values
    • Testimonials
  • Contact Us

Solomon News & Events

Tips on Using SQL Triggers

10/2/2015

0 Comments

 
Solomon Cloud Solutions brings you tips for creating triggers to help you manage your Microsoft Dynamics SL data more efficiently.
A trigger is a SQL command that is a special kind of stored procedure that automatically executes when an event occurs in the database server. DML triggers execute when a user tries to modify data through a data manipulation language (DML) event. DML events are INSERT, UPDATE, or DELETE statements on a table or view.
​
While triggers can be used for history and audit purposes, as well as, to correct data that should be populated, or to fix data that was entered incorrectly in this case our trigger example is to update a blank field that should be populated.  In the example the trigger was created to update a Microsoft Dynamics SL customer’s data where the CuryID (currency ID) field is appearing as blank, when a new record is being inserted into that table, but needs to be corrected to reflect the system’s base currency. By using the following trigger SQL is able to quickly evaluate the data, locate any blank CuryID fields and replace with the systems base currency:
 
create trigger [dbo].[xCuryPurchord] on [dbo].[PurchOrd]
for insert as
set nocount on
if (select COUNT(*) from inserted where curyid='')>0
begin
                update x set x.curyid='USD'
                                from Purchord x inner join inserted i on i.PONbr=x.PONbr
                                where i.CuryID=''
                                               
end
 
Stay tuned for more hints and tips from Solomon Cloud Solutions on the Microsoft Dynamics SL product, and more.
_____________________________________________________________________________________
Solomon Cloud Solutions is a software publisher and consulting organization that provides development and consulting services to partners. Solomon Cloud Solutions was formed specifically to develop a complete cloud platform to accelerate development and deployment of their cloud based business solutions across their family of companies and their business partners. The Solomon Cloud Solutions companies operate under the brand names of Six Disciplines - publisher of performance management software, methodology and coaching and Beyond Software - publisher of project accounting software and are owned by Gary Harpst, Vernon Strong and Jack Ridge.
0 Comments



Leave a Reply.

    Categories

    All
    Dynamics SL
    Management Reporter
    SLUG
    SQL
    Technical
    Visual Studio
    Web Apps
    Year End

    RSS Feed

      Subscribe for more updates

    Subscribe
HOME     |      ABOUT     |    TESTIMONIALS     |      SERVICES     |     SOFTWARE     |     PARTNER PORTAL     |     NEWS & EVENTS      |      CONTACT US
©​ 2023 Solomon Cloud Solutions 

SOLOMON CLOUD SOLUTIONS and SOLOMON SOFTWARE  are trademarks or registered trademarks of Plumbline Solutions, Inc. in the U.S. and other countries.