Need Help?
  • Application Remote Support
  • Infrastructure Remote Support
  • Sage HRMS Remote Support
  • Helpdesk
  • General Inquiry
1-800-719-3307
Net at Work Net at Work
  • Solutions & Services
    • ERP/Accounting

      ERP Services
      Acumatica
      NetSuite
      Sage X3
      Sage Intacct
      Sage 100 ERP
      Sage 300 ERP
      Sage 500 ERP

      CRM

      Strategic Advisory Services
      Digital Marketing Solutions
      CRM Training Camp
      Salesforce
      Microsoft Dynamics 365 CRM
      Sage CRM
      Infor CRM (formerly Saleslogix)

      Employer Solutions

      Sage HRMS
      Sage People
      Criterion
      Miviva

      Enterprise Content Management

      Imaging / Scanning
      Document Management
      Workflow Automation
      Solutions

      Nonprofit Solutions

      Abila by Community Brands
      NetSuite
      Sage
      Salesforce

      IT and Security Services

      Managed IT Services
      Fractional CIO Services
      Cloud Services
      Cloud at Work
      DR/Business Continuity Planning
      Compliance & Security
      Storage & Recovery
      Networking
      IT Security Services
      Communications

      Web Solutions

      Services Overview
      B2B Technology Suite
      Magento eCommerce
      WordPress CMS
      Systems Integration
      Website Managed Services
      Online Marketing & SEO
      ERP eCommerce Integration

      Additional Solutions

      Enterprise Business Intelligence
      Avalara Automated Tax Solutions
      Fortis Payments
      LeaseQuery Lease Accounting
      Sage Fixed Assets
      Vertex SMB Sales and Use Tax
  • Industries
    • Industries

      Healthcare
      Chemicals
      Food & Beverage
      Medical Devices
      Nonprofit
  • Learning Center
    • Online Resources

      Recorded Webinars
      Whitepapers
      Ebooks

      Upcoming Events

      Live Webinars
      Seminars
      Virtual Training Courses

      Training Courses

      View all available training course options
  • Company
    • Why Us

      Who We Are
      Management
      Our Partners
      Locations
      Careers

      News

      Press Releases
      Success Stories
      Net at Work Blog

      Contact Us

      1.800.719.3307
      Email Us

      Programs

      Alliance Partnership Program
      Women at Work
      Diversity and Inclusion
  • Blog
  • Contact Us
  • Contact Us

Home » Newsletters » Sage 100 Newsletter – Year-End 2018 » Custom On-Screen Message in Sales Order Entry

Sage 100 Newsletter – Year-End 2018

Keeping You Up-To-Date With Information About Sage 100

Custom On-Screen Message in Sales Order Entry

By: Jane Amorim, Business Analyst / Consultant

Do you need to remind your order entry team to do something on a customer order?  Perhaps to enter freight?  A standard charge?  Below I’m going to show you how to put a message on screen each time a sales order is saved.  In the next edition of this newsletter, we take this a step further and only display the message under certain conditions (such as when freight has not been entered or for specific customer types).  Let’s get started!

Step 1: Open Custom Office User Defined Script Maintenance

We’re going to write this in a language called VBScript.  FYI: There’s lots of information to be had out there on the internet regarding this language, so if your interest is piqued, just start your search engine query with “VBScript tutorial” and you’ll be on your way.  Now back to the task at hand… Expand the Custom Office module in Sage 100.  Open “User Defined Script Maintenance” (a.k.a. UDS Maintenance).

Step 2: Create and name your script.

Type a descriptive name into the Script ID box.  This name can be anything at all, but don’t use any special characters other than an underscore (or maybe a hyphen, but it’s not preferred).

Step 3: Write the code that will display a message box. 

We’ll start with just the two lines of code below.  I’ll explain what each one means in a moment.  For now, you can simply type them verbatim into notepad.  It should look like this:

Now let’s break it down.

The first line retval = 0 simply initializes a variable.  That’s techie talk for preparing it for use.  A variable is meant to hold some type of data.  In this case, retval is numeric and is holding a zero (for now), hence the “= 0”.  (If retval had been text, we would have typed retval = “”.)  Retval stands for return value.  Whenever we execute a line of code we like to get a return value.  That tells us whether the code was a success or failure.  Additional code would have to be written to check the value returned via retval, but we’re not going to do that today.  Baby steps.  Since this is a simple message box script, we don’t need to fret about failing a line of code right now.  If you didn’t understand any of this retval stuff, don’t worry about it!  Just put it in your script and watch it work like magic.  And yes, you can sometimes get away without doing this bit, but it will come back to bite you one day.  I promise.

The next line of code retval = oSession.AsObject(oSession.UI).MessageBox(“Enter your custom message here”)  is actually putting the message box on screen.  Obviously, you’re going to replace the “Enter your custom message here” with your own text.  Again, retval would receive a value that you could later check.  For example, if retval were still zero after executing the message box code, it would mean an error happened and we were not able to put the message on the screen for some strange reason.  (We’ll save that for a follow-up article.)

When you’re done typing out the code, click “Accept” to save the script and close the UDS Maintenance window.

Step 4: Tell Sage 100 when and where to trigger the script and display the message box.

