Copy attachment from Requisition to PO

 1 Replies
 1 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
Derek Czarny
Veteran Member Send Private Message
Posts: 63
Veteran Member
We have created a Capital Purchase processflow that allows managers and directors to submit their capital requests in RSS.  They can attach their electronic quotes by using the comments tab in RSS and attach a URL to the requisition button.  That works fine and I can retrieve the attachment in the inbasket.  The question I have, or what I am trying to do is copy that link from the requisition and attaching it to the  PO.  I have the webrun that will retrieve the attachment from the requisition, but how do I use that to writeattach to the PO?
Derek Czarny
Veteran Member Send Private Message
Posts: 63
Veteran Member

I have solved this problem for our needs.  Basically I queried for the attachment path from the requisition, parsed out the path, then added the path as a new attachment on the PO.  If someone has an easire way of doing this, I would still be interested.

Requisition Attachment Query using getattachrec:
&_OUT=XML&_PDL=&_FN=REQHEADER&_IN=RQHSET1&K1=&K2=&_ATYP=U&_AUDT=I&_USCH=http&_OPM=T&_DATA=TRUE&_ECODE=FALSE

Assign node for parsing.  If the link exists, I also wanted to include it in a link in the email:

var Attachback = RQCheckAttach_result;
var D = Attachback.indexOf("AttData")
var F = Attachback.indexOf("/AttData")
var myAttach = Attachback.substr(D+18,F-D-23);
var myAttach = escape(myAttach);
var myAttach = myAttach.replace(/%5C/g,"%5C");
//Set for input button
//var myAttach = "'" + unescape(myAttach) + "'" ;
var myAttach = unescape(myAttach);
var vresults = myAttach.length

if (vresults >= 1)
{var vEmailAttach = '

Click here to see attached quote

'}
//{var vEmailAttach = '[script removed] else
{var vEmailAttach = ''}

Added attachment in PO using writeattach:

&_OUT=XML&_ATXT=&_ANAM=QUOTE&_PDL=&_FN=PURCHORDER&_IN=PCRSET1&K1=&K2=&K3=&K4=&_ATYP=U&_AUDT=I&_USCH=http&_OPM=M&_DATA=TRUE&_ATTR=TRUE&_AOBJ=TRUE&_ECODE=FALSE