Question

How to avoid PRRuntimeException in pxUploadCSVResults activity

Hi,

I am using OOTB activity @baseclass.pxUploadCSVResults to upload a CSV file into page list. I placed a button to fire this activity as below screenshot and basically it works fine as long as I upload a CSV file onto memory first.

However, if I press this button before I upload a CSV file, Pega throws an Exception as below on user screen.

It is reasonable for Pega to throw an Exception because file does not exist, but I do not like displaying this Exception. There should be a couple of solutions that I can think of, for instance:

1. Disable button until user uploads CSV file onto memory
2. Press button, and nothing happens if CSV file does not exist (no exception is displayed)
3. Press button, and message shows or pops up if CSV file does not exist.

I am okay with any of above solution but simpler the better. What is the best approach? Minimum code is much appreciated.

Thanks,

***Updated by moderator: Lochan to update platform capability***

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Correct Answer
November 27, 2018 - 3:39am

Hi,

We have resolved the issue this way:

Screenshot 1) Button allocation

Screenshot 2) Button configuration - OnClick, fire your custom activity

Screenshot 3) Your custom activity sample looks like this.

Screenshot 4) Condition in Step 1 (before action)

Screenshot 5) Condition in Step 1 (after action)

Above configuration should give you an error message on screen as below, if you press Upload button before specifying a file.

Hope this helps.

Thanks,

Comments

Keep up to date on this post and subscribe to comments

Pega
October 15, 2018 - 7:43am

Hi Cloe,

Thanks for posting on PSC.

As per your requirement I think using the third option is better to use.To show the pop-up message .When ever we try to upload the file of different extensions also there will be a pop-up or error message displayed.But the button will not be disabled or not even the second option.

Other inputs are also appreciated.

November 20, 2018 - 3:43am
Response to komah

Hi,

Thanks for your comment, but I am unable to find how to do that. Could you please provide the code?

Thanks,

Pega
November 25, 2018 - 7:42pm

Hi,

Have you solved this problem? If so, please tell me the method.

Thanks,

November 26, 2018 - 8:52pm

Hi,

If any one solved this problem? If so, please help us to know the approach.

Thanks,

 

 

Pega
November 26, 2018 - 11:42pm

Hi , For option #2 (which might be easier to handle) fire the pxUploadCSVResults activity when there is non-empty value present in the property that holds the filename. For option #3 you would have to have write a new activity that could be similar to pxUploadCSVResults in which you have to refresh the current section if the primary page has error after the activity is run.

Hope this helps!

Pega
November 27, 2018 - 3:39am

Hi,

We have resolved the issue this way:

Screenshot 1) Button allocation

Screenshot 2) Button configuration - OnClick, fire your custom activity

Screenshot 3) Your custom activity sample looks like this.

Screenshot 4) Condition in Step 1 (before action)

Screenshot 5) Condition in Step 1 (after action)

Above configuration should give you an error message on screen as below, if you press Upload button before specifying a file.

Hope this helps.

Thanks,

November 27, 2018 - 3:43am
Response to TSUCK

Thanks it works