Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7596147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:50:56+00:00 2026-05-30T21:50:56+00:00

in my lightswitch application im trying to create a Customers Screen for customers who

  • 0

in my lightswitch application im trying to create a Customers Screen for customers who have balance value, and my balance value is a Calculated Field in the Customer Entity

when i tried to put the logic in the Process Query Event Like This

query =( from i in query

where(i.Balance>0)
select i );

i get an exception .. what is the best way to handle these kind of situations ??
i saw an answer here but i didn’t know how to implement it exactly i need a sample code for it can anyone help me ??
thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T21:50:57+00:00Added an answer on May 30, 2026 at 9:50 pm

    The query will be executed by the data provider, which doesn’t know about calculated fields. What you can do is to filter what you want via LINQ, referring to the actual fields, not the calculated ones.

    For example, let’s say Balance is your calculated field, that you defined as Credit – Debit (which are normal fields). You want your query to return the rows where Balance > 0. This is how you’d write the query (in the PreprocessQuery event, note there is no ProcessQuery event):

    partial void TestQuery_PreprocessQuery(ref IQueryable<Customer> query)
    {
        query = (
            from c in query
            where ((c.Credit - c.Debit) > 0)
            select c);
    }
    

    Another theoretical way of solving the problem would be setting a filter in the Executed event handler. However, for whatever the reason, when I do it, the filter is not applied to the screen. But even if this method would work, still you’d be filtering on the client side, which might not be what you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have small lightswitch application having CreateNewUser Screen. Screen fields comes from Datatable added
There seems to have a buzz around the Lightswitch application framework. Reading some posts/forums/articles
I have a Master/Detail screen in LightSwitch. I allow user to delete details' items.
I have a Visual studio lightswitch web application with a few screens. I want
Can I host a Lightswitch application inside of ASP.NET MVC? Thanks
I'm thinking of running unit tests for the business logic in the Lightswitch application.
I have a question: When I create my custom domain service (to consume 3rd
I would like to create a new lightswitch shell(because I need another layout than
I will have to use lightswitch for a project. I know that we can
I'm working on an asp.net application. I have a Domain assembly (containing mostly command

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.