cancel
Showing results for 
Search instead for 
Did you mean: 

Hide Add button for Collection

Former Member
0 Kudos

Hi,

I have created new collection and i see some butttons like :

- Add

- Deleted Item

- Import

- Reorder

I would like to hide only Add button and others buttons stay avaialble for user.

How we can do it?

Thanks for your support.

Kind Regards,

Anacia

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Bump.

I'm having this same issue.

I want to remove the 'delete' button from a collection, but still keep the 'add' button. A toolbar customization removes the buttons from all collections, and locking the entire collection removes all the buttons.

This functionality is required for example if there is a savings extension collection with members. We would like users to able to add savings lines, but not delete them. If they have the ability to delete, there is the possibility they could delete a line, the re-add a line with the same name and it would be hard to notice and track.

Thanks.

Former Member
0 Kudos

Hi Matt,

We have similar requirement.

We're you able to control deleting rows from extension collection.

Can you please help me how to accomplish it.

Thanks

Krish

Former Member
0 Kudos

Hi Vikram,

I created new script wth class User Defined Object (Class id = (9999101) and event traget as Loaded.

It is not working : when i edit the Object, Add button of concerned collection still not readonly.

I think loaded event is not the correct event to set Add button as readonly.

We need to make Add button of collection as read only when i clik on the Edit button of object., and i don't why which class and Tragt i have to use in my scripting.

Any other proposal? any other idea?

Thanks & Regards,

Anacia

Former Member
0 Kudos

Hi,

We can achieve this via Toolbar customization but the caveat is that the Add button throughout the application will be rendered un-editable.

Vikram

Former Member
0 Kudos

Hi Anacia,

Have you been able to get a working solution for this? We have the same requirement and have not been able to achieve it either. In our case, we also need to disable 2 fields in the collection and also the Add and Delete buttons.

Thanks,

MP

Former Member
0 Kudos

Many Thanks Vikram for your reply.

my object classe is : user Defined Object ( classe id = 9999101)

my collection name : SoftwareMeasurement

Accorfing to your scripting , here the scripting adapted to my requirement:

colln=doc.getExtensionCollection("SoftwareMeasurement");

collnSize=colln.size();

if(collnSize>0){

for(int i=0;i<collnSize;i++){

member=colln.get(i);

IapiDocumentLockManager.lockField(session,member,"Add");

}

You mentionn in your mail Scripting Context = Document Lifecycle.

1- what is the Class = Object or collection?

2- What is the target of this scripting ?

Tansk & Regards,

Adil

Former Member
0 Kudos

Hi,

1- what is the Class = Object or collection? <Vikram> We had this field at the Master Agreement level and hence the class used was Master Agreement(1004)

2- What is the target of this scripting ? <Vikram> We have made this at the 'Loaded' event

Hope this helps

Vikram Shukla

Former Member
0 Kudos

Hi,

This is possible by writing a script.

We had a similar requirement wherein Add, Delete Selected, Import and Reorder buttons were available below the custom collection and they needed to be hidden. In your case, you can just lock the Add button while keeping the others Active.

here are the details of that example:

Scripting Context: Document Lifecycle

External ID:SAPINT_MasterAgreementLock

colln=doc.getExtensionCollection("xxx");

//locks the collection to prevent the addition of new elements

IapiDocumentLockManager.lockField(session,doc,"FieldRequester");

//Locks the individual members of the collection.

collnSize=colln.size();

if(collnSize>0){

for(int i=0;i<collnSize;i++){

member=colln.get(i);

IapiDocumentLockManager.lockField(session,member,"Add");

}

}

Hope this helps,

Vikram Shukla

Former Member
0 Kudos

Hello,

I am new to SAP Sourcing and have a similar requirement. I need to hide an "Add" button (shown below) on a condition which I already know how to check for.

The only problem I am having is hiding the Add button. I hope to use the same method as you have shown but I do not know what the Extension Collection ID is. Is there a way to find this out?

Thank for your help,

Troy Nemeth