Sage MAS 90 and 200 Sage MAS 500 blogs Product Feedback Support Training

MAS 500 Best Coding Practices

by Sage Employee on 04-02-2009 06:23 PM - last edited on 04-03-2009 11:54 AM by JG

In MAS 500 R&D we continually perform code reviews for internal as well as external developers.  We ran across a few common themes recently that I thought would be helpful to share with those of you integrating or customizing MAS 500.   Several of these topics are explained in more detail in our SDK documentation.  Here are our recent top 10 best practices for well performing and well mannered, multi-user MAS 500 code:

 

1) Respect UpdateDate, UpdateUser, and UpdateCounter when updating MAS 500 tables. The UpdateCounter column is used for optimistic concurrency.

 

2) Respect application logical locks; for details see stored procedures like 'sp%logical%‘.

 

3) Do not use implicit transactions.

  • Manage your database transactions and keep them small with no user interaction including error conditions.

 

4) Connections from the client should support application roles and not use connection pooling.

 

5) Connections from a middle-tier do not need to support application roles.

  • However, auditing will not reflect the actual user.

 

6) Test your application for simple multi-user using optimistic concurrency.

 

7) Test your application using LUA/UAC.

  • Create a local user in the windows user group and test the application.
  • You should not need to be a user in the administrators group to run your application
  • This is very important for Terminal Services/Citrix support.
  • Test your application with a MAS 500 user other than admin and consider also testing with domain user accounts.

 

8) Default connection isolation is read committed; consider using (nolock) query hint to avoid unnecessary shared locks when possible.

 

9) Crystal report performance is critical, it can affect the entire system not just the user running the report.

  • Avoid queries directly to base tables, for example timInventory.
  • Crystal has no native way to send a (nolock) query hint.
  • Create a view and add the (nolock) hint to the base tables in the view
  • Avoid subreports, most cases the constraint can't be passed as the where clause of the subreport query.
  • Utility to fix up database names PrestoCrystalDatabase.exe.

 

10) Test, Test, Test

Message Edited by JG on 04-03-2009 11:54 AM

Comments
by Sage Employee on 04-02-2009 06:44 PM

Sorry, my first post is formatted so poorly. 

We'll try to get it corrected.

by LouDavis Sage MAS Partner on 04-08-2009 07:55 AM
I would also add where ever possible to limit the 'chatter' between the client and the server to alleviate network traffic and improve performance a bit.
by kabin01 on 12-01-2010 11:06 PM
The unique sole design creates bigger demands on your body, Air max 2009,authentic nfl jerseys,wholesale sunglasses ,rolex watches ,kobe bryant shoes .so even walking around the block is a workout. For more serious athletes, the same principle applies, and the benefits of any training session are increased.
About the Author