on 10-14-2011 1:59 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.