cancel
Showing results for 
Search instead for 
Did you mean: 

Check if there is an attachment on RFX Response

0 Kudos

Hi

Please assist. I need to write a script that checks if there is an attachment before moving the status to "Firm". Please see attached picture

If attachment does not exist, I will throw this message : throw doc.createApplicationException("session","Please Attach File");

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi

I have actually written the script already, but the problem is the script is executed whenever a change is made to the document. I want it to execute only when the status is changed to "Firm".

Below is my script:

import java.util.*;

import com.sap.eso.api.rfx.*;

import com.sap.odp.api.common.platform.IapiDbHandlelfc;

import com.sap.odp.api.doccommon.masterdata.*;

import com.sap.odp.api.comp.messaging.*;

import com.sap.odp.common.types.Attachment;

ApplicationException ae = new ApplicationException(session);

attach = doc.getAttachments();

if(attach.size() == 0)

{

throw doc.createApplicationException("session","Please Attach File");

}