Count Items in Context Only

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
PointsWell
Posts: 1460
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Count Items in Context Only

Post by PointsWell »

Is there a way to count only the items that are in Context or do I have to count all the BOs based on the criteria that I had them in Context?
rocketman
Posts: 1252
Joined: Fri Jan 02, 2009 11:22 pm
Location: Preston UK
Contact:

Re: Count Items in Context Only

Post by rocketman »

Immediately after the find try interrogating SEARCH_COUNT

It can be useful to stop unnecessary processing if the search doesn't find anything

IF SEARCH_COUNT >0 THEN .......

and if you need to persist the number during the process , try stuffing into a non persisting Bo Attribute because the number will change the next time you do a find on another BO

So CREATE NPBO WITH NPBO.Attribute1 = SEARCH_COUNT
Last edited by rocketman on Thu Oct 26, 2017 11:33 am, edited 1 time in total.
Rocketman

V8.7 Developer Edition. Server 2016 Standard edition. MySql 5.5
PointsWell
Posts: 1460
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Count Items in Context Only

Post by PointsWell »

Brilliant. Thank you.
Post Reply