TcConnector upload fails with File Extension *.null error despite FileDocument having a valid Name/extension

0
I'm using the TcConnector/TC Extension marketplace module to upload a generated Excel file as a Dataset attachment to Teamcenter via a custom microflow (built on top of createAttachAndSubmitObjects / the module's upload action).Setup:I generate an Excel file (TreeBOPModule.Excel, a specialization of System.FileDocument)I create a TcConnector.FileDocument object and copy the binary content across using a Java action (Core.getFileDocumentContent → Core.storeFileDocumentContent)I confirmed in the debugger that the resulting TcConnector.FileDocument.Name is a valid string ending in .xlsHasContents = true, Size = 4608 (non-zero) — content is presentDataset type is set to MSExcel via SetDatasetType, and the relation CMReferences is created correctly between the Dataset and the ItemRevisionProblem:When the upload runs, I get this runtime error:com.mendix.systemwideinterfaces.MendixRuntimeException: java.lang.Exception: For the given dataset "MSExcelX", NamedReference "excel" and File Extension "*.null" combination is not valid.Two things confuse me:The dataset type in the error is MSExcelX (with a trailing X), even though I explicitly set MSExcel (no X) via SetDatasetType.The File Extension shows as *.null, even though the FileDocument.Name clearly has a .xls extension when inspected in the debugger right before the upload call.Manually uploading the same file directly through Teamcenter's Active Workspace client (Add → Upload File → Type: MS Excel) works perfectly, so the TC-side Dataset Type / NamedReference / Extension configuration itself is valid. And reflecting in TEAMCENTER. But when manually attaching is failing at the upload level. Has anyone else hit this "*.null" extension error with TcConnector uploads, and what was the actual root cause?microflow with variables Dataset, Pair, configNameMy Debugger Verification:The File Document Object: The TcConnector.FileDocument specialization has HasContents = true and the Name attribute is explicitly set to end with the extension: 'ReportName.xls'.The Pair Mapping List: I am passing a committed TcConnector.Pair object where Name = 'excel' and Value = 'xls'.The Dataset Type: The dataset entity type passed to the connector is set to 'MSExcel'.Why working when manually attaching and why failing through automation And verified current session and user everything is active.
asked
2 answers
0

Not sure if this is relevant to the immediate problem, but your relation type is probably not correct. CMReferences is for reference items to a change item. If you want a Dataset attached to an ItemRevision as a reference, you need to use IMAN_reference relation instead

answered
0

Maybe you could share some screen shots to describe what you're doing.


For reference, this is the way I would upload a file as a new Dataset.

In this case I am uploading a PDF, but you can easily change this for Excel.





answered