How to clear a value in all recs but the one I'm on?

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

How to clear a value in all recs but the one I'm on?

Post by Jaymer »

I have 4 records, North, S E & West. Call this DIR for Direction.
and a yes/no field on each one.
I want to have 4 rows in a grid, and a button on each.
The button is to set that record YES (N,S,E or W), and all others NO.

I have to pass in the context for the rec I'm on.

DIR.yesno = "Yes" This correctly assigns that DIR record to Yes.

This correctly finds the "other" 3 recs:
FIND DIR WHERE DIR <> this.DIR IN BATCHES OF 1

but
DIR.yesno = "No" does not execute correctly.

Using LOG2 CONTEXT and the Logger, I can see that the Original Passed in DIR is still in Context, PLUS the 3 that were found.
Each of the 3 iterations operates on
a) the original passed in DIR, and
b) the "other" 3 records, 1 in each pass.

I can't seem to shake that 1st DIR record that already got set to "Yes", and now gets set back to "No' (3 times in fact).
confused.

--> JaymerTip
Last edited by Jaymer on Sat Feb 29, 2020 1:55 am, edited 1 time in total.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
BenHayat
Posts: 2749
Joined: Thu Dec 23, 2010 5:48 am
Location: Fla, USA
Contact:

Re: How to clear a value in all recs but the one I'm on?

Post by BenHayat »

A long time ago, maybe 3 years ago I ran into something like that. If my memory served me right, you need to have a separate process when you're making the update. Another words, you need to create a loop that for each loop Aware creates a process, updates the record, commits the record and closes the process and goes to next record. The update process will then run 4 time after the Batches of 1.

I have kinks of forgotten simulating loops in Aware, but I did it and works.
aware_support
Posts: 7523
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: How to clear a value in all recs but the one I'm on?

Post by aware_support »

OtherDIR.yesno = "No"
Aware IM Support Team
Post Reply