cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

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

MN_10661566
10-Marble

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

 

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? 
 

 

 

ACCEPTED SOLUTION

Accepted Solutions

Hi @MN_10661566 

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

PetrH

View solution in original post

5 REPLIES 5

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.

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}.

Hi @MN_10661566 

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

PetrH

Yep. a custom DataUtility should work for the Table. Thanks very much!!

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

Announcements

Top Tags