Skip to main content
10-Marble
May 26, 2023
Solved

How to get the name of ApplicationData with a different value?

  • May 26, 2023
  • 2 replies
  • 2351 views

 

I created a new ApplicationData and my intent is to just show the name of ApplicationData  with a specific name, whenever the getFileName() is called. But the name would always return as {$CAD_NAME}

 

Below is the code:

EPMDocument epmDocument = (EPMDocument) object;
ContentHolder contentHolder = ContentHelper.service.getContents((ContentHolder) epmDocument);
ContentItem  contentItem = ContentHelper.getPrimary((FormatContentHolder) contentHolder);
if (contentItem != null ) {
ApplicationData  appData = (ApplicationData) contentItem;
if (appData != null) {
   //appData should have this cad name.
   appData.setFileName(epmDocument.getCADName());
}
}
---
The issue with the above code is, the setFileName() would only show effect till I add the below line: - PersistenceHelper.manager.save(appData);
But with the above line there would be a database change for ApplicationData, which I do not need.
 
Is there a way to make the getFilename() of the ApplicationData return a specific String without change in the Db? 
 

 

 

Best answer by HelesicPetr

Hi @MN_10661566 

Create and Assign a custom DataUtility to the attribute in the table that the DU get the right value. 

PetrH

2 replies

17-Peridot
May 27, 2023

why do you want to this? What's the use case? Since you don't wan't to change the filename in the DB it doesn't make sense to me. If you downloading it, you can change the filename.

10-Marble
May 29, 2023

We previously had a dialog created usign TableConfig(), with just an EPDocument in the row(s). Now, my goal is to show the Primary Content too as one row under the EPMDocument.
The TableConfig calls the getNames for each these rows.
But the name of the primary content, which is application data always comes as {$CAD_NAME}. And that is not the CADNAME we wanted to show.
Hence, wanted to check if there is a way to display the name as EPMCADName for this applicationData instead of {$CAD_NAME}.

HelesicPetr
22-Sapphire II
22-Sapphire II
May 29, 2023

Hi @MN_10661566 

Create and Assign a custom DataUtility to the attribute in the table that the DU get the right value. 

PetrH

HelesicPetr
22-Sapphire II
22-Sapphire II
May 29, 2023

Hi @MN_10661566 

No there is not a way how to change the OOTB function getFileName because the database really contains this information. 

It is reference variable that the information is in CAD_NAME so if there is the cadname you should search for the cad name string. 

PetrH