cancel
Showing results for 
Search instead for 
Did you mean: 

Attchment drop-down default option needs to be changed

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

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

Former Member
0 Kudos

Thanks for reply Vikram.

Can you please help me with the code for retrieving the visibility drop-down and set it to "Bye Side and Sell Side " as a default option ?

The visibility drop-down is available in Rfx-> Attachments-> Attch File

Regards

Sudipta

0 Kudos

The logic can be as follows:

doc.getAttachments() should return all attachments on the RFx

Iterate through the list

Set the visibility of the attachment

attachment.setAttachmentVisibility(new UserVisibilityEnumType(UserVisibilityEnum.BUYSIDE_ONLY))

Hope this helps.

Vikram

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Sudipta,

Try putting the script 'On Load' for RFx.

Thanks

Devesh

Former Member
0 Kudos

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));

}

Former Member
0 Kudos

Hi Sudipta,

Add this line to the imports :

import com.frictionless.api.common.db.metadata.UserVisibilityEnumType;

I am not very sure about it but i think it should work for you. Do let us know.

Thanks

Devesh

Former Member
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Sudipta,

As I said in one of the posts above, try putting the same script definition on the 'Loaded' target.

It should work for you.

And can you please throw some light on how you sorted out the problem you were facing earlier?

Thanks

Devesh

Former Member
0 Kudos

Thanks , I am trying but seems to be not working for loaded phase..

and the package name in 5.1 version that I have used

import com.frictionless.api.comp.attachments.AttachmentSubIBeanIfc;

import com.frictionless.api.common.db.metadata.UserVisibilityEnumType;

Regards

Sudipta

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Mudit ,

I am good. Hope you are also doing fine...

Yes your understanding is correct ..

and It's possible to avoid NULL value when there is no attachment if you check the attachment number not equeal to zero .

Regards

Sudipta

0 Kudos

Hi Sudipta,

The script events are trigged on the MA, not on the attachment. So, I don't believe it's possible to accomplish what you are trying to do. My suggestion would be to use scripting to set the attachment visibility and handle the defaulting as a training issue.

Regards,

Vikram

Former Member
0 Kudos

Yes, Vikram you are right.

Again I tried with the optiion "Attachment Subordinate(361) " as class in scripting . But is also seems to be not working .

Any idea what is this "Attachment Subordinate(361)" pointing to ?

Regards

Sudipta