NetTalk Central

Author Topic: How to determine if Form is in View mode  (Read 968 times)

Johan de Klerk

  • Full Member
  • ***
  • Posts: 214
  • Johan de Klerk
    • View Profile
    • Designer Software
How to determine if Form is in View mode
« on: September 12, 2023, 04:09:47 AM »
Hi,

Clarion Ver: 10.0.12799
NetTalk Ver.: 11.57

This has been driving me nuts for a full day now.

In my PreUpdate  Routine in the embed after ! Start of Pre Update After Primes" I have code to check if the Form is in View mode.
IF Loc:ViewOnly = TRUE
    p_web.SSV('Loc:MessageDisplayMessage','Record in View Mode ? No Editing Allowed')
    ! Assign correct values from Related Tables
ELSE
    p_web.SSV('Loc:MessageDisplayMessage','Please Change Fields as Required')
    ! Clear Certain Fields to force new values
END

I have put debug statements in the embed to check the values of:
Loc:ViewOnly
loc:action
loc:act

When I click on the InLIne View Button on the Browse my code runs 3 times in this embed.
This is the results from the Debug statements:
Loc:ViewOnly = 1
loc:action = View
loc:act = 5
Loc:ViewOnly = 1
loc:action = View
loc:act = 5
Loc:ViewOnly = 0
loc:action = Change
loc:act = 2
It changes from View to Change so it is messing up my code.

I would appreciate if someone can put me on the right track.

Regards
Johan de Klerk
« Last Edit: September 12, 2023, 04:11:23 AM by Johan de Klerk »
Clarion 10, NT 11.57

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11186
    • View Profile
Re: How to determine if Form is in View mode
« Reply #1 on: September 13, 2023, 02:34:24 AM »
you'd have to follow the code to see I'm afraid. I can't really comment on the specifics of stuff in NetTalk 11 at this point. Sorry.

If you want to make an example, I can test it in NT 14 if you like.

Cheers
Bruce