on 06-06-2011 4:35 PM
Hi
We have a requrement for changing the default drop-down value.
After going into Rfx attachment -> Attach File , the visiblity drop-down is showing as "Buy Side " , "Buy side and Sell Side Only " .
By default , the option "Buy side Only " is appearing in the drop-down list. I need the value "Buy side and Sell Side " to be appeared as default option in the drop-down list .
Pls help
Regards
Sudipta
Hi Sudipta,
Unfortunately, it's not possible to set a default through configuration. However, you can use scripting to set the visibility depending on what the business requirement is.
Regards,
Vikram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for reply
One more query ..
If I write the script ( suggested by you ) and place it in document life cycle event with target as saved , then all the attachments visibility will be changed to "Buy Side and sell side " while trying to save the Document . But I want the visibility drop-down appear with that option immidiate after any document is attached .
So what could be the possible way ?
Regards
Sudipta
Thanks for your reply..
I am tying the same as suggested by you but getting an error as below -
Sourced file: inline evaluation of: ``import java.io.; import java.text.; import java.util.*; import com.frictionle . . . '' : Class or variable not found: UserVisibilityEnum.BUYSIDE_ONLY
Also giving the whole script . Pls let me know if it has any error
import java.io.*;
import java.text.*;
import java.util.*;
import com.frictionless.api.doccommon.masterdata.VendorIBeanHomeIfc ;
import com.frictionless.api.contracts.ContractIBeanHomeIfc;
import com.frictionless.api.doccommon.masterdata.purchasing.BusinessUnitIBeanHomeIfc;
agreementBean = doc.getRootParentIBean();
contractHome=IBeanHomeLocator.lookup(session,ContractIBeanHomeIfc.sHOME_NAME);
attachments=doc.getAttachments();
collectionsize = attachments.size();
for(i=0;i<collectionsize;i++){
attachment.setAttachmentVisibility(new UserVisibilityEnumType(UserVisibilityEnum.BUYSIDE_ONLY));
}
After adding this line I got this error below-
Sourced file: inline evaluation of: ``import java.io.; import java.text.; import java.util.*; import com.frictionle . . . '' : Class or variable not found: UserVisibilityEnum.BUYSIDE_ONLY
So I guess we need to import some thing else as the current packeages are not able to make UserVisibilityEnum.BUYSIDE_ONLY identify to system.
Regards
Sudipta
Hi Sudipta,
Try this...
import com.sap.odp.api.comp.attachments.AttachmentSubIBeanIfc;
import com.sap.odp.api.common.db.metadata.UserVisibilityEnumType;
attachments = doc.getAttachments().iterator();
while( attachments.hasNext()) {
attachment= (AttachmentSubIBeanIfc) attachments.next();
attachment.setAttachmentVisibility(new UserVisibilityEnumType(1));
}
Regards,
Vikram
Hi Sudipta,
Just adding to the post by Vikram. I belive the package names mentioned in the above snippet are following the package structure for SAP Sourcing 7.0. I think you are using a lower version (probably 5.1). Please be sure to locate the corresponding package structure for your version and then try out the code.
Thanks
Devesh
Yes you are right . We are using version 5.1. Anyway I have sorted the isuue. Package name is different for this version.
Just wanted to ask for one more help.
The script is running fine when I am placing it in "Document life cycle event" in "SAVE" target. But wanted to execute the right at the moment when page is loaded in the following path
Rfx->Click on attachment in the toolbar -> click on attach file button
Here visibility button should appear as "buy side and sell side" as a default option.
Regards
Sudipta
Hi Sudipta
Hope you are doing fine. From what I understand is you want attachment visibility dropdown to appear "Buy Side and Sell Side" instead of "Buy Side" by default before users create any attachment itself.
I am afraid your code would not work as the following lines of code:
attachments = doc.getAttachments().iterator();
while( attachments.hasNext())
would work only when an attachment is added i.e. you click on Create. Otherwise doc.getAttachments() method would return a NULL value.
Correct me if my understanding of the issue is wrong. Otherwise it seems a different approach is required.
Regards
Mudit Saini
Edited by: Mudit_UCB on Jun 16, 2011 12:02 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.