Navigating event not impacting result value of Navigate() call


Author
Message
maturmel
maturmel
StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)
Group: Forum Members
Posts: 2, Visits: 18
Hello,

I am trying to use the Navigating event on my business object to perform row validation through the CheckRules method. I have set CheckRulesBeforeNavigate to false because I have conditions under which I do not wish to perform the check. Hence the use of the Navigating event to control whether or not I check rules.

Even though I assign e.Cancel to 'true' in the Navigating event, the Navigate() method call on the BO will still return true. I would have expected a false in such a situation, to indicate me I have broken rules. I have stepped through my code and confirm that my Navigating handler gets called and that I indeed assign e.Cancel to true.

Since I had downloaded the SF source codeBigGrin, I have taken a quick look at the Navigate() method call and think I may have put a finger on the problem: the local variable "llIndexMoved" gets initialized to True. But it's not getting reassigned to false anywhere, and the code in the branch

If Not loNavigating.Cancel Then

...

does not get called either, since I have assigned True to the Cancel property in my event handler. So at the end of your method you're entering the

If llIndexMoved Then

...

conditional even though no real index move has occuredHehe...

Any way of working around this ? Can I expect a fix ?

Thanks for your help.Smile

Marc-Andre

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search