Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
I am using Windchill PDMLink Release 11.0 and Datecode with CPS F000
Creating a new NmOid for a new EPMDocument throws Exception: Cant' initialize an ObjectReference to Null.
Below is our code:
//Creating a new EPMDocument
EPMContextHelper.setApplication(EPMApplicationType.toEPMApplicationType("EPM"));
EPMAuthoringAppType at = EPMAuthoringAppType.toEPMAuthoringAppType("COCRDRAFT");
EPMDocumentType dt = EPMDocumentType.toEPMDocumentType("CADCOMPONENT");
EPMDocument cadDoc = EPMDocument.newEPMDocument("docnumber", "docName", at, dt, "CAD_DOC");
//Now create a new NmOid
NmOid cadNewNmOid = NmOid.newNmOid(cadDoc.getPersistInfo().getObjectIdentifier());
Could you let me know what is the problem here?
Here are the errors that I faced
wt.util.WTRuntimeException: ERROR: Can't initialize an ObjectReference to null
Solved! Go to Solution.
Yes. infact newNmOid needs String, and we changed to insert String instead of making EPMDocument persistent.
Hi @MN_10661566
The trouble would be that new EPMDocument is not persisted and the ObjectIdentifier is null that moment?
I would check if getObjectIdentifier really returns somethnig.
I usually use oid to create NmOid object> NmOid.newNmOid("OR:wt.part.WTPart:00051210");
PetrH
Yes. infact newNmOid needs String, and we changed to insert String instead of making EPMDocument persistent.