Using Lawson's getattachrec.exe CGI to retrieve your comments

This sample is pulling the display only comments from the PO Header when a button is clicked and alert it.

function BUTTON_OnClick(id, row)
{
if (id!="push10") return true;
{
var vProd = portalWnd.oUserProfile.getAttribute("productline");
s = "/cgi-lawson/getattachrec.exe?_OUT=XML&_PDL=" + vProd;
s += "&_FN=PURCHORDER&_IN=PCRSET1&K1=1"; //Company
s += "&K2=" + lawForm.getFormValue("text6"); //PO Code
s += "&K3=" + lawForm.getFormValue("text4"); //PO Number
s += "&K4=" + lawForm.getFormValue("text5"); //PO Release
s += "&_ATYP=C&_AUDT=O&_OPM=C&_DATA=TRUE&_ECODE=FALSE";
var getCmnt = portalWnd.httpRequest(s);
var Cmntback = getCmnt.xml;
//Manipulate the data you receive back in order pull the actual comment out.
var B = Cmntback.indexOf("AttData")
var E = Cmntback .indexOf("/AttData")
var myComment = Cmntback.substr(B+23,E-B-32)
alert(myComment);
}
return;
}

I had previously listed the PO Header Comment Types and thought this might be useful.
Requisition Header Comment Types
I - Comments to Print on Headers of Internal Documents
Q - Comments to Print on Requisitions
P - Comments to Print on Purchase Orders
T - Comments to Print on a PO as Trailer Comments
L - Comments to Print on Pick Lists
R - Comments to Print on Receiving Documents
O - Requisition Header Display Only Comments
B - Bill to Address Comments
D - Comments to Print on Delivery Tickets