Notifications
Announcements
No record found.
Hi
I have below line . I want to setrange < StDate
BLLINE.SETRANGE(BLLine."Product Date",StDate);
Thanks
*This post is locked for comments
Hi,Normally the SETRANGE is used when you want the values in a range OR you want the matching values. If you want the values based on comparison, you use the SETFILTER. In your case use the SETFILTER as:
BLLINE.SETFILTER("Product Date",'< %1',StDate);Thanks
As Zaid mentioned you need to use SETFILTER in this case but not SETRANGE.
Hey,
You need to use Setfilter instead of Setrange.
That's the only difference between these two, You can give a more specific filter in Setfilter but not in Setrange, like >, <, =, |, 1..n and all.
But dont make it a common habit of using Setfilter every where use only where its utmost needed because from performance perspective its slow.
You can try below also,
BLLINE.SETRANGE(BLLine."Product Date",0D,CALCDATE('-1D',StDate);
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.