Record iteration

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
franko200ng
Posts: 10
Joined: Fri May 22, 2009 10:49 am

Record iteration

Post by franko200ng »

Hi,

I want to display published adverts in my application. I want to use 'Display Message' tag to show the advert. My problem is that when I use FIND action, it does not display the records sequentially. It just shows the first record on top of the stack.

I am wondering if I can find any trick or tips to achieve this. Please help
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

What do you mean by "sequentially"? You need to sort records using ORDER BY in order to display them in the order you want
Aware IM Support Team
franko200ng
Posts: 10
Joined: Fri May 22, 2009 10:49 am

refined iteration record

Post by franko200ng »

I believe that my post was not clear enough.

Firstly, I want to use MESSAGE DISPLAY ASYNCH tag to display adverts.

Secondly, when I use FIND to fetch records, it only displays the first record it fetches from the database.

How can I iterate through the fetched records so that it can display the records one after the other?
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

Take a look at how this is done in the CRM sample application - it does exactly what you need, i.e. displays adverts
Aware IM Support Team
franko200ng
Posts: 10
Joined: Fri May 22, 2009 10:49 am

Post by franko200ng »

I have already looked at CRM and Library apps. The messages are hardcoded. I am fetching the messages from the database and I want to iterate through them and display them accordingly.
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

Store messages in the database as objects with attributes. One attribute will be a message and another one - sequence order of the message. Remember the current sequence order in some other object somewhere and then each time increment the sequence order and only retrieve the message for the current order number.

This idea is implemented in the CRM app. You just need to take the idea on board and implement it properly.
Aware IM Support Team
Post Reply