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.
31
Web Server - Ask For Help / Re: Remove file name from File Upload
« on: January 10, 2023, 07:37:36 PM »
>> I can't even figure out where in the code this table is created, or how to add my own css to it.
The table is created inside jquery.nt-upload.js
It is an actual HTML Table, with the css class
nt-upload-table.
so you can easily add your own custom CSS using this class as a selector, and then hide things or whatever.
The filename inside the table is populated around line 341 in the javascript, from file.name
Cheers
Bruce
The table is created inside jquery.nt-upload.js
It is an actual HTML Table, with the css class
nt-upload-table.
so you can easily add your own custom CSS using this class as a selector, and then hide things or whatever.
The filename inside the table is populated around line 341 in the javascript, from file.name
Cheers
Bruce
32
Web Server - Ask For Help / Re: Secwin7 multitenant How to get the Tenant name ?
« on: January 09, 2023, 11:03:23 PM »
for build 7.42 I've added a
SecwinCurrentUser.GetCompany()
method.
This returns the "company" field from the SecwinSettings Table.
SecwinCurrentUser.GetCompany()
method.
This returns the "company" field from the SecwinSettings Table.
33
Web Server - Ask For Help / Re: Record displaying in NetWebBrowse only after Refresh (F5)
« on: January 08, 2023, 10:09:06 PM »
Hi Sean,
I suggest you start a new thread, and if possible post an example.
Cheers
Bruce
I suggest you start a new thread, and if possible post an example.
Cheers
Bruce
34
E-Mail - Ask For Help / Re: NetTalk version upgrade problem. Possible regression bug
« on: January 08, 2023, 10:07:09 PM »
I've been on leave Rob, I'll dig through the emails this week.
Cheers
Bruce
Cheers
Bruce
35
Web Server - Ask For Help / Re: DROP field - Add Selected Record Fields to Session Values
« on: January 01, 2023, 10:39:02 PM »
>> Problem is theres never any situation in which we need to change or to some calculation inside the loop of the view,
That doesn't sound like a problem. Clearly I'm not going to remove the embed points just because _you_ don't find them useful? So I'm not sure what you are asking me to do there
>> If its possible, it will be very useful to add the template the feature to save the view values in the session (when selected) to be used in the server side code.
If you need to set additional values aftr a Drop item is selected, then the correct place to embed the code is in validate::somefield routine
The following code should be sufficient;
p_web.SetValue('primarykeyfieldname',somevalue)
p_web.LoadRecord(tablename, primarykeyname)
p_web.FileToSessionQueue(tablename)
for example;
p_web.SetValue('cus:guid',p_web.GSV('inv:Customerguid'))
p_web.LoadRecord(customer, cus:guidkey)
p_web.FileToSessionQueue(Customer)
This has nothing to do with additional View fields. And you should not use Additional View fields for this purpose. I recommend you don't add to the Additional View Fields unless you want to use the field in an expression, or embed point, as discussed earlier.
this might become a template option in NT14, but I'm not adding things to NT12 at this point.
That doesn't sound like a problem. Clearly I'm not going to remove the embed points just because _you_ don't find them useful? So I'm not sure what you are asking me to do there

