DME call and Javascript

 11 Replies
 1 Subscribed to this topic
 17 Subscribed to this forum
Sort:
Author
Messages
mikeP
Veteran Member Send Private Message
Posts: 151
Veteran Member

I’ve trying to create a mobile inbasket display exec html file using the example provided by Lawson.  The example displays requisitions, I want to display purchase orders.

 

We’re on environment 9.0.12.

 

The example has a function that makes a DME call to retrieve a requisition header, a second function that retrieves requisition lines, and a third that constructs html code using data retrieved in the first two functions, and writes it using mainFrame1.document.write().

 

The example as it was delivered displays requisitions properly, but I’m having problems with my purchase order version: I don’t see how the program flow works.

 

The first function in the example, GetReqHdrInfo(), looks like this:

 

    logancall.out = "JAVASCRIPT"

    logancall.field ="item;description;quantity;entered-uom;unit-cost"

    logancall.index = "rlnset1"

    logancall.max = "250"

    logancall.xida = true

    logancall.key   =   m_Company + "=" +  m_ReqNumber

    logancall.func = "displayRecSum()"

    DME(logancall, "REQLINE")

}

 

From what I can see, the only way the second function , displayRecSum(), is ever called is by its presence as the “func” parameter in GetReqHdrInfo.  However, in my code, the corresponding displayPoSum() is never called.  (I use multiple document.write statements to trace the program flow.)

 

First point of confusion is this statement in the documentation, Doc for Developers: IOSApplication ProgramInterfaces—Windows:

 

“Release 8.0 supported the following values for calls to DME which are no longer in 9.0.x calls to Data.”, and it goes on to list several values, including “.FUNC” .

 

I’ve also read that “OUT=Javascript” is no longer used in at least one post here are the forum.  So for starters, it appears that the provided example is using obsolete syntax. 

 

The real problem is that my .func displayPoSum() is not called.

 

Does anyone have any advice on how to go about debugging this issue?

 

 

 

Judy Consoli
Veteran Member Send Private Message
Posts: 43
Veteran Member
The ReqHeader function should call the reqline function the reqline function should be changed to call your po function and then your po function should call the display RecSum.
mikeP
Veteran Member Send Private Message
Posts: 151
Veteran Member

Thanks Judy. That's essentially how I've written it.

The issue is that it never "returns" from the first DME call.  I have document.write statements before and after the call, as well as in my GetPoDtlInfo function.  It never gets to the GetPoDtlInfo function, or the line immediately after the DME call.

Judy Consoli
Veteran Member Send Private Message
Posts: 43
Veteran Member

Can you send me your code.  I did basically the same thing.

 

judyconsoli@Carolina.rr.com

Judy Consoli
Veteran Member Send Private Message
Posts: 43
Veteran Member
also - do you have fiddler installed on your desktop and if so have you turned it on to see the calls?
mikeP
Veteran Member Send Private Message
Posts: 151
Veteran Member
I have Fiddler. I was hoping that I could trap the DME call and paste it into the IE address box, but everything I've tried results in an XML file being displayed IN IE. I'll send an example to your email.
John Henley
Send Private Message
Posts: 3351
Not sure if this makes sense or not, but you have to take the XML and put it into a payload and then in Fiddler use HTTP POST rather than HTTP GET. Otherwise you have to translate all of the XML into URL query parameters and create a long URL...
Thanks for using the LawsonGuru.com forums!
John
mikeP
Veteran Member Send Private Message
Posts: 151
Veteran Member
John, I suspected there must be a way to display the XML. I've not worked with design studio or portal pages. Can you point me to a post or other write up of how to put it in a payload? Thanks.
John Henley
Send Private Message
Posts: 3351
Sorry, I misread your previous post. I thought you were referring to Transaction/AGS. For Data/DME, you can just look for in fiddler for URLs starting with /servlet/Router/Data Data/DME queries are passed as part of the URL via HTTP GET.
Thanks for using the LawsonGuru.com forums!
John
mikeP
Veteran Member Send Private Message
Posts: 151
Veteran Member
I can locate the URLs in Fiddler, but when I copy and paste them into the IE address box, I get a nice XML file displayed in the browser.
John Henley
Send Private Message
Posts: 3351
Add &OUT=CSV to the URL to get CSV Add &OUT=CSV&DELIM=~ to URL to get tilde-delimited
Thanks for using the LawsonGuru.com forums!
John
mikeP
Veteran Member Send Private Message
Posts: 151
Veteran Member
John, that is a handy tip. I didn't realize my data was buried in the XML until I saw the CSV. Judy pointed me in the right direction: I had not renamed the frame names to match the PURCHORDER and POLINE tables. I can move on to working with the output functions now. Thanks to you both. M .