Question

I'm trying to work out why it won't let me attach a file from a specific page in PeopleSoft CRM (it will show an error saying 'The AddAttachment() call failed.') while it does let me from the PeopleTools Test Utilities.

There seems to be a problem with the URL.

Looking at the traces, the lines that caught my attention the most are the following:

  1. Correct trace from the PeopleTools Test Utilities:

22: &RETCODE = AddAttachment(@(&URL_ID), &ATTACHSYSFILENAME, &FILEEXTENSION, &ATTACHUSERFILE, &FILESIZE);

EvalAddAttachment: processed URL catalog entry (on resume).

IsURLValid: masked specified FTP URL = http://localhost:8230/psfiletransfer/demo/crm/

GetLocalFilePath: temporary copy of file is /usrpsoft/demo/appserv/demo/files/psfileproc/A_de22a2f6-ffbf-11e0-8135-c80dfccab65c/borrador.txt
  1. Trace from the pages that returns an error:

24: &RETCODE = AddAttachment(&URL_ID, &ATTACHSYSFILENAME, &FILEEXTENSION, &ATTACHUSERFILE, &FILESIZE);

IsURLValid: masked specified FTP URL = http://localhost:8230/psfiletransfer/demo/crm/

GetLocalFilePath: temporary copy of file is /usrpsoft/demo/appserv/demo/files/psfileproc/A_5da2dbaa-ffab-11e0-8135-c80dfccab65c/borrador.txt

First of all, what does the @ symbol mean in Peoplecode?

In the first trace, it appears right before the URL parameter. I went through the Peoplecode documents and I couldn't find it.

And another thing: the second line of the first trace won't appear in the second trace.

Does anyone know what could be happening?

Thanks!!!

Was it helpful?

Solution

The @ symbol is used to dynamically refer to an object and in this case it is an URL. The key is what is in the string &URL_ID.

If you use @(&URL_ID), then &URL_ID should equal URL.MY_URL. If it is for a record, it would be something like Record.MY_RECORD, e.g. &Rcd = GetRecord(@(&record)); or &Rcd = GetRecord(@("Record."| Record.MY_RECORD)); or &Rcd = GetRecord(@("Record.MY_RECORD"));.

As for this "EvalAddAttachment" I'm not 100% sure. I wouldn't be too worried about it though. Just try to identify what is going into your variable (both the 1st and 2nd example) &URL_ID.

OTHER TIPS

I'd do a trace or throw in a messagebox and see what is being passed to the &url_id. It should be equal to URL.MY_URL as posted above.

If the url format is that, then it has to do with some of your other variables that you are passing into the function.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top