The LawsonGuru Letter, brought to you by Decision Analytics  
   

September 2006

)
       
 

Click here to forward to a colleague

   
       
 
summer As another summer draws to a close, enjoy these tips & tricks. You can view other Tips & Tricks on the Tips & Tricks page on LawsonGuru.com.  Remember to share your tips. Send them to mailto:letter-tips@lawsonguru.com.

I'll be back soon with a great new issue! 
 

The LawsonGuru Letter is a free periodic newsletter providing provocative commentary on issues important to the Lawson Software community.  The LawsonGuru Letter is published by—and is solely the opinion of—John Henley of Decision Analytics.

Visit Decision Analytics at https://www.danalytics.com. For subscription information, see the bottom of this message.  The LawsonGuru Letter is not affiliated with Lawson Software.

 

In this issue:
Tip 1: Lawson Design Studio version of JavaScript locale-independent Date() Function
Tip 2: Display your current Product Line in Lawson Portal
Tip 3: Printing "This Group Continued on next Page" in Crystal Reports
Tip 4: Using the "Default Function" in Portal 9.0
and...Worthwhile Reading

 
   
       
  Tip 1: Lawson Design Studio version of JavaScript locale-independent Date() Function )  
       
  The past couple of months (see https://www.danalytics.com/guru/letter/archive/2006-07.htm and https://www.danalytics.com/guru/letter/archive/2006-08.htm), we’ve looked at JavaScript code to convert a date value in a string variable in ProcessFlow.

To review, I told you it would only work with locales that enter dates in MM/DD/CCYY formats, since the code was looking in specific locations for the various parts of the date:

RQDELDT = RQDATE.charAt(6) + RQDATE.charAt(7) + RQDATE.charAt(8) + RQDATE.charAt(9) + RQDATE.charAt(0) + RQDATE.charAt(1) + RQDATE.charAt(3) + RQDATE.charAt(4)

This time, let’s look at it from the perspective of Lawson Design Studio, where JavaScript might be used to perform various date reasonableness edits, and would fail if the date was not entered in MM/DD/CCYY format--which is true for UK users, who enter the date DD/MM/CCYY. In Design Studio, when you have a date entered in a textbox in the user's locale-based format, and you want to use it in JavaScript to compare to other dates, it needs to be assigned to a Date JavaScript object.

After searching high and low to devise a solution that used some browser property to return the user’s locale, and therefore the date format, I realized the answer was not to use the browser, but to use Lawson! Unlike ProcessFlow, where you have to make a DME call to figure out a user’s Locale, and therefore their date format preferences, Lawson delivers a "portalObj" JavaScript object as part of Lawson Portal/Design Studio. And portalObj has a method called getUserVariable, which can be used to retrieve two locale-specific date-related settings for the user: DATEFMTSTR and DATESEP.

I wrapped it all into a function, called UserLocaleDateFormatToDate, which is passed a date string in the user's locale-based format and returns a JavaScript Date object:
 
function UserLocaleDateFormatToDate(date_string)
// returns date entered in user's locale format as a date object
{
    var return_date = new Date();
    var date_pieces = date_string.split(portalObj.getUserVariable("DATESEP"));

    switch(portalObj.getUserVariable("DATEFMTSTR")) {
        case "YYMMDD":
            return_date.setFullYear(date_pieces[0]);
            return_date.setMonth(date_pieces[1] - 1); // note JavaScript months are 0-11
            return_date.setDate(date_pieces[2]);
            break
        case "MMDDYY":
            return_date.setFullYear(date_pieces[2]);
            return_date.setMonth(date_pieces[0] - 1); // note JavaScript months are 0-11
            return_date.setDate(date_pieces[1]);
            break
        case "DDMMYY":
            return_date.setFullYear(date_pieces[2]);
            return_date.setMonth(date_pieces[1] - 1); // note JavaScript months are 0-11
            return_date.setDate(date_pieces[0]);
            break
        default:
            return_date = new Date(date_string);
            break
    }
    return return_date;
}
 

Then, in the calling code, instead of:
     var dPostDate = new Date(sPostingDate)

I now call this:
        var dPostDate = UserLocaleDateFormatToDate(sPostingDate)

   
       
  Tip 2: Display your current Product Line in Lawson Portal )  
       
  If you work in multiple Lawson product lines, it's often helpful to readily see which one you're currently using. Here's a tip on how to display it in the Lawson Portal banner area.

