How to avoid PRRuntimeException in pxUploadCSVResults activity
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.
***Updated by moderator: Lochan to update platform capability***
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.
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.