NetTalk Central

Recent Posts

Pages: 1 [2] 3 4 ... 10
11
Web Server - Ask For Help / Re: File Upload button on MemForm
« Last post by Bruce on May 27, 2024, 08:57:09 PM »
Very possible Jeff - make an example and post here.
12
Web Server - Ask For Help / Re: Old wizard
« Last post by Bruce on May 27, 2024, 08:52:48 PM »
thanks
13
Web Server - Ask For Help / Re: GUID Question
« Last post by Bruce on May 27, 2024, 08:51:54 PM »
>> A .Net developer told me that the GUID should ideally be 32 characters.

He's likely referring to the UID version 4 format.
https://en.wikipedia.org/wiki/Universally_unique_identifier
which is a 16 byte string (but often represented as 32 hex digits, with some colons.) (16 character alphabet, 0-9 and a-f)
These have about 121 bits of randomness (aka "entropy")

The Guids we tend to use in Clarion are also 16 chars long, but because it's easier to deal with text values, the alphabet is restricted to 36 characters (0-9 and A-Z). This results in approximately 83 bits of entropy.

So yes, a UIDv4 has more bits of entropy, and can hold more values than the Guid you are using. However it is harder to deal with as it can contain binary values, so needs to continually be encoded and decoded when moving to a text form.

The risk of a collision is n / 2^82 where n is the number of records in your table. (Not in the database, in the table.) If you feel that this value rises to unacceptably high levels then you can increase the length of the string, or the size of the alphabet. I would suggest this is a useful thing to do when you are expecting around 4 835 703 278 458 516 698 records - at which point the risk of a collision would be about 1 in a million.



14
Web Server - Ask For Help / Re: Partial Save - Success or Fail?
« Last post by rjolda on May 26, 2024, 04:44:43 PM »
HI Johan,
See my reply to your previous post on partial Save.  I would guess that the Form template is doing an Insert when "Partial Save" is requested.  At that point, the Server Values are written to the record and a GUID for this new record is generated.  The Server would then "read the record that was just Inserted" and put the fields into Server Values.  There, you should find the GUID of the inserted Record and you could manually test it.  I don't know about the actual code but it might return a message that the INSERT failed? 
I would look at the code and see what Bruce is doing at the time of INSERT and how it handles any errors.
Ron
15
Web Server - Ask For Help / Re: Partial Save?
« Last post by rjolda on May 26, 2024, 12:38:09 PM »
Johan,
I constantly get stuck with this - Bruce keeps correcting me.  So here is it.  There is NO FORM!  It does NOT EXIST!.  So, when user is on "Same FORM" - that really does NOT MEAN ANYTHING!. 
Bruce said "Think of the Form as a series of EVENTS" - User sends a Request EVENT to server and Server Responds.  Then the connection is CLOSED.  If you open a form, THe record is read into SESSION variables and the Record itself is GONE!.  So,  Everything you do is an EVENT.  Because the SESSION ID is passed back and forth between the User ( Browser ) and Server, the SERVER VALUES are always accessible by SessionID - the record itself is NOT available. At the End of the form - when you press SAVE or DONE - the Server is instructed to fetch the record and update it with the ServerValues for that session ID.  Does that make sense?
I am doing some things like your user.  I am pulling out a record and putting some settings in it.  Then the user ( still on the same MemForm) is pressing buttons to do different actions.  For each of these actions, I have to take their new values, Stuff them into the Session Values, fetch the record and write them to the record itself. 
In other words, the Session Values are the thing that the user is interacting with ( as a representation of the record itself..).  Therefore if you are going to do a partial save, Update the Session variables.  At this point I am going to fetch the record and write the values directly to the record and update it without using the p_web.recordtovalue and p_web.Values to Record functions.  (Not sure that these are the correct names but they are in the p_web settings.  i will keep the Session values updated as they are the "representative state" of the "record".   At the end, I could to a values to record save but I might just roll my own and update the fields that i want.
Since the Updates to the record are under YOUR CONTROL in the EMBEDS  - you can check to make sure that your data got written to the record with the
If not Access:File.Update() = Level:Benign
  then ALERT USER.
You can also use the Access:File.tryUpdate() function.
Hope that this explanation helps you.
Ron
16
Web Server - Ask For Help / Partial Save - Success or Fail?
« Last post by JohanR on May 26, 2024, 12:18:49 PM »
Hi,

How would I know if the partial save was a success or failed?

thanks

Johan


17
Web Server - Ask For Help / Re: Partial Save? (extra info)
« Last post by JohanR on May 25, 2024, 06:50:00 AM »
Hi,

Further info , this works if the field you're changing is on the page.

   ord:special_instructions = 'Partial save2222'
   p_web.SetValue('ord:special_instructions',ord:special_instructions)

if the field that your changing is not on the page, then you have to set the session variable as well.

   ord:special_instructions = 'Partial save2222'
   p_web.SSV('ord:special_instructions',ord:special_instructions)
   p_web.SetValue('ord:special_instructions',ord:special_instructions)

regards

Johan

18
Web Server - Ask For Help / Re: Partial Save?
« Last post by JohanR on May 25, 2024, 06:33:15 AM »
Hi Ron

Thanks,
but am using buttons on the form to save the form but leave it open, or if it was inserted will save and convert to a change record situation.
Very useful.

eg.
User is doing a quote in insert mode, and if he's happy , converts the quote to a confirmed order.
This way the user can confirm, and keep editing and update the other required information without leaving the page, name, address etc..but the order has been confirmed and saved.
Or he decides to add to to next the despatch , and don't want that add to happen with a record that is in insert mode.


regards

Johan



19
Web Server - Ask For Help / Re: Partial Save?
« Last post by rjolda on May 25, 2024, 02:16:17 AM »
Johan,
What are you working with - a Form or MemForm?
There are several methods available for Before writing to file and after writing to file.  Make sure your code is in the Before writing to file.
Ron
20
Web Server - Ask For Help / Re: Old wizard
« Last post by osquiabro on May 24, 2024, 06:57:06 AM »
by the way the login wizard generate LevelBenign without :
Pages: 1 [2] 3 4 ... 10