Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Velvet_Crowe
Contributor III
Contributor III

How to avoid task failed if value does not exist in data model?

Hello,

is there a way to avoid a filter error or a best practice to handle values which does not exist in data model?

Current scenario

A report is send daily with data from the previous day (Condition: =Date(Today() - 1, 'DD.MM.YYYY')). Only sundays and  public holidays are not present in the data. To avoid sending empty reports I added a condition to check if a chart has values.

Everything is working as expected. But on days without data the task runs into an error after the conditions are processed.

Error message

Execution for task 3c7eb1dd-f3f8-4d73-b7ae-a7031e890e65 failed for an exception System.Exception:
Failure processing condition: filter application returned a filter application error.
Applied filter is Filters: [Fields: [Name: F\Date, ConnectionId: db09340e-ce1c-48b5-b278-fe1ffa55ab7a,
Values: [Evaluate:=Date(Today() - 1, 'DD.MM.YYYY')], Override: False, Void: False, SelectExcluded: False],
Variables: [], Void: False], Bookmark: , Void: False. No report will be generated.

Is there a better way than letting the task run into the error?

Labels (2)
1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

It is not clear where you added your condition - on report or on task entity in NPrinting.

At the end there is no harm having this task error, right? If you want to have neat solution you can create task condition which will check if there is data you need and stick it in the publish task. That will stop report from generating. 

Obviously your issue is that filter cannot be applied due to lack of records in data model. To compensate for this you can always concatenate one dummy record on your Date field so it always has a record to apply selection on despite the fact that there is no factual data linked to it - this will still allow you to apply check on "chart has values" object.

hope this helps

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.

View solution in original post

2 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

It is not clear where you added your condition - on report or on task entity in NPrinting.

At the end there is no harm having this task error, right? If you want to have neat solution you can create task condition which will check if there is data you need and stick it in the publish task. That will stop report from generating. 

Obviously your issue is that filter cannot be applied due to lack of records in data model. To compensate for this you can always concatenate one dummy record on your Date field so it always has a record to apply selection on despite the fact that there is no factual data linked to it - this will still allow you to apply check on "chart has values" object.

hope this helps

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Velvet_Crowe
Contributor III
Contributor III
Author

Hi,

I added the condition to both report and task. To avoid those ugly errors I will create dummy records as you suggested.

Thanks for the quick response @Lech_Miszkiewicz