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 :
Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

D365 | Specified cast is not valid.

(0) ShareShare
ReportReport
Posted on by 68

I have programmed a filter to filter the non-rental vehicles, I get the error message "Specified cast is not valid." do you have a solution?

Greetings
Eaven

 pastedimage1660641132502v2.png

I have the same question (0)
  • Komi Siabi Profile Picture
    13,109 Most Valuable Professional on at

    Hi EavenCS,

    Your filter is obviously not well defined. You mind sharing your code ? (Please use the rich formatting ->Insert code)

  • EavenCS Profile Picture
    68 on at

    [DataSource]
    class ERSRentalTable
    {
    /// <summary>
    //
    /// </summary>
    public void executeQuery()
    {
    utcdatetime rentFrom = element.ValidFromFilter.dateTimeValue();
    utcdatetime rentTo = element.ValidToFilter.dateTimeValue();

    if (rentTo == DateTimeUtil::minValue())
    {
    rentTo = DateTimeUtil::maxValue();
    }
    else if (rentTo < rentFrom)
    {
    rentTo = rentFrom;
    }

    QueryBuildDataSource qbdsRental = this.query().addDataSource(tableNum(ERSRentalTable));

    qbdsRental.joinMode(JoinMode::NoExistsJoin);

    this.query().validTimeStateDateRange(rentFrom, rentTo);

    super();
    }

    }

    [Control("DateTime")]
    class ValidFromFilter
    {

    public boolean modified()
    {
    boolean ret;

    ret = super();


    ERSCarPoolTable_ds.executeQuery();
    return ret;
    }

    }

    [Control("DateTime")]
    class ValidToFilter
    {
    /// <summary>
    //
    /// </summary>
    /// <returns></returns>


    public boolean modified()
    {
    boolean ret;

    ret = super();
    ERSCarPoolTable_ds.executeQuery();

    return ret;
    }

    }

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 41 Most Valuable Professional

#2
iampranjal Profile Picture

iampranjal 39

#3
Satyam Prakash Profile Picture

Satyam Prakash 35

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans