DISPLAY MESSAGE ArithmeticOperation()

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
technopak
Posts: 287
Joined: Thu Dec 04, 2008 2:16 pm

DISPLAY MESSAGE ArithmeticOperation()

Post by technopak »

Hi,

I'm wondering is it possible to display a message showing the count of a query result ?

DISPLAY MESSAGE and COUNT BO WHERE would seem like likely constructs to use but I don't seem to be able to convert the COUNT result into a literal suitable to display in the message.

Any suggestions ?

Peter
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

How about this:

1) create attribute: SystemSettings.CountBOname
2) use a rule to keep the attribute up to date
3) refer to the attribute in your DISPLAY MESSAGE action.

Tom
technopak
Posts: 287
Joined: Thu Dec 04, 2008 2:16 pm

Post by technopak »

Thanks Tom,

I've tried your suggestion, creating a SystemSettings TestCount attribute of type number. When I try to display the default value of the TestCount attribute (which is set to 10), I get an Internal Error. The logs only show error 18 - Process Failed. I haven't ventured any further into updating the attribute at runtime until I get the basic display sorted.

I can't find any detailed documentation on the Count function, but when I create the rule in my process to display the count, the syntax (constructed by the context assistant) is DISPLAY MESSAGE SystemSettings.TestCount

Any further suggestions ?

Peter
technopak
Posts: 287
Joined: Thu Dec 04, 2008 2:16 pm

Post by technopak »

One other question - can the DISPLAY MESSAGE function be used to display attributes of a standard BO, or just the SystemSettings BO ?

I don't need my count attribute to be initialised at startup and just wonder can I use another BO attribute to hold the count ? Where the count is stored doesn't matter a lot I guess, but I might end up with various statistics relating to my system all held in a Statistics BO or something similar.
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Hmm. This works for me in a test bsv:

1) Create attribute of number type: SystemSettings.TestCount with default to 10

2) Create process with 1 rule: DISPLAY MESSAGE SystemSettings.TestCount

3) run in Test mode. Standard | System Settings | click Create button -- to initiate the Systems Settings

4) Run the process created in #2.


Also, DISPLAY MESSAGE does not care which BO is used in the calculation of the message as long as it's in context. I used SystemSettings for the test because it's always in context as long as it has been initiated.

Tom




Tom

PS -- I am running V4.1 build 1159
technopak
Posts: 287
Joined: Thu Dec 04, 2008 2:16 pm

Post by technopak »

Tom,

It's working fine now.

Just re-booted the PC and it works as designed :-)

Thanks for the info about using BOs also.

Peter
Post Reply