cancel
Showing results for 
Search instead for 
Did you mean: 

Hide buttons for extension collection

0 Kudos

Hello experts,

we need your help again. We create a new tab which contains additional information according collaboration on master agreement master data and specific contract documents. We solved the generation of entries via scripting. Everything works fine so far. Nevertheless it is required that nobody with read/write access can change the system-generated rows.

In that case I try to find the ID for extension collection for toolbar customization but I just find the external ID's for system toolbars. We want to hide or block these buttons (see screenshot as well):

1. Add

2. Import

3. Reorder List

4. Delete Selected

Is there any possibility via toolbar customization according to find the correct ID's or is scripting the only solution for it?

Thanks in advance,

Heiko

View Entire Topic
former_member190023
Contributor
0 Kudos

Hi Heiko,

For this requirement your only option is via script.

Bogdan

0 Kudos

Hi Bogdan,we

thanks for your quick answer as always We need some advice. Is there any approach we can use for it? I know that "Script Definition" contains the scripting context "Toolbar".

Where can we get the relevant ID's for the buttons?

Thanks again,
Heiko

former_member190023
Contributor
0 Kudos

Hi Heiko,

The scripting context will not help in this case.

You'll need to add some code in 'whatever' script is generating the records in the collection.

After you add all your records to the collection you'll need to make use of IapiDocumentLockManager like so:

lockField(session, doc, "extension_collection_name")

This will lock the collection itself and only that (not the records, and not the fields within the records). In plain words it will remove all the buttons you highlighted.

Let me know if this works.

Bogdan

0 Kudos

Hello Bogdan,

ok we will check this if it works and I'll let you know.

Best,
Heiko

0 Kudos

Hello Bogdan,

we used this code (document lifecycle).

######

// Lock Collection

// 2016-03-02

// ver 1.0

// collections

final String COLL_NAME = "ZCLM_TAB_COL_IND";

public void lockExtensionCollection(IBeanIfc bean, String collectionName) {

    colln=bean.getExtensionCollection(collectionName);

  IapiDocumentLockManager.lockField(session, bean, collectionName);

}

lockExtensionCollection(doc, COLL_NAME);

######

All in all it works fine. Thanks for your input.

Best,

Heiko

former_member190023
Contributor
0 Kudos

Hi Heiko,

Glad to hear that. Could you also confirm if this solved your other question (the trash icon on each record), or you still need help with it?

PS: you could remove colln=bean.getExtensionCollection(collectionName); it doesn't look to be used

Regards,

Bogdan

----------------------------------

SAP Sourcing scripts - editing and source control maintenance

[ANN] ScriptsRepo - Deploy Tool for SAP Sourcing Scripts

0 Kudos

Hello Bogdan,

yes it solved our other problem as well. I deleted the other post because this post contains the solution of the trash can. So everything is perfect

Thanks again,
Heiko