We’re going to tell Sage 100 that we want this message box to appear when we save a Sales Oder.  To do that, open User Defined Field and Table Maintenance.  Expand the Sales Order directory and click on “SO Sales Order Header.”  Then, click on the script button to the right.

Click the green plus sign button on the right to add a script event (a.k.a. trigger).

Select the event “Table-Pre-Write” from the drop-down menu.  Then, select your script using the lookup glass.  This tells Sage that the script should run just prior to saving a sales order.  Click OK when you’re done and then click “Close.”

Note: You’ll also need to close the User-Defined Field and Table Maintenance Screen.  So you’re doing a lot of closing of windows, until finally…  You’ll be prompted to compile the script.  Go ahead and do that by clicking the “Compile” button.  That basically rolls it into the Order Entry program and activates it.  When that’s done compiling, go ahead and close any remaining windows.

Step 5: Ensure scripts are enabled in your company code. 

Scripts must be allowed/enabled per company code in Sage.  That’s as easy as checking a box, and you only need to do it once.  Open Library Master> Main> Company Maintenance.  Select your company code using the lookup glass.  Then, click on the “Preferences” tab.  If “Allow External Access” is not checked, do so now.  Then click “Accept” to save your changes.

Step 6: Test your message box script!

Now you get to test drive your new script.  Go into Sales Order and enter an order (or edit an existing one).  Click “Accept” and watch as your nifty message box displays.

And that was the tough part.  Be on the lookout for Part 2 in the next edition of our newsletter where we fine tune this bad boy.  Happy scripting!

« Return to Newsletter

In This Issue
  • From the Desk of the Sage 100 Consulting Manager, Lisa Margolies
  • Custom On-Screen Message in Sales Order Entry
  • Sage 100 Year-End 2018
  • Processing the New Tariffs in Sage 100
  • Featured Consultant: Cindy Whitlock – Sage 100 Business Analyst/Consultant
  • Sage 100 Support

    Helpdesk:
    P: 888.494.9479
    E: helpdesk@netatwork.com

    Ready to Upgrade Your
    Sage 100?
    Fill out this form and get your free quote
    Request Upgrade Quote

    Request Sage 100
    Consulting Services

    Get Help From Our Sage 100 Consultants
    Request Services

    Sage 100 Live Webinars

    Journey to Next Generation Financial Management with Sage Intacct
    March 15 | 2pm ET
    Register Here

    Recruiting & Quiet Hiring: What Quiet Quitting / Hiring Means for 2023 & How Technology Can Help
    March 28 | 2pm ET
    Register Here

    Tips for Sage Users to Improve Data-Driven Decision-Making
    March 28 | 2pm ET
    Register Here

    Popular Recorded Webinars

    Sage Cloud Hosting: Moving On-Premise Sage 100 to the Cloud

    Reducing Manual Tasks in Your Sage Accounting & Shipping Processes

    From Pain to Gain: How to Best Approach Your Sage 100 ERP

    Go Digital with DocLink Paperless PLUS for Sage 100

    Building a Sustainable Digital Manufacturing Business

    Sage 100 – Live Online Training Courses

    Wide range of class topics! Browse the course calendar & register.

    Sage 100 Webinar Archive

    View our library of on-demand recorded webinars.

    Refer a friend, get a $100 Gift Card!

    Submit a Referral / Learn More!
    Do you have a friend or colleague whose company might benefit from utilizing a Net at Work service or solution? If so, refer them to us below and receive a $100 gift card or donation to your charity of choice!

    Connect With Us

    Business Applications

    • Overview
    • ERP/Accounting
    • Cloud ERP
    • CRM
    • Employer Solutions
    • ECM
    • Nonprofit Solutions

    Learning Center

    • White Papers & Guides
    • Ebooks
    • Training Courses
    • Virtual Training Courses
    • Success Stories
    • Live Webinars
    • Recorded Webinars
    • Trials

    Infrastructure Solutions

    • Overview
    • Solutions
    • Managed IT Services
    • Fractional CIO & Advisory Services
    • Cloud Services
    • Cloud at Work
    • Compliance & Security
    • DR/Business Continuity

    Support

    • Application Remote Support
    • Infrastructure Remote Support
    • Sage HRMS Remote Support
    • General Inquiry
    • Helpdesk

    Web Development

    • Services Overview
    • Magento eCommerce
    • WordPress CMS
    • Systems Integration
    • Website Managed Services
    • ERP eCommerce Integration

    Company Information

    • Why Us
    • Alliance Partnership Program
    • Women at Work
    • Diversity and Inclusion
    • Partners
    • Careers
    • News
    • Blog
    • Privacy Policy
    • Contact Us

    Additional Solutions

    • Enterprise Business Intelligence
    • Avalara Automated Tax Solutions
    • Fortis Payments
    • LeaseQuery Lease Accounting
    • Sage Fixed Assets (Sage FAS)
    • Vertex SMB Sales and Use Tax

    Industries

    • Healthcare
    • Chemicals
    • Food & Beverage
    • Medical Devices
    • Nonprofit
    Net at Work
    Net at Work (HQ)
    575 8th Ave
    New York, NY 10018

    P: (800) 719-3307
    info@netatwork.com
    Locations Across North America »
    Visit our sister companies:
    Cloud at Work - Sage Application Hosting
    Pixafy - An eCommerce Agency
    Docutrend
    WordPress Image Lightbox Plugin