Skip to main content
4-Participant
December 8, 2024
Question

Download created file on Client UI from any location

  • December 8, 2024
  • 2 replies
  • 590 views

Version: Windchill 12.1

 

Use Case: I have one action on Details page action set of part and on click of that action I am creating one excel file with few custom data in windchill temp location. Now requirement is it should get downloaded on client UI on click of that custom action. So need help with line of code to download created file from particular location.


Description:

I have one action on Details page action set of part and on click of that action I am creating one excel file with few custom data in windchill temp location.

Now requirement is it should get downloaded on client UI on click of that custom action.

So need help with line of code to download created file from particular location.

2 replies

13-Aquamarine
December 9, 2024
FormResult result = new FormResult();
String filePath = "file path";
File file = new File(filePath);
URL localURL = NmObjectHelper.constructOutputURL(file, file.getName());
result.setForcedUrl(localURL.toString());
result.setURL(localURL.toString());
FeedbackMessage msg = new FeedbackMessage(FeedbackType.SUCCESS, Locale.CHINA, "Export Data", null, "Export Success");
result.addFeedbackMessage(msg);
result.setStatus(FormProcessingStatus.SUCCESS);
return result;
Community Moderator
December 13, 2024

Hello @VK_11755221,

 

It looks like you have a response from a community member. If it helped to answer your question please mark the reply as the Accepted Solution. 

Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,
Vivek N.
Community Moderation Team.