cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with locking standard collections

Former Member
0 Kudos

Hi All,

On trying to lock the collections using the following code, I face the following issues:

Line Items - Only buttons - Add, Add Material, Delete are getting hidden, remaining ones like "Import Line Item" are still available

Rebates - Only Add button gets hidden, Add Percentage not getting hidden

Penalties - Only Add button gets hidden, Add Percentage not getting hidden

Note - Disabling collections (standard ones) is not working via page customisations, so I moved to scripting.

Sample code I used:

//----


myColl= doc.getCollectionMetadata("<COLELCTION ID>").get(doc);

IapiDocumentLockManager.lockField(session,doc,"<COLLECTION ID>");

for (int i = myColl.size() - 1; i >= 0; --i)

{

myColl_member = myColl.get(i);

IapiDocumentLockManager.lockField(session, myColl_member, "<COLLECTION FIELD ID");

// The above line is repeated for every collection field

}

// -


The values I used in script:

Line Items collection ID - MA_LINEITEMS

Rebates collection ID - REBATES

Penalties collection ID - PENALTIES

Please advise!!

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Mudit

The page customisation can be used for hiding, but the same does not work for disabling. I have tried it out.

Thanks for the info on toolbar activities, will try that out.

But the problem still remains, even if I try to lock each field for every collection member using scripting - I still see that fields like "List Unit Price" are still editable for the "Unit Price View" - though I have locked this field through scripting.

Thanks

Former Member
0 Kudos

Hi

From your post it seems you are trying to hide MA_LINEITEMS collection from Line items tab. This could be achieved through Page Customization. You have to use Master Agreement Page UI ID: contracts.contract.ui.buyside.default, create a new page customization with MA_LINEITEMS mentioned in the field ID, Property: Hidden, Value: Yes

This is working fine for us.

In case you are looking to hide toolbar items like "Import Line Items" this can be achieved through toolbar customization. For e.g.

toolbar ID for line item is contracts.lineitem.collection.toolbar and toolbarID for Import Line Items is contracts_import_lineitem. So you can try creating toolbar customization with toolbar ID as contracts.lineitem.collection.toolbar.contracts_import_lineitem and property set to hidden

You can hide the rest of the toolbar buttons the same way

Regards

Mudit Saini

Edited by: Mudit_UCB on Jul 1, 2011 9:15 AM

Edited by: Mudit_UCB on Jul 1, 2011 9:19 AM