It's Beginning to Look a lot Like Christmas

Christmas Lights

I’ve always loved Christmas Lights, but some people go overboard.

M2M can’t be decorated like that, but you can add a touch of holiday spirit. Follow the directions below and you can have your active cell indicator switch daily from green to red, the colors of Christmas.



Want to try it? Simply follow these steps:

  1. Download this Zip file and unzip it. Essentially the colors.prg will change the color of the active control on M2M screens for every user. It flips them back and forth between red and green if run in the month of December. If run in any other month, it changes the color back to the default yellow.
  2. You should try any code first on your test server. Now is a good time for the disclaimer:

    Important: All information on this site is provided “as is” for informational purposes only.
    In particular, all code samples are provided “as is” without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

    If you should decide to use any of the code from this site, make sure you test it thoroughly on a test company (or better yet a test server) before you ever use it on your live data.

  3. Copy the Visual FoxPro program files colors.prg and colors.FXP to your report program file directory. For example, mine is L:\M2MData\Reports\Prgs.
  4. Next we have to create a “blank” report in Made2Manage. Open the RPMAKE screen, the simplest way to do so is to click Transfer and quickly type RPMAKE and then enter.
  5. Click Add, enter a report ID such as “Colors” and a description such as “Holiday Colors.”
  6. Add a “Default Data Source” by clicking Browse and navigating to colors.prg and then save the report.
  7. Color Screen

  8. Click on the Selections tab and click Add. Enter anything at all for selection name such as “Trash”. M2M reports will not run without a selection, but it doesn’t need to be valid.
  9. Color Screen

  10. As a test, open the report you created by clicking Transfer and then COLORS and run the report. Since the report isn’t printable, you will get the following screen.
  11. Color Screen

  12. Click OK to close, exit Made2Manage, and log back in to re-set your settings.
  13. Open any form you normally would such as the Sales Order (SO) screen and click modify. The background of the control will now be light red. If you run the report and re-start M2M again, your highlighted control will be green.
  14. How can you make the colors automatically switch every day for the month of December? Follow the instructions found in my Command Scheduler article to run this report each night.
  15. When adding to Command Scheduler do not forget to set the frequency to “Daily.”
  16. Color Screen

Besides being fun and festive for the holiday season, this type of customization can have a practical use as well. For example, one of the companies I work with doesn’t use calendar months but instead uses a system they call Red Fridays. The Red Fridays are determined before the year begins and each month ends with one. These can be found on the Accounting Years screen (AYRS). Anyway, I’ll adapt the code to change the background color to red on the last day of the period by querying the GLRULE table, and default it to yellow for the rest of the month.

Incidentally, if you decide you want to change your users default color back to yellow, simply substitute the yellow.prg and yellow.fxp files (after copying them to your report prgs folder) in your Holiday Colors report and run it. This will return everyone back to normal.

A big thank you goes to Ray at NightScaping for his help with the VFP code.

So, what do you folks think?

3 comments to It’s Beginning to Look a lot Like Christmas

Leave a Reply




You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>