cancel
Showing results for 
Search instead for 
Did you mean: 

Disable certain fields of a extension collection for documents only

Former Member
0 Kudos

Hello,

I have seen other posts which had somewhat similar questions, but I did not find the solution so posting my question.

Is it possible to disable certain fields of an extension collection for documents only? We plan to create an extension collection and set up the data in a template. Once this is copied into a new document, we need users to be able to update only certain fields of this collection.

How can this be achieved?

Thanks,

MP

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi MP,

You can't do that with the page customization.But we can make the fields disable by using the lock functionality .

You can create a script on the load of the document.

Find the below code:-

Class: Contract Document(2002)

Instance Type: Document Only

Document Type: Any

Target: Loaded

Script:-

import com.frictionless.sap.integration.locker.SentToSapLockManager;

SentToSapLockManager lockManager = new SentToSapLockManager(session);

lockManager.process(doc);

import com.frictionless.api.doc.IapiDocumentLockManager;

collBean=doc.getExtensionCollection("TestUser").get(0);

IapiDocumentLockManager.lockField(session,collBean,"TestCol1");

IapiDocumentLockManager.lockField(session,collBean,"TestCol2");

Here I am locking the fields for the first row only.In the script you have to iterate over the size of the collection and write the above code in the for loop.

I have tried this in my system.Hope this will work for you.

Thanks,

Ankur Goyal

Edited by: ankur_goyal03 on Oct 15, 2011 9:00 AM

Former Member
0 Kudos

Hi MP/Ankur,

I would be worried adding persistent "LOCK" to DB table for the purpose of locking a field in the extension colleciton UI. The lock table in SAP Sourcing is simillar to ENQUE table in ERP/NW and using this approach may cause the table to grow quickly over time. As this a key central table, i wouldn't suggest to hack it that way.

Would suggest to work with SAP to get the page customization support extended for extension collections..

Thanks,

Baski

Former Member
0 Kudos

Thank you Ankur and Baski.

I have implemented Ankur's solution to demo functionality to the users and will discuss with SAP the requirement to extend Page Customization.

Thanks,

MP

Former Member
0 Kudos

To add to this discussion, to disable the Add/Delete/Reorder buttons, you can lock the extension collection also.

Example, in Ankur's code above, you could disable the buttons by

IapiDocumentLockManager.lockField(session,collBean,"TestUser");

where "TestUser" is the name of the extension collection.

There are other posts with this information as well.

Answers (2)

Answers (2)

Former Member
0 Kudos

adding further, can you please tell me if the Extension Field is of Value List Type , How to lock it, using

IapiDocumentLockManager.lockField(session,project,"ExtensionFieldVLV");

I am not able to lock the field.

Former Member
0 Kudos

Hi MP,

Once created, an extension field cannot be disabled based on some condition. But you always have the option of hiding it or making it read only using page customization. I have tried this for extension fields but not specifically for an extension collections. But, since both of them are essentially extensions, I think it should work.

Do let us know how it goes.

Thanks

Devesh

Former Member
0 Kudos

Hi Devesh,

Thank you for responding. I already tried Page Customization. The option to make the field ReadOnly is not availble for extension collections.

Thanks,

MP