This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Pages: [1]
1
The Rest - Ask For Help / Nettalk WebClient - ErrorTrap questions
« on: July 19, 2017, 06:40:05 PM »
Hi, my Question is - Does the NetTalk Errortrap reset the timer to zero? If so, this might stop timer events in my service.
- Subsequent found ErrorTrap - after parent, if an abort is issued (or indeed if it is not issued) then post event:CloseWindow - leaves the window open. Is there some other interrupt required after the Event:Closewindow to give control to the window so it may close?
Situation
A SOAP client service that has been running 24/7 has begun trapping an open timeout error
"Errorcode:-53 - The requested connection could not be opened. The Open command timed out or failed to connect NetSimple.TakeEvent" which then seems to prevent timer events.
The basic logic in Main (Service with Winevent) is
Session=No
Set timer to 10 secs
In Timer Event
If session = No - - set session = yes - Call Session - set session to no
else ignore timer event.
end
Session Procedure using Nettalk Web Client
Open URL - Async
net.AsyncOpenUse = 1 ! Use AsyncOpen 12 seconds (recommended)
net.AsyncOpenTimeOut = 1200 ! Up to 12 seconds to connect
net.InActiveTimeout = 6000 ! Set IdleTimeout 60 seconds
Check for Post error - NONE
PageReceived - does necessary stuff
ErrorTrap Proc
SaveErr = net.error()
Log error - logs OK
Call Proc to Email error using Nettalk Email - never turns up
ErrorTrap.Parent
If SaveError =53 - Open timeout
self.abort
end
Post Event:CloseWindow
-------
Window remains open.
Thanks
- Subsequent found ErrorTrap - after parent, if an abort is issued (or indeed if it is not issued) then post event:CloseWindow - leaves the window open. Is there some other interrupt required after the Event:Closewindow to give control to the window so it may close?
Situation
A SOAP client service that has been running 24/7 has begun trapping an open timeout error
"Errorcode:-53 - The requested connection could not be opened. The Open command timed out or failed to connect NetSimple.TakeEvent" which then seems to prevent timer events.
The basic logic in Main (Service with Winevent) is
Session=No
Set timer to 10 secs
In Timer Event
If session = No - - set session = yes - Call Session - set session to no
else ignore timer event.
end
Session Procedure using Nettalk Web Client
Open URL - Async
net.AsyncOpenUse = 1 ! Use AsyncOpen 12 seconds (recommended)
net.AsyncOpenTimeOut = 1200 ! Up to 12 seconds to connect
net.InActiveTimeout = 6000 ! Set IdleTimeout 60 seconds
Check for Post error - NONE
PageReceived - does necessary stuff
ErrorTrap Proc
SaveErr = net.error()
Log error - logs OK
Call Proc to Email error using Nettalk Email - never turns up
ErrorTrap.Parent
If SaveError =53 - Open timeout
self.abort
end
Post Event:CloseWindow
-------
Window remains open.
Thanks
2
Web Server - Ask For Help / Re: a way to restrict form fields automaticly validated
« on: April 14, 2014, 04:12:34 PM »
Hi Bruce
Thanks for the clarification re validation. There is still something happening I can't sort out.
Not all validation seems to be generated In the BCx file for both the win app in C8, even though the DCT fields are defined exactly alike.
Example:
Hide:Access:OS4perma.ValidateFieldServer PROCEDURE(UNSIGNED Id,BYTE HandleErrors):
the BCT generates checks for 5 fields defined as s(3) with Must be in list No|Yes with string radio options defined without values. But it does not generate code for other fields that are defined in exactly the same way - Why would this be?
Example code generated a field:
OF 34
GlobalErrors.SetField('Incident Investigated [No/Yes]')
IF INSTRING(']' & CLIP(OS4:Investigated) & '[', ']No[]Yes[', 1, 1) = 0
ReturnValue = Level:Notify
END
IF ReturnValue <> Level:Benign
IF HandleErrors
ReturnValue = GlobalErrors.ThrowMessage(Msg:FieldNotInList,'''No'',''Yes''')
END
END
But in the same file OS4:Shift (s10) Must me in list: Day|Afternoon|Night
- nothing generated.
and another OS4:CouldHaveBeenSerious (S3) Must be in list: No|Yes (no values)
So I guess my questions are:
1. In a win app/web app when is validity checking generated in in the BCx's?
2. In a win app Is each field verified when the record is added/updated or only if the field is touched?
3. From what you say each field is verified in a NT app due to the dynamic nature of the three form passes so validation does not fail at the update record stage but does a win app actually enforce DCT validation if an Option field is not touched?
Cheers
Kevin
Thanks for the clarification re validation. There is still something happening I can't sort out.
Not all validation seems to be generated In the BCx file for both the win app in C8, even though the DCT fields are defined exactly alike.
Example:
Hide:Access:OS4perma.ValidateFieldServer PROCEDURE(UNSIGNED Id,BYTE HandleErrors):
the BCT generates checks for 5 fields defined as s(3) with Must be in list No|Yes with string radio options defined without values. But it does not generate code for other fields that are defined in exactly the same way - Why would this be?
Example code generated a field:
OF 34
GlobalErrors.SetField('Incident Investigated [No/Yes]')
IF INSTRING(']' & CLIP(OS4:Investigated) & '[', ']No[]Yes[', 1, 1) = 0
ReturnValue = Level:Notify
END
IF ReturnValue <> Level:Benign
IF HandleErrors
ReturnValue = GlobalErrors.ThrowMessage(Msg:FieldNotInList,'''No'',''Yes''')
END
END
But in the same file OS4:Shift (s10) Must me in list: Day|Afternoon|Night
- nothing generated.
and another OS4:CouldHaveBeenSerious (S3) Must be in list: No|Yes (no values)
So I guess my questions are:
1. In a win app/web app when is validity checking generated in in the BCx's?
2. In a win app Is each field verified when the record is added/updated or only if the field is touched?
3. From what you say each field is verified in a NT app due to the dynamic nature of the three form passes so validation does not fail at the update record stage but does a win app actually enforce DCT validation if an Option field is not touched?
Cheers
Kevin
3
Web Server - Ask For Help / a way to restrict form fields automaticly validated
« on: April 13, 2014, 02:21:21 PM »
Is there an option to restrict automatic file field verification to only the only file fields used on a form rather than all fields. For example in a Clarion app field validation is only applied to fields actually on the screen. NT generates checks all fields in the file.
This occurs when a file record is optimised and may represent multiple options. In C9 you can set fields required for each option in the DCT and not populate, hide or disable the fields depending on which option is selected, maybe during input, and they will be omitted from validation.
Cheers for any suggestions.
This occurs when a file record is optimised and may represent multiple options. In C9 you can set fields required for each option in the DCT and not populate, hide or disable the fields depending on which option is selected, maybe during input, and they will be omitted from validation.
Cheers for any suggestions.
4
Web Server - Ask For Help / NT vs DCT radio string choices with embedded quote
« on: April 13, 2014, 02:10:41 PM »
Hi, There is a difference in the way NT handles DCT string choices with an embedded quote and the way the C9 app handles them in the dictionary and designer/app generator.
C9 DCT allows a list choice (radio button) to have a value containing a single quotation (it must generate a double quote internally) so the variable use string contains a value with a single quote.
When NT generates the automatic validation it sticks to the rules requiring double quotes to represent one quote (because it is dealing with strings) so the valid C9 app DCT generates invalid automatic validation code.
Example:
In C9 DCT: Choices are coded as: Employer|Employer's Representative|Principal|Self Employed
This is a text field without a value specified. Designer's text property for the 2nd radio button is : Employer's Representative.
In NT the automatic validation generates
! Automatic Dictionary Validation
If InList ( clip ( OS4 : ReportCompletedByRepresenting ) , 'Employer' , 'Employer's Representative ','Principal ',' Self Employed ' ) = 0
loc : Invalid = 'OS4:ReportCompletedByRepresenting'
if not loc : alert then loc : Alert = p_web . translate ( 'OS4:ReportCompletedByRepresenting' ) & ' ' & clip ( p_web . site . InListText ) & p_web . _jsok ( ' Employer, Employer's Representative, Principal , Self Employed ').
!exit
End
Which generates an error.
I resolved this by substituting a <39> in the DCT string and both NT and Clarion handle this. Is there another way?
Thanks
C9 DCT allows a list choice (radio button) to have a value containing a single quotation (it must generate a double quote internally) so the variable use string contains a value with a single quote.
When NT generates the automatic validation it sticks to the rules requiring double quotes to represent one quote (because it is dealing with strings) so the valid C9 app DCT generates invalid automatic validation code.
Example:
In C9 DCT: Choices are coded as: Employer|Employer's Representative|Principal|Self Employed
This is a text field without a value specified. Designer's text property for the 2nd radio button is : Employer's Representative.
In NT the automatic validation generates
! Automatic Dictionary Validation
If InList ( clip ( OS4 : ReportCompletedByRepresenting ) , 'Employer' , 'Employer's Representative ','Principal ',' Self Employed ' ) = 0
loc : Invalid = 'OS4:ReportCompletedByRepresenting'
if not loc : alert then loc : Alert = p_web . translate ( 'OS4:ReportCompletedByRepresenting' ) & ' ' & clip ( p_web . site . InListText ) & p_web . _jsok ( ' Employer, Employer's Representative, Principal , Self Employed ').
!exit
End
Which generates an error.
I resolved this by substituting a <39> in the DCT string and both NT and Clarion handle this. Is there another way?
Thanks
5
Web Server - Ask For Help / How to move a wizard-generated-generated form field to another tab?
« on: April 07, 2014, 02:58:15 PM »
Hi, Can I move a form field in one tab to another in NT8 without changing the dictionary - or must it be deleted and re-inserted as a field within the new tab. Cheers.
Pages: [1]