This seems to be an older post, but I'm running into the same problem. I've tried the posted soultion with &_KS=99 and it tells me that the Attachment Record cannot be found.
I am doing comments to PO. I did find if I used getattachrec using &_KS=zz, then it did work, however when I try to update using writeattachrec and the same value, it returns a message that it has been updated, but it does nothing.
This is my getattachrec that returns true (where comment type is either "HISTORY" or "PHYS DESC"):
var vCompany = lawForm.getDataValue("PCR-COMPANY"); var vPONumber = lawForm.getDataValue("PCR-PO-NUMBER"); var vPORelease = lawForm.getDataValue("PCR-PO-RELEASE"); var vPOCode = lawForm.getDataValue("PCR-PO-CODE"); //code for getattachrec.exe var s = "/cgi-lawson/getattachrec.exe"; s += "?_OUT=XML"; s += "&_PDL=" + strPDL; s += "&_FN=POLINE"; s += "&_IN=PLISET1"; s += "&K1=" + vCompany; s += "&K2=" + vPONumber; s += "&K3=" + vPORelease; s += "&K4=" + vPOCode; s += "&K5=" + vPOLine; s += "&_ATYP=C"; s += "&_AUDT=O"; s += "&_KS=zz"; s += "&_OPM=A"; s += "&_DATA=TRUE"; s += "&_ECODE=FALSE"; s += "&_ATTR=TRUE"; s += "&_AOBJ=TRUE"; s += "&_AESC=IE"; s += "&_ANAM=" + commentType;
My writeattachrec is as follows:
var vCommentAttach = "/cgi-lawson/writeattach.exe?_OUT=XML&_PDL=" + strPDL vCommentAttach += "&_FN=POLINE&_IN=PLISET1" vCommentAttach += "&K1=" + vCompany vCommentAttach += "&K2=" + vPONumber vCommentAttach += "&K3=" + vPORelease vCommentAttach += "&K4=" + vPOCode vCommentAttach += "&K5=" + vPOLine vCommentAttach += "&_ATYP=C&_AUDT=O" vCommentAttach += "&_ATTR=TRUE"; vCommentAttach += "&_AOBJ=TRUE"; vCommentAttach += "&_AESC=IE" if (commentExists(vPOLine,"HISTORY")) { // change if it exists vCommentAttach += "&_KS=zz" } else { // add if it does not exist vCommentAttach += "&_USCH=none" } vCommentAttach += "&_DATA=TRUE&_OPM=M&_ECODE=FALSE" vCommentAttach += "&_ANAM=" + "HISTORY" vCommentAttach += "&_ATXT=" + vHistoryComment
Is there documentation on what all these parameters mean? I've searched the support site, this site, and the web without much luck. Any help would be appreciated.
Thanks,
Randall