As delivered, your banner area probably looks like this:

The welcome banner is defined in $WEBDIR/lawson/portal/roles/default.xml, and you can modify the line:

<WELCOME><![CDATA[&&divWel&&, <<DESCRIPTION>>]]></WELCOME>

to include the <<PRODLINE>> tag:

<WELCOME><![CDATA[&&divWel&&, <<DESCRIPTION>> <<PRODLINE>>]]></WELCOME>

Run the IOSCacheRefresh servlet, and then when you relaunch Portal, your new banner will appear:

If you do make this change to your default.xml role definition, be sure to make a backup first, since it will be overwritten by new Lawson deliverables and patches.  Ideally, you should make the change to specific roles files, and assign the PORTALROLE attribute to each user.
 

   
       
  Tip 3: Printing "This Group Continued on next Page" in Crystal Reports )  
       
  (This tip comes from Ken Hamady's Crystal Underground newsletter.)

You may find several other ways to do this, but this one works in almost all situations.

It uses 3 formulas, and these can be cut and pasted into your report:
 

//This formula goes on the Group Header
WhilePrintingRecords;
BooleanVar Continued:= True


//This formula goes on the Group Footer WhilePrintingRecords;
BooleanVar Continued:= False


//This formula goes on the Page Footer WhilePrintingRecords;
BooleanVar Continued;
if Continued
    then "Continued on next page"
    else ""
   
       
  Tip 4: Using the "Default Function" in Portal 9.0 )  
       
  One of my favorite LID features was the ability to set a “default function” and then press the Enter key without having to click on a function button:


As you’ve probably heard, Lawson 9.0 makes the Portal more “LID-like” and Portal 9.0 now includes this functionality:


By default, the “default function” Portal hotkey is mapped to F12:


 

   
       
       
 
 
I'd like to introduce you to The MEDITECH Community Bulletin, published by Donna Carroll of Systems Personnel, a professional search firm specializing in the nationwide search and placement of Healthcare Management and Information Technology professionals. 

The MEDITECH Community Bulletin is a periodic newsletter covering a broad range of topics that are relevant to the MEDITECH community. 
 
Read the latest issue: http://www.carrollsearch.com/newsletter/MCBAugSep2006Web.htm
Subscribe: http://www.carrollsearch.com/meditech.asp
 
 
   
       
  Worthwhile Reading )  
       
  XBR-What?
Even as SEC chairman Cox champions "interactive data," few CFOs seem impressed.
Is that because too few of the benefits accrue to them?
CFO Magazine, August 2006
http://www.cfo.com/article.cfm/7239661/c_7242823

ERP Gets A Complete Makeover
Three major business-application vendors are in the midst of development projects to rewrite their software suites. Given the problems of the past, the improvements need to be more than skin deep.
Information Week, July 24, 2006
http://www.informationweek.com/story/showArticle.jhtml?articleID=190900779

The Truth About SOA
In which we pour some cold water on the hype and answer your questions about why, how and when you should (or should not) start thinking about implementing a service-oriented architecture.
CIO Magazine, June 15, 2006
http://www.cio.com/archive/061506/soa.html

Procurement Fraud: How Tech Insiders Cheat Their Employers
Using "shadow companies" with puppet CEOs and inflated or bogus invoices, a number of I.T. managers stand accused of ripping off their employers—in some instances, for tens of millions of dollars or more. The scam? It's called procurement fraud, and it may be more prevalent than many people realize.
Baseline Magazine, June 2006
http://www.baselinemag.com/article2/0,1540,1972062,00.asp
   
       
     
Please share The LawsonGuru Letter in whole or in part as long as copyright and attribution are always included.
 

Decision Analytics is an independent consultancy, focusing on Lawson technical projects, and specializing in reporting, customization/modification, data conversion, and integration/interfaces. Please visit https://www.danalytics.com for more information.