on 08-07-2012 2:29 PM
Hi all,
I'm trying to implement the following requirement to include a new extension definition to be used into Projects. This extension will be a value list which will display a set of values which will be used during the approval flow. Furthermore, these values need to be modified at runtime depending on actions of the current approval.
Due to I'm new in SAP Sourcing, could you please let me know if this functionality could it be implemented? I've been reviewing some documents regarding this topic and I've not found anything to modify at runtime values displayed on a value list. So could you please let me know if it is possible or indicate me any kind of documentation to check it?
Thanks and best regards,
Isaac
Hi Isaac,
Use below code to modify valuelist value at runtime.
valueTypeHome=IBeanHomeLocator.lookup(session,ValueListTypeIBeanHomeIfc.sHOME_NAME);
valueTypeBean=valueTypeHome.findByExternalId("vl.Contract_document_type"); //Check valuelist internal name and enter here
valueBean=valueTypeBean.getCollnValueListValue().get(2); //select a particular value from list , first value in list is at index 0
doc.getExtensionField("CONTRACT_DOC_TYPE").set(valueBean.getLocalizedObjectReference()); //Give Value list Extension field name here
Try this.
Regards,
Saloni
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Saloni,
Thanks a lot for your quick answer. Just one question: where do I have to put that code? As far as I know and due to these values have to be updated during the approval flow, I was thinking to use it as part of the workflow steps (as a script inside the workflow logic created using Together Workflow Editor). Is it correct or should I use this code included as a "script definition" ?
Thanks again and best regards.
Hi guys,
the code above only seems to take a value from the list and paste it into another custom text field. Is this correct?
I was wondering if it is possible to remove values from the value list during runtime.
e.g. You define a value list with 3 values. During runtime you perform some checks and based on that you only show 2 values. In another case, you only show one value.
Anyone ever had any succes implementing this kind of functionality?
Thanks,
Bram
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.