Sage 100 and Sage 500 ERP – Tips, Tricks and Components
Greytrix is one of the oldest Sage Development Partner of two decades and provides quality services for Sage 100 (formerly known as Sage MAS 90) and Sage 500 (formerly known as Sage MAS 500) ERP. Greytrix have been awarded "Sage Development Partner of the Year" a couple of times. Greytrix has been working on customization, integration, migration and products development in Sage 100 and Sage 500 ERP since decades and have accumulated hundreds of man years of experience. In these blogs, Greytrix will endeavour to share its accumulated treasure of knowledge regarding Sage 100 and Sage 500 product lines. Contact us for more info at sage@greytrix.com
Follow us on LinkedIn Follow us on Twitter Follow us on Facebook Follow us on YouTube
Skip to content
  • Home

Auto Execution of MAS 500 tasks

By greysagemas | January 23, 2009
0 Comment

Here’s a very useful piece of code you can use to run a MAS 500 task without having to login manually or open the MAS 500 desktop.

Suppose you have an import task in MAS 500 which has to be executed everyday. So usually the user would have to login to MAS 500 everyday and manually run the task. This can be very arduous. If you had a utility which you can simply schedule using windows scheduler to run the MAS 500 task everyday, it would save a lot of manual labor. And that’s exactly what the following piece of information will help you with.

The following code has been done in VB.Net. You will need Visual Studio to proceed further. You will need Visual Studio 2003 for MAS 500 version 7.00 and Visual Studio 2005 for MAS 500 versions 7.05 & 7.2.

Open a new windows application project in Visual Studio.

You will need to add the following references to the project:

  • Accounting.Framework.Common
  • Accounting.Framework.ObjectManager

The above DLL’s can be found at ‘Program FilesSage SoftwareSage MAS 500 ClientManaged ApplicationsFramework’.

As shown in the code given below the steps to follow are:

  1. Create an ObjectManagerWrapper object.
  2. To login to Mas 500, pass required parameters to the Login function of the ObjectManagerWrapper object. The parameters are Server name, System database name, Application database name, Trusted Connection, User name, Password, CompanyID, Language ID and Login Option.
  3. The Login function returns a boolean value. If the boolean value returned is true, we shall go ahead with running/executing the MAS 500 task.
  4. Run the MAS 500 task by calling the ‘LaunchTask’ method of the OjectManagerWrapper object. You need to pass the Task ID of the MAS 500 task as an integer parameter.
  5. Once the task is run we can logout of MAS 500 using the Logout method of the ObjectManagerWrapper object.Dim _ObjMgrWpr As ObjectManagerWrapper‘Create object
    _ObjMgrWpr = New ObjectManagerWrapper’Login to MAS 500
    lbln_Login = _ObjMgrWpr.Login(pstr_ServerName, pstr_DBName, pstr_DBName, False, pstr_UserName, pstr_Password, pstr_CompanyID, 1033, Constants.LoginOption.ChangeAll)

    ‘Check if login was successful
    If lbln_Login = True Then

    ‘Launch MAS 500 task
    _ObjMgrWpr.LaunchTask(100000000)

    ‘Log out of MAS 500
    _ObjMgrWpr.Logout()

    Else
    ‘If login was unsuccessful, log error
    End If

     

For any queries, feel free to contact us at sage@greytrix.com.

About Us
Greytrix is a one stop solution provider for Sage ERP and Sage CRM needs. We provide complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third party add-on development and implementation expertise.

Greytrix has some unique solutions of Sage 100 integration with Sage CRM, and Salesforce.com along with Sage 100 Migration from Sage 50 US, Sage Intacct, QuickBooks, Sage Business Vision and Sage Business Works. We also offer best-in-class Sage 100 customization and development services to Sage business partners, end users, and Sage PSG worldwide.

For more details on Sage 100 Services, please contact us at sage@greytrix.com. We will be glad to assist you.

Category: MAS 500 Login Tips Tags: Auto Execution of MAS 500, Sage 500 ERP, Sage 500 technical blogs
Post navigation
← MAS 500 Data Export Copy Project Estimates in Sage 100 →

Greytrix Websites and Blogs

  • Greytrix
  • Sage X3 – Tips and Tricks and Components
  • Sage 300 – Tips, Tricks and Components
  • Sage CRM – Tips, Tricks and Components
  • Salesforce.com Tips and Tricks by Greytrix
  • Sage Intacct – Tips, Tricks and Components
sage enterprise management services

Recent Posts

  • Maintain Vendor Classes in Sage 500
  • Maintain Vendor Addresses in Sage 500
  • How to Set Up Payment Methods in Sage 500
  • How to merge AP vendors in Sage 500
  • Maintain Recurring Vouchers in Sage 500

Archives

Awards

Greytrix Top ISV Partner
Greytrix Revenue Growth Enterprise Business
Greytrix Africa Highest Revenue
Greytrix Prtner of the Year
Greytrix Partner Award
Copyright 2022
Sage 100 and Sage 500 ERP – Tips, Tricks and Components
Iconic One Theme | Powered by Wordpress