web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / Electronic Reporting (...
Finance forum

Electronic Reporting (ER) - List 'model/Payments' does not have any check for empty list case, it can result an error at run time. Add a check for empty list case.

(0) ShareShare
ReportReport
Posted on by 141

I'm getting a warning in my ER designer.

The field DateToBeProcessed is mapped to model.Payments.RequestedExecutionDate.

Image-6.png

It keeps wanting an empty list check for model.payments but I'm not sure how to do the check or where to put it.

Below are the validations I have in place for the field DateToBeProcessed.

1321.Image-5.png

Here are all my validations for this configuration.

Image-7.png

I'm getting the same error for another field that I have remapped (LodgementReference).

Does anybody have a clue how to resolve these empty list check warnings please?

Categories:
I have the same question (0)
  • Verified answer
    Ties Philippi Profile Picture
    960 on at

    Hi Lexicon,

    These warnings are popping up when you have any record list. In general I ignore these most of the time, depending on the values that are related to this. It basically says that in the formula designer you have to check for empty records and tell ER what to do if the record is empty.

    To solve the warnings you have to modify your formula by adding IF statements that check for Emptylists or Emptyrecords, depending on the type. Although if you have it set up in validations allready, it will not be empty so the warning can be ignored.

    Best regards,

    Ties

  • Lexicon_ Profile Picture
    141 on at

    Thank you!

    Would you be able to tell me how to check if a DATETIME field is empty please? It seems like different datatypes have different functions for checking for emptiness.

    I know how to check for empty string and empty list, IF(string="") and ISEMPTY(list), but I have not been able to find the equivalent checks for empty DATETIME and empty records and/or other types of data. I've looked through the formula designer doc on Microsoft Docs but everything I've tried just returns more errors.

  • Verified answer
    Ties Philippi Profile Picture
    960 on at

    Hi Lexicon,

    The error is not in the list function but it is in the field function requested execution date.

    As the model.payment is it's parent, ER is asking for a check on what to do if the parent is not filled in.

    So to solve this error, I can only give you a solution for the Validation part, as you have not actually shown your binding in the format mapping.

    Change the validation to this and remove the other 2 validations present:

    if(NOT(isempty(model.Payments)), dateformat(model.Payments.RequestedExecutionDate,"ddmmyyy")<>"",false)

    Let me know if you can find out the rest based on the example above or if not, please provide the binding in the model mapping.

    Best regards,

    Ties

  • Lexicon_ Profile Picture
    141 on at

    Thank you Ties.

    I still need help with the binding please. I have it mapped to model.Payments.RequestedExecutionDate.

    pastedimage1566864213992v2.png

    I've tried if(NOT(isempty(model.Payments)),model.Payments.RequestedExecutionDate,false) but that's not valid.

    Please and thank you!

  • Verified answer
    Ties Philippi Profile Picture
    960 on at

    The format binding is not expecting a boolean value (the false value). Set it to a dummy date (eg. "01-01-2000"), since you use validation on this format element the dummy date Will never be ised.

  • Lexicon_ Profile Picture
    141 on at

    Hi Ties,

    I'm sorry to keep bugging you. I'm still unable to get it to work.

    Validation error:  True value 'model.Payments.RequestedExecutionDate' is not of the same type as false value one '"01-08-2019 00:00:00"'

    My binding formula is if(NOT(isempty(model.Payments)),model.Payments.RequestedExecutionDate,"01-08-2019 00:00:00")

    I've tried combinations of

    • Using ' instead of "
    • Using / instead of -
    • Using DD MM YYYY and YYYY MM DD
    • Using just a date
    • Using a date and time

    I ran a test on just the model.Payments.RequestedExecutionDate value to see what type it comes up as. I've tried using the results in the second line and third line.

    pastedimage1567471336473v1.pngpastedimage1567471411377v3.png

    This is getting so frustrating, why is ER formula designer so finicky and user-unfriendly :(. Is there no way to resolve this particular warning? I'm sorry, just had to vent a little!

  • Verified answer
    Ties Philippi Profile Picture
    960 on at

    Hi Lexicon,

    Make your formula for the second part:

    Datetimevalue("01-08-2019 00:00:00")

    I believe format code is optional. But if mandatory use:

    Datetimevalue("01-08-2019 00:00:00","dd-MM-yyyy hh:mm:ss")

    Could you mark the other answers as verified if they helped you?

    If you have any other questions please feel free to ask.

    Best regards

    Ties

  • Verified answer
    Ties Philippi Profile Picture
    960 on at

    Alternatively use datevalue if you still receive errors. Off course you have to modify the input and format by removing the time components.

  • Lexicon_ Profile Picture
    141 on at

    Hallelujah!! Thank you!

    IF(NOT(ISEMPTY(model.Payments)),model.Payments.RequestedExecutionDate,Datevalue("01-01-2019","dd-MM-yyyy"))

    and 

    IF(NOT(ISEMPTY(model.Payments)),model.Payments.RequestedExecutionDate,TODAY())

    worked! Thank you so much, much appreciated 

  • Zahra Mirzazadeh Profile Picture
    156 on at

    Hi All

    In Electronic Reporting --Formula Designer , I want to check the value of the Filed String that is null or no?,

    i used If(string="",1,2) but it doesn't work .

    Any one can help me?

    Best Regards,

    Zahra

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans