on 08-21-2012 9:24 AM
Hi all,
I'm trying to execute following requirement:
To cover previous requirement, we are trying to use Page Customization feature. But we are not able to do it because we don't know which Project field is containing the current phase. I mean, in customization data for Project Page Customization, we have used following information:
Regarding Dimension Field, we have used several tries but neither of them has been correct. Therefore, could you please help us on how this field must be filled? Which Project field should be used in that way?
Furthermore, is there any SAP guideliness available to be used on how to use Page Customization feature?
Thanks in advance for the help and support!
Best regards,
Isaac
Its may not possible to hide/unhide fields based on Phase of document. But we can make the fields disable/enable by using the lock/unlock functionality. You can create a script, so that a specific extension field disabled or enabled based on Phase of document.
Example:
customdocstatus = doc.getCurrentPhase();
if(customdocstatus.getDisplayName(session).equals("Draft")){
IapiDocumentLockManager.lockField(session,doc,"ApproverField_2"); // disables field ApproverField_2 if document is in draft phase }
else if(customdocstatus.getDisplayName(session).equals("FirstLevelApproved")){
IapiDocumentLockManager.lockField(session,doc,"ApproverField_1"); // disables field ApproverField_1 if document is in FirstLevelApproved phase
IapiDocumentLockManager.unlockField(session,doc,"ApproverField_2");} // enables field ApproverField_2 if document is in FirstLevelApproved phase
Hope this meets your requirement.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
adding further what do you mean by auxiliar field ?
I need to lock dowm extension field which is valuelist for particular phase and i am not able to lock down can you suggest.
ProjectIBeanIfc proj = (ProjectIBeanIfc)doc;
LocalizedObjectReferenceIfc getField = (LocalizedObjectReferenceIfc) proj.getExtensionField(
"Temp_1").get();
if(getField.getDisplayName().equals("A"))
{
IapiDocumentLockManager.lockField(session,proj
}
can you suggest how to lock valuelist field
Hi Pallavi,
If I've understood correclty your requirement:
Then, if you one to lock one field in Phase B, you could do the following:
import com.sap.odp.api.doc.IapiDocumentLockManager;
// Retrieve the current phase:
if (!hasValue(current_phase)){return;}
//Depending on the phase, execute corresponding logic:
//------------------------------------------------------------------
switch(other_phase) {
case "Phase B":
//Lock fields:
IapiDocumentLockManager.lockField(session,doc,"<FIELD_NAME>");
break;
default: break;
}
We have used this code and it's working.
Please, let me know if it helps you.
Best regards,
Isaac
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.