NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Johan van Zyl on October 10, 2014, 12:17:48 PM
-
PostGreSQL
I need two values:
table: brandnames
In PostInsert I have this code
Access:auditlogheader.PrimeRecord()
alh:logtimestamp_DATE = Today()
alh:logtimestamp_TIME = Clock()
alh:username = p_web.GSV('usr:userlogin') ! does not work
alh:tablename = 'brandnames'
alh:keyname = 'bra:brandnames_pkey'
alh:keyvalue = bra:brandnamesysid
OR?
alh:keyvalue = p_web.GSV('bra:brandnamesysid')
does not work
In PostUpdate alh:keyvalue = bra:brandnamesysid works just fine
How do I obtain the value bra:brandnamesysid that has has just been created by the PostGreSQL sequence.
How do I obtain the username from a normal login form?
-
I have now added this to PostInsert
p_web.FileToSessionQueue(brandnames)
but this still does not work
alh:keyvalue = clip(p_web.GSV('bra:brandnamesysid'))
-
>> How do I obtain the value bra:brandnamesysid that has has just been created by the PostGreSQL sequence.
This is a PostGres question, not a NetTalk Question. ie you do it the same way you would for a normal clarion / Postgres program.
>> How do I obtain the username from a normal login form?
In the login form you write the username into a session value, which you can then retrieve later on. ie just save the value, in the form, into a session value of your own name. (don't use a File-field name.)
cheers
Bruce
-
>> How do I obtain the value bra:brandnamesysid that has has just been created by the PostGreSQL sequence.
This is a PostGres question, not a NetTalk Question. ie you do it the same way you would for a normal clarion / Postgres program.
After inserting a Brandname in UpdateBrandnames NetWebForm I cannot "see" bra:brandnamesysid whether I put the code in PostInsert or ValidateInsert. Seems there is a difference between ABC and NTWS. I need the value to create audit log files
-
There are certainly lots of differences between ABC and NTWS. However the file management uses ABC so that should be the same.
ValidateInsert occurs before the record is written, so that's probably not helpful to you.
I would expect whatever to be set by PostInsert though. But I don't know PostGres so you may have to trace what is actually happening -
The Insert itself is done via the SaveForm method, which calls the AddFile method - which in turn calls the file manager (see the code in WebHandler, AddFile method.)
cheers
Bruce