>> If its possible, it will be very useful to add the template the feature to save the view values in the session (when selected) to be used in the server side code.
If you need to set additional values aftr a Drop item is selected, then the correct place to embed the code is in validate::somefield routine
The following code should be sufficient;
p_web.SetValue('primarykeyfieldname',somevalue)
p_web.LoadRecord(tablename, primarykeyname)
p_web.FileToSessionQueue(tablename)
for example;
p_web.SetValue('cus:guid',p_web.GSV('inv:Customerguid'))
p_web.LoadRecord(customer, cus:guidkey)
p_web.FileToSessionQueue(Customer)
This has nothing to do with additional View fields. And you should not use Additional View fields for this purpose. I recommend you don't add to the Additional View Fields unless you want to use the field in an expression, or embed point, as discussed earlier.
this might become a template option in NT14, but I'm not adding things to NT12 at this point.
36
Web Server - Ask For Help / Re: web and secwin 7 and menus not hiding
« on: January 01, 2023, 10:22:46 PM »
>> If, due to security, a top level menu has no items, should it also hide?
>> It seems the bubbling of security does not go up to the menu level?
I believe this is true. Bubbling applies to menu item, not whole menus (at this time.)
cheers
Bruce
>> It seems the bubbling of security does not go up to the menu level?
I believe this is true. Bubbling applies to menu item, not whole menus (at this time.)
cheers
Bruce
37
Web Server - Ask For Help / Re: Larges Reports on NT
« on: January 01, 2023, 10:21:49 PM »
>> i missed tell you that i use the start button,
an important detail, but definitely a good idea.
>> but after report process start all other transaction said Slow Request: [760] and really is very slow, only when a appear pdf window generating the web server return to a normal.
That doesn't surprise me, and will depend largely on the hardware, and database you are using.
Naturally a big report will work hard on the database engine. It will also likely consume a bunch of CPU on the server, especially if you have code in the report itself. And being large it will have a fair amount of disk activity as it writes the WMF files. Then once the WMF files have been constructed, they need to be loaded, joined, and converted into a PDF. This will all take significant work.
If you have a machine with limited CPU power (perhaps a VM with only one core) then all the other code will run slowly. If you have a serialized, or slow, connection to the database then any other requests talking to the database will be slower. If the database is running on the same (underpowered?) server machine then naturally everything slows down.
Incidentally a "slow request" is only posted once the request has been completed. So it would seem your server is still serving - just slowly.
an important detail, but definitely a good idea.
>> but after report process start all other transaction said Slow Request: [760] and really is very slow, only when a appear pdf window generating the web server return to a normal.
That doesn't surprise me, and will depend largely on the hardware, and database you are using.
Naturally a big report will work hard on the database engine. It will also likely consume a bunch of CPU on the server, especially if you have code in the report itself. And being large it will have a fair amount of disk activity as it writes the WMF files. Then once the WMF files have been constructed, they need to be loaded, joined, and converted into a PDF. This will all take significant work.
If you have a machine with limited CPU power (perhaps a VM with only one core) then all the other code will run slowly. If you have a serialized, or slow, connection to the database then any other requests talking to the database will be slower. If the database is running on the same (underpowered?) server machine then naturally everything slows down.
Incidentally a "slow request" is only posted once the request has been completed. So it would seem your server is still serving - just slowly.
38
Web Server - Ask For Help / Re: DROP field - Add Selected Record Fields to Session Values
« on: December 28, 2022, 10:09:44 PM »
Hi Guys,
Firstly - if you want to understand what the template is doing, then it's always a good idea to look at the generated code in the embeditor. Familiarity with that code makes embedding easier, because you know what is happening where.
Adding fields to the VIEW means that while the view is looping through record, those fields are primed from the database. So in order to understand where they are useful it's good to see the generated code surrounding that view.
In the following walkthough, I changed a "lookup customer" string field to be a drop. (Books(71) example, UpdateInvoices procedure).
First the VIEW declaration;
INV:Customer_OptionView View(Customer)
Project(CUS:ID)
Project(Cus:Name)
! Start of "Custom View Code"
! End of "Custom View Code"
End
As you can see the View declaration also includes an embed point for adding more information like more fields, JOINS and so on.
Then search for it's use;
In
Value::INV:Customer Routine
open(INV:Customer_OptionView)
Loc:Filter.SetValue('')
INV:Customer_OptionView{prop:filter} = p_web.AssignFilter(loc:Filter.GetValue())
INV:Customer_OptionView{prop:order} = p_web.CleanFilter(INV:Customer_OptionView,'UPPER(Cus:Name)')
! Start of "Option Filter & Order"
! End of "Option Filter & Order"
Set(INV:Customer_OptionView)
Loop
Next(INV:Customer_OptionView)
If ErrorCode() then Break.
You can see the view is opened here, and looped through, and so on. So in these embeds the field values are in scope.
Alberto, this is where you can add embed code for these values.
Cheers
Bruce
Firstly - if you want to understand what the template is doing, then it's always a good idea to look at the generated code in the embeditor. Familiarity with that code makes embedding easier, because you know what is happening where.
Adding fields to the VIEW means that while the view is looping through record, those fields are primed from the database. So in order to understand where they are useful it's good to see the generated code surrounding that view.
In the following walkthough, I changed a "lookup customer" string field to be a drop. (Books(71) example, UpdateInvoices procedure).
First the VIEW declaration;
INV:Customer_OptionView View(Customer)
Project(CUS:ID)
Project(Cus:Name)
! Start of "Custom View Code"
! End of "Custom View Code"
End
As you can see the View declaration also includes an embed point for adding more information like more fields, JOINS and so on.
Then search for it's use;
In
Value::INV:Customer Routine
open(INV:Customer_OptionView)
Loc:Filter.SetValue('')
INV:Customer_OptionView{prop:filter} = p_web.AssignFilter(loc:Filter.GetValue())
INV:Customer_OptionView{prop:order} = p_web.CleanFilter(INV:Customer_OptionView,'UPPER(Cus:Name)')
! Start of "Option Filter & Order"
! End of "Option Filter & Order"
Set(INV:Customer_OptionView)
Loop
Next(INV:Customer_OptionView)
If ErrorCode() then Break.
You can see the view is opened here, and looped through, and so on. So in these embeds the field values are in scope.
Alberto, this is where you can add embed code for these values.
Cheers
Bruce
39
Web Server - Ask For Help / Re: Larges Reports on NT
« on: December 27, 2022, 09:34:58 PM »
You could do something as simple as
a) have a button on a page
b) call START to start a thread when that button is pressed.
Or better yet, for the code under the button just
a) call p_web.ReplyComplete()
b) call the report procedure.
Incidentally, there's a button type that does this for you, called a START button.
Cheers
Bruce
a) have a button on a page
b) call START to start a thread when that button is pressed.
Or better yet, for the code under the button just
a) call p_web.ReplyComplete()
b) call the report procedure.
Incidentally, there's a button type that does this for you, called a START button.
Cheers
Bruce
40
Web Server - Ask For Help / Re: DROP field - Add Selected Record Fields to Session Values
« on: December 26, 2022, 10:16:29 PM »
Hi David,
I'm not really sure what you are asking - but no, It's not like the whole view record (from a drop) is saved to a session value. The Unique ID is saved, from there you can lookup whatever you need.
If you have something specific in mind, or are unsure, then make an example showing the effect you are chasing and I can be more explicit on what you might do to achieve that effect.
Cheers
Bruce
I'm not really sure what you are asking - but no, It's not like the whole view record (from a drop) is saved to a session value. The Unique ID is saved, from there you can lookup whatever you need.
If you have something specific in mind, or are unsure, then make an example showing the effect you are chasing and I can be more explicit on what you might do to achieve that effect.
Cheers
Bruce
41
Web Server - Ask For Help / Re: Web Service question, part 2
« on: December 22, 2022, 09:28:37 PM »
Hi Jeff,
embedding users and passwords in code is not ideal, because then you need to start worrying about who can see that code.
Like for example if this code is committed into source control, especially public source control, then it would be an issue.
But for compiled programs, with minimal or no distribution of source code it's ok.
Base64 encoding the user name or password serves no purpose. The value will already be base64 encoded by the Authenticate command.
Obviously you can only use Basic Authentication against an HTTPS, not HTTP server, as the password and username are in plaintext in the header.
>> 2. Is this technique, using a username and password to access a web service/API, the preferred way?
it's not preferred more or less than anything else. It's a perfectly good way, and commonly used. It's completely supported by NetTalk. There are other ways to do Auth, this is just one, and a perfectly good one (as long as HTTPS is in play).
>> I use another unrelated API, where I send a key/code to the API.
key / code == user/password - same thing, different names.
>> I'm not sure how or if this can be done with a NT API/Web Service.
authentication can be passed to the server any number of ways. Whichever way you prefer you can do.
Cheers
Bruce
embedding users and passwords in code is not ideal, because then you need to start worrying about who can see that code.
Like for example if this code is committed into source control, especially public source control, then it would be an issue.
But for compiled programs, with minimal or no distribution of source code it's ok.
Base64 encoding the user name or password serves no purpose. The value will already be base64 encoded by the Authenticate command.
Obviously you can only use Basic Authentication against an HTTPS, not HTTP server, as the password and username are in plaintext in the header.
>> 2. Is this technique, using a username and password to access a web service/API, the preferred way?
it's not preferred more or less than anything else. It's a perfectly good way, and commonly used. It's completely supported by NetTalk. There are other ways to do Auth, this is just one, and a perfectly good one (as long as HTTPS is in play).
>> I use another unrelated API, where I send a key/code to the API.
key / code == user/password - same thing, different names.
>> I'm not sure how or if this can be done with a NT API/Web Service.
authentication can be passed to the server any number of ways. Whichever way you prefer you can do.
Cheers
Bruce
42
Web Server - Ask For Help / Re: NT12.52 - opening file error in DebugView
« on: December 22, 2022, 09:20:14 PM »
I would need an example of the app, and the effect, to comment.
Cheers
Bruce
Cheers
Bruce
43
Web Server - Ask For Help / Re: Larges Reports on NT
« on: December 22, 2022, 09:18:42 PM »
You should probably better understand the cause of the crash etc so that you can determine the fault.
Also make sure your progress timer on such a long report is really slow.
To answer your question, of course you can let a user submit a report request, and then email them the result.
cheers
Bruce
Also make sure your progress timer on such a long report is really slow.
To answer your question, of course you can let a user submit a report request, and then email them the result.
cheers
Bruce
44
Web Server - Ask For Help / Re: What Triggers the Busy Image?
« on: December 22, 2022, 09:16:44 PM »
it's just a div id="_busy"
So yes, you can hide or show it.
In javascript (client side) you can just do
$('#_busy).hide()
or
$('#_busy).show()
On the server side it's more complex, because you can include script in a reply, but it'll only get executed when the reply is completely formed and completely sent to the client.
so typically you unhide on the client side, and hide on the server side.
Obviously you need to full understand how the engine is using it as well, because there are other things hiding and unhiding it.
In summary - you probably should not be hiding and unhiding that graphic yourself. If you want to notify the user of things happening, use your own graphic, or a progress bar.
cheers
Bruce
So yes, you can hide or show it.
In javascript (client side) you can just do
$('#_busy).hide()
or
$('#_busy).show()
On the server side it's more complex, because you can include script in a reply, but it'll only get executed when the reply is completely formed and completely sent to the client.
so typically you unhide on the client side, and hide on the server side.
Obviously you need to full understand how the engine is using it as well, because there are other things hiding and unhiding it.
In summary - you probably should not be hiding and unhiding that graphic yourself. If you want to notify the user of things happening, use your own graphic, or a progress bar.
cheers
Bruce
45
Web Server - Ask For Help / Re: How to donot generate multiple threads of the same page
« on: December 22, 2022, 09:11:50 PM »
Alas, no ideas Alberto.
I guess you need to break it down some more, and figure it out.
Perhaps create small examples to show the effect you are trying.
Maybe use a different Busy graphic, which you can unhide, and hide, without worrying about mine.
I guess you need to break it down some more, and figure it out.
Perhaps create small examples to show the effect you are trying.
Maybe use a different Busy graphic, which you can unhide, and hide, without worrying about mine.