on 06-03-2014 10:13 PM
Hi!
I'm trying to retrieve the external Id of the current phase of a contract document, in order to identify in which phase it actually is (or changed to).
The problem I'm encountering is that, the method of the LocalizedObjectReference object (the one that getCurrentPhase returns) that calls the externa ld (getExternalId(com.sap.odp.common.platform.SessionContextIfc session)) is asking for a parameter that is actually different from a IapiSessionContextIfc. I tried to find what kind of object is that of SessionContextIfc but I couldn't find it anywhere on the Iapi documentation.
Does anyone know what kind of object is that method expecting?
Thanks in advance!
Your script is ok, the problem is that 'smart' CLM did not update the LocObjRef with the external ID from the phase.
what you need to do to fetch that is use:
ContractDocPhaseSubIBeanHomeIfc home = IBeanHomeLocator.lookup(session, phase);
realPhase = home.find(phase);
extId = realPhase.getExternalId(session);
(ps: hope my code compiles)
Regards,
Bogdan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
public abstract interface SessionContextIfc extends UserSessionIfc, IapiSessionContextIfc, Cloneable, EventRouterIfc
{ ... }
It should work with the session variable provided (did not test myself).
Regards,
Bogdan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
Thanks for the answer!
I tried with that before, using the "session" variable, but it returns null.
I thought it was a class problem, but thanks for stating that they're interchangable.
Now, back to the problem: why would it return null? Do you have any idea of why is this happening? anything that could help me getting to the source of the problem.
Thanks in advance!
the part of the script that is retrieving the phase is the following:
contracts = doc.getContractDocuments();
if(contracts.size() > 0){
mainContract = contracts.get(0);
phase = mainContract.getCurrentPhase();
phaseName = phase.getDisplayName(session);
phaseId = phase.getExternalId(session);
}
It enters the conditional branch, and then send me the values to my email (So i can know the values).
It sends me everything allright except for the external id.
Thanks in advance!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.