PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 10/3/2011 1:14 PM by  John Henley
Inquire when Hidden Key does NOT contain all necessary values
 4 Replies
Sort:
You are not authorized to post a reply.
Author Messages
Craig Derksen
Private
Private
Basic Member
(32 points)
Basic Member
Posts:14


Send Message:

--
9/21/2011 7:43 PM
    A couple of years ago, I had the task of setting up some shortcuts that inquired on the HR11 while passing default values. These queries worked just fine and were variations of this:

    domain/lawson/portal/index.htm?_PDL=SYSINT2&_TKN=HR11.1&_HK=4321000001000

    Now, fast forward a couple of years and the requirements have changed slightly to include additional forms. The first one on my list has set the tone for all the rest... The LP51. In examining the field definitions on this portal form, the _HK value is defined as 13 characters and is made up of LEL-COMPANY (4) and LEL-EMPLOYEE (9). The problem is that there are two more fields that are required in order to successfully inquire, LEL-SEQ-NBR (4) and LEL-HRH-OBJ-ID (12). When I populate those values, I can successfully execute an AGS call but no matter what I try, I cannot seem to get these values to populate when using the index.htm call. The funny part is that when I pass the OBJ-ID value in the _HK string, it appears in the return XML when viewed in Fiddler. I could not figure out what the lucky combination was to get the SEQ-NBR to embed.

    What I am asking, is there any way to pull up a form (without the user performing data entry) that retrieves values when the Hidden Key is defined smaller than will contain the required key values? I have seen an older posting that pretty much says "you're out of luck" but I was hoping that someone may have run into this and come up with a solution or knows a consultant who could. My background isn't heavy in Java or web programming but it would seem like the AGS calls that actually return values could be formatted using stylesheets and/or JavaScript files that make use of existing Lawson functions. Does anyone have any feedback or guidance that I could use to help the project team make an informed decision on what our options are in case user requirements are inflexible?

    Thanks!

    Craig
    Shane Jones
    Private
    Private
    Veteran Member
    (1246 points)
    Veteran Member
    Posts:460


    Send Message:

    --
    10/2/2011 1:44 AM
    I would think that if Lawson required information to perform an inquire you would not be able to get around that... If you find a way share it because other might have a use for it.

    I provide links to pre-populated forms in emails created by processflow but I always make sure I have all of the required fields included in my link. If you have process flow you could use the "Insert Form URL" button in the email node to create a fully functional link... (I do not have LP51 or I would look at it for you.)
    Shane Jones
    Tools: HR, Payroll, Benefits, PFI, Smart Office, BSI, Portal and Self-Service
    Systems: Lawson, Open Hire, Kronos, Crystal Reporting, SumTotal Learning
    ** Teach others to fish...
    Craig Derksen
    Private
    Private
    Basic Member
    (32 points)
    Basic Member
    Posts:14


    Send Message:

    --
    10/3/2011 12:20 PM
    What we wound up doing was more closely examining the business requirements for performing these inquires. It turns out that only two forms out of the 19 requested were "deal breakers" if we couldn't perform this special lookup. Since there were only 2 forms, we opted to use Design Studio to create custom forms. They use similar logic but here is the logic:

    URL:
    domain/lawson/portal/index.htm?_PDL=STAGING&_TKN=LP51.1&_ID=LP51.1_CUSTOM&LEL-COMPANY=0001&LEL-EMPLOYEE=000000000&LEL-SEQ-NBR=0004

    Logic from Design Studio Form:

    function FORM_OnInit()
    {
        /*
        Required Fields (as retrieved from Fiddler):
            _f2        LEL-COMPANY    sz=4
            _f4        LEL-EMPLOYEE   sz=9
            _f7        LEL-SEQ-NBR    sz=4
        */
        var argCompany  = portalWnd.getVarFromString("LEL-COMPANY",  portalWnd.document.location);
        var argEmployee = portalWnd.getVarFromString("LEL-EMPLOYEE", portalWnd.document.location);
        var argSeqNum   = portalWnd.getVarFromString("LEL-SEQ-NBR",  portalWnd.document.location);
        //
        if (argCompany != "" && argEmployee != "" &&  argSeqNum != "")
        {
            lawForm.setDataValue("LEL-COMPANY", argCompany);
            lawForm.setDataValue("LEL-EMPLOYEE", argEmployee);
            lawForm.setDataValue("LEL-SEQ-NBR", argSeqNum);
            //
            lawformDoFunction("I");
        }
    Craig Derksen
    Private
    Private
    Basic Member
    (32 points)
    Basic Member
    Posts:14


    Send Message:

    --
    10/3/2011 12:26 PM
    Please note that the code above came over kind of wacky. In the "if" block, the Javascript "ands" were escaped instead of literals. I apologize if this is beating people over the head with the obvious but I know how tempting it can be to Copy and Paste...

    Thanks for your advice!
    John Henley
    Private
    Private
    Senior Member
    (9893 points)
    Senior Member
    Posts:3315


    Send Message:

    --
    10/3/2011 1:14 PM
    Posted By Craig Derksen on 10/03/2011 08:26 AM
    Please note that the code above came over kind of wacky. In the "if" block, the Javascript "ands" were escaped instead of literals. I apologize if this is beating people over the head with the obvious but I know how tempting it can be to Copy and Paste...

    Thanks for your advice!

    Craig, I cleaned that up ...
    Thanks for using the LawsonGuru.com forums!
    John
    You are not authorized to post a reply.