Guillaume,

I cannot say for certain where - it's sort of ingrained in me for years
(just like muscle memory), and I lived by that knowledge. I'm not saying it
is accurate, and I have never used it myself in filters or escalations, but
if ever I had the need to I would have assuming that's the way it works.

Personally if count(*) or as you pointed out count(column) is what I prefer
to use too as that way you know for sure where that count is coming from,
and plus I would think (not verified - but sounds logically right) that it
escapes at least one API call, as direct SQL do not care what you pass in
the statement and assume the statement to be correct and passes it directly
to the database to be executed and bring back the result.. Single API call..
Most other functions that populate LASTCOUNT probably would need more than a
single API call to generate that result..

Joe

-----Original Message-----
From: Action Request System discussion list(ARSList)
[mailto:arsl...@arslist.org]on Behalf Of Guillaume Rheault
Sent: Monday, April 19, 2010 1:49 PM
To: arslist@ARSLIST.ORG
Subject: Re: $LASTCOUNT$ on filters (was: need to design a counter)


hey Joe, 

where did you get the information about being the last count performed by a
transaction for a particular user? the ARS documentation is not that
specific...
My understanding, and I could be wrong, is that it is the last count
performed by the last transaction, regardless of the user...; I think it is
similar to a global variable in a programming language. 
In the user tool or mid-tier/browser, it would be the last count for that
user of course, but on the server, what would it be, since filters run by
definition with administrative privileges (i.e. without user context)

I am pretty sure too the ITSM 7.x application does not use $LASTCOUNT$ in
filters, only in active links. If there is some OOTB ITSM filter out there
that uses it, it could either be a left over from a previous version, or
it's a new developer at BMC that didn't get the memo on not using
$LASTCOUNT$ on filters  :-)

Guillaume

________________________________________
From: Action Request System discussion list(ARSList) [arsl...@arslist.org]
on behalf of Joe D'Souza [jdso...@shyle.net]
Sent: Monday, April 19, 2010 1:33 PM
To: arslist@ARSLIST.ORG
Subject: Re: $LASTCOUNT$ on filters (was: need to design a counter)

Let me try taking a shot at this..

$LASTCOUNT$ is a AR System keyword that stores the last count performed by a
transaction for that particular user.

So the last count is the count of records from the last table a search had
been performed on by that user. Like you I have never used it on Filters, as
I've always had the need for it from an AL. But I'm wondering why it should
be any different on a Filter or an Escalation than it is on an Active Link.

Joe

-----Original Message-----
From: Action Request System discussion list(ARSList)
[mailto:arsl...@arslist.org]on Behalf Of Guillaume Rheault
Sent: Monday, April 19, 2010 10:33 AM
To: arslist@ARSLIST.ORG
Subject: $LASTCOUNT$ on filters (was: need to design a counter)


Hi Misi,

My understanding is that it is not recommended to use $LASTCOUNT$ on
filters, only in active links, because the $LASTCOUNT$ on a filter will be
set for the last filter action that executed at that point in time, which
may not be the one that just preceded it. This is specially true were you
have many fast and list servers, so the probability of this problem
happening is even greater....

Again that's my understanding, so I could be wrong. So therefore anytime
that I need to count for records, I prefer to use the select count(*), or
even better select count(request_id)  or select count(rowid) on oracle
databases.
I only use the $LASTCOUNT$ keyword on active links, since active links
actions are always serially executed as you know.

Maybe somebody at BMC (Doug or David Easter) can confirm what actually
happens with $LASTCOUNT$ on a filter in an a server that has multiple fast
and list servers configured and many operations are always executing, either
by the system (escalations, assignment engine, approval server, etc) or by
users.

For more than 10 years, I have never gotten a clear answer on this issue.
Plus of course the internal ARS design may have changed between ARS
versions, so whatever somebody thought was true  on ARS 4.0 may have been
incorrect in ARS 6.0

Guillaume

________________________________________
From: Action Request System discussion list(ARSList) [arsl...@arslist.org]
on behalf of Misi Mladoniczky [...@rrr.se]
Sent: Friday, April 16, 2010 5:12 AM
To: arslist@ARSLIST.ORG
Subject: Re: need to design a counter

Hi,

Why not keep away from direct-sql when it is not absolutely neccessary?

FLTR
  ACTION
    SET-FIELDS from FormX ('1' > "0")
      myResult = $1$
  ACTION
    SET-FIELDS from CURRENT TRANSACTION
      myResult = $LASTCOUNT$

Best Regards - Misi, RRR AB, http://www.rrr.se

Products from RRR Scandinavia:
* RRR|License - Not enough Remedy licenses? Save money by optimizing.
* RRR|Log - Performance issues or elusive bugs? Analyze your Remedy logs.
Find these products, and many free tools and utilities, at http://rrr.se.

> Raj,
>
> What is the reason you need that counter? Just to have a total count of
> tickets in form 1?? Or is there another reason?
>
> If you just want a count, I wouldn't create a form. I would have a hidden
> field that did a select count(*) from whatever view name that table has in
> the underlying database..
>
> Cheers
>
> Joe
>
> -----Original Message-----
> From: Action Request System discussion list(ARSList)
> [mailto:arsl...@arslist.org]on Behalf Of Raj
> Sent: Thursday, April 15, 2010 8:04 PM
> To: arslist@ARSLIST.ORG
> Subject: need to design a counter
>
>
> Hello all,
> There is an integer field on form1.
> need to design a counter which increments the count by one for every
> submit on form2.
> So, need to write a filter on submit of form 2 which increments the
> integer field on form 1 by 1 for every submit on form 2.please advise.
> thanks,
> Raj

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug10 www.wwrug.com ARSlist: "Where the Answers Are"

Reply via email to