Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 18th March 2016, 07:53
showstuff11 showstuff11 is offline
Junior Member
 
Join Date: Mar 2015
Posts: 22
showstuff11 is on a distinguished road
Baan: fp3 - DB: sql server 2008 r2 - OS: windows 7
This function is not supported in th LN UI: seq.open.dialog.local
Baan: Infor10 ERP
C/S: Client

Hi guys,

We encountered an error in LN UI.(Please see attached screenshot). In LN Studio Development, the code is perfectly working. I already read some forums about the error and the explanation is, in LN Studio Development - it access only the your local server and in LN UI - it access the server. Is there any way / code same function of seq.open.dialog.local and start.application.local for LN UI?

Thanks in Advance ,
Tambor
Attached Images
File Type: png error.png (10.5 KB, 61 views)

Last edited by showstuff11 : 21st March 2016 at 06:45.
Reply With Quote
Sponsored Links
  #2  
Old 18th March 2016, 10:55
Ajesh's Avatar
Ajesh Ajesh is offline
Guru
 
Join Date: Feb 2009
Posts: 444
Ajesh is on a distinguished road
Baan: LN 10.4 - DB: Oracle - OS: HP-Unix
Have you included the library ?#include <bic_desktop>
Reply With Quote
  #3  
Old 18th March 2016, 11:07
showstuff11 showstuff11 is offline
Junior Member
 
Join Date: Mar 2015
Posts: 22
showstuff11 is on a distinguished road
Baan: fp3 - DB: sql server 2008 r2 - OS: windows 7
Hi Ajesh,

Yes. It's already in my code.

Tambor.
Reply With Quote
  #4  
Old 18th March 2016, 12:38
andreas.toepper andreas.toepper is offline
Senior Member
 
Join Date: Jun 2004
Posts: 127
andreas.toepper is on a distinguished road
Baan: Baan4, LN6.1 - DB: MSSQL - OS: Linux&Windows
The classic client-Access functions are deprecated when using WebUI (like create.local.file()). With LNUI (HTML UI) even more restrictions have been introduced.

Please check the latest Infor ERP Enterprise Programmers Guide. You'll find a chapter named "Implementing HTML UI support". Infor introduced a bunch of new client-access-functions which will work only when using LNUI:

"HTMLUI client functions
The following functions have to be used when the client runs in HTMLUI mode:

Single file functions:

client.upload.file
client.download.file
client.show.file
Multiple file functions:

client.prepare.download
client.add.download.file
client.start.download
client.upload.files
client.get.upload.filecount()
client.get.upload.file
client.delete.upload.file.object
Assisting functions:

get.ui.mode()
tc.is.html.ui()
tc.is.thin.client()
client.get.media.type "

We're on LN 10.2.1, so I can't use those functions (10.2.1 doesn't support LNUI). But we will have a LN 10.4 testinstallation with Mingle and LNUI in some weeks.

Check Infor KB 22924522 for the latest programmers guide.
Reply With Quote
  #5  
Old 26th September 2016, 11:00
Ajesh's Avatar
Ajesh Ajesh is offline
Guru
 
Join Date: Feb 2009
Posts: 444
Ajesh is on a distinguished road
Baan: LN 10.4 - DB: Oracle - OS: HP-Unix
So which exact HTML UI/Mingle function is there for seq.open.dialog.local?

Is it client.show.file? and if yes then what are the parameters in it?
Reply With Quote
  #6  
Old 26th September 2016, 12:05
andreas.toepper andreas.toepper is offline
Senior Member
 
Join Date: Jun 2004
Posts: 127
andreas.toepper is on a distinguished road
Baan: Baan4, LN6.1 - DB: MSSQL - OS: Linux&Windows
As far as I can tell (we're still not using LN UI) there is no real replacement. LN UI is based on HTML5 and therefore it is bound to the security boundaries of the browser. The browser won't let a server access a file directly on a client computer. I still don't know how to reprogram my usual fileaccess routines (i.e. when importing local stored data in LN).

I've downloaded the Programmers Guide of LN 10.5 from KB 22924522 and searched it for usefull information. There is a chapter named "Implementing HTML UI support". There you find information on the unsorported and new functions as of LN 10.4.

I think I'm going for client.upload.file and/or client.download.file. But I have to wait till the dev. environment with ming.le is running properly (it still doesn't).

I will quote the syntax of client.show.file taken from that developers guide:

client.show.file
Syntax:
#include <bic_desktop>

function long client.show.file (string source, boolean new.window, string title [, string mime.type] [, string target] [, boolean remove.after.download])

Description

Show the server file passed in the source argument in the browser. The browser can show some file types natively in a browser window (like for example plain text and pdf files). For other file types, the browser will show a browser specific download dialog.

This function will return immediately (so will not wait until the browser window is closed or the file downloaded by the client). The optional parameter "remove.after.download" can be used to control automatic removal of the server file after the file has been downloaded by the client.

Conversion of CRLF characters is only done for text files (file extension .txt or mime.type "text/plain"). All other file types are copied in binary mode.

The mime.type can be used to indicate the file type such that the browser has the option to start the client application which is associated with this mime.type. When the mime.type is not specified, the mime.type will be determined based on the file extension of the file specified in the optional target argument. When the optional target argument is also not specified, the mime.type will be determined based on the file extension of the file specified in the source argument.

When this function is called more than once for a single UI event, only the last function call will be effective.

In case of a Document Viewer session this function may only be called after calling vwr.init() or from callback function vwr.bms.received(). In case of a Document Viewer session the following arguments are ignored: new.window, title.

This function is only supported in WebUI and LN UI.


Arguments
string source Specifies the server file which must be shown in the browser.

boolean new.window When this option is true, the server file is shown in a new browser window. Otherwise this file is shown in a frame embedded in the current browser window.

string title Specifies the title for the browser window or frame.

[string mime.type] This optional argument can be used to indicate the file type such that the browser has the option to start the plugin which is associated with this mime.type. When the mime.type is not specified, the mime.type will be determined based on the file extension of the file specified in the source argument.

[string target] optional string representing the proposed file name on the client

[boolean remove.after.download] When this optional argument is true, the file on the server is automatically removed after the file is downloaded by the client. The default value is false.


Return values
0 success
<0 when an error occured (for instance invalid source path)

Context
This function is implemented in the 4GL Engine and can be used in all script types. This function is available from TIV level 1900.

Last edited by andreas.toepper : 26th September 2016 at 12:15.
Reply With Quote
  #7  
Old 26th September 2016, 16:50
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,286
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Replacement for seq.open.dialog.local() is client.upload.file() or client.upload.files() for multiple selection.

Here is a snippet which shows how you can utilize it -

Code:
function extern upload.file()
{
	long id
	long index
	long fcount
	long total
	long l
	
	id = 0
	fcount = 0
	index = 0
	path = trim$(path)	
	
	l = len(path)
	if path(l;1) = "/" then
	else
		path = path & "/"
	endif
	
	if tc.is.html.ui() then
		id = client.upload.files(path)
		if id <> 0 then
			fcount = client.get.upload.filecount(id)
			total = fcount
			index = 1
			while fcount > 0 
				serverfile = client.get.upload.file(id,index,filename)
				serverfile = trim$(serverfile)
				filename = trim$(filename)
				file.mv(trim$(serverfile),trim$(path)&trim$(filename))
				fcount = fcount - 1
				index = index + 1
			endwhile
			
			message("%d files uploaded successfully!",total)
		else
			message("Uploading failed. Please check the path.")
		endif
	else
		seq.open.dialog.local(true,"","","*.*",filename)
		filename = trim$(filename)
		
		while not isspace(filename)
			find = 0
			found = 0
			find = rpos(filename,"\")
			
			serverfile = filename(find+1;len(filename)-find)
			
			ret = client2server(filename,trim$(path)&serverfile,false,false,true)
			if ret = 0 then
			else
				message("File transfer failed for %s",filename)
			endif
			filename = ""
			seq.open.dialog.next(filename)
		endwhile
	endif
	
	}

Offcourse, HTML5 has restrictions over other functions which doesn't involve user interaction like client2server(), start.application.local() etc but you can always have an option for file selector.

Regarding the function client.show.file(), it can be used to open a file directly on client machine. Again, only the files(MIME Types) supported by your browser will be opened . Else it will ask for a default program to open it. Here goes a sample code -

Code:
file.pntr = client.show.file(
				"/home/" & trim$(bhushan) & "/Sample_Report.pdf",
				true,          |Opens a new window
				"Sample Report.pdf" |Name of the report to be shown
				)
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #8  
Old 27th September 2016, 08:31
andreas.toepper andreas.toepper is offline
Senior Member
 
Join Date: Jun 2004
Posts: 127
andreas.toepper is on a distinguished road
Baan: Baan4, LN6.1 - DB: MSSQL - OS: Linux&Windows
Many thanks for the examples!
Reply With Quote
  #9  
Old 27th September 2016, 09:17
Ajesh's Avatar
Ajesh Ajesh is offline
Guru
 
Join Date: Feb 2009
Posts: 444
Ajesh is on a distinguished road
Baan: LN 10.4 - DB: Oracle - OS: HP-Unix
I am using the below code

Code:
if tc.is.html.ui() then
		message("Loop entering")
		ret = client.upload.files(form.path)
		if ret<> 0 then
			server.file.name = client.get.upload.file(ret,1,file.name)
			message("Form Path:%s,File Name:%s",form.path,file.name)
		else
			message("Uploading failed. Please check the path.")		
		endif		
	else	
		ret = seq.open.dialog.local(true,"", form.path,"*.*",file.name)
		if ret >0 then
			form.path = strip$(file.name)
		endif
	endif
But the file is not getting uploaded. BTW, the form.path is blank at the stage when the file is getting uploaded.

Any Documentation available for these commands?
Reply With Quote
  #10  
Old 27th September 2016, 10:12
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,286
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Hi,

You cannot leave form.path blank. Its the destination path.

client.upload.files()
Quote:
#include <bic_desktop>

function long client.upload.files (string destination)

Description

Upload one or more files from the client and save these files in a server directory. Conversion of CRLF characters is only done for text files (file extension .txt or mime.type "text/plain"). All other file types are copied in binary mode. This function returns an id that can be used in the function client.get.upload.file to obtain information of an uploaded file. This function is only supported for HTMLUI.


Arguments
string destination the file on the server to which the client file will be uploaded (user must have write permission).


Return values
<>0 the id of the result object to be used by subsequent functions. This result object must be deleted using the function: client.delete.upload.file.object
0 when an error occurred (for instance destination is a directory)
client.upload.file()
Quote:
#include <bic_desktop>

function long client.upload.file (string destination [, ref string client.filename] [, ref string mime.type])

Description

Upload a single file from the client and save this file on the server in the file location passed as the destination argument. Conversion of CRLF characters is only done for text files (file extension .txt or mime.type "text/plain"). All other file types are copied in binary mode. This function is only supported for HTMLUI.


Arguments
string destination the file on the server to which the client file will be uploaded (user must have write permission).

[ref string client.filename] the original name of this file on the client

[ref string mime.type] optional string representing the MIME Media type of the file. The official list can be found here: http://www.iana.org/assignments/media-types/index.html.


Return values
0 success
<0 when an error occurred (for instance destination is a directory)
client.get.upload.file()
Quote:
#include <bic_desktop>

function string client.get.upload.file (long id, long index [, ref string client.filename] [, ref string mime.type])

Description

Get the details about a file which is uploaded with function client.upload.files. This function is only supported for HTMLUI.


Arguments
long id the id of the result object returned by client.upload.files.

long index one-based index of the uploaded file for which the information is requested.

[ref string client.filename] the original name of this file on the client.

[ref string mime.type] optional string representing the MIME Media type of the file. The official list can be found here: http://www.iana.org/assignments/media-types/index.html.


Return values
The server path name of the uploaded file or empty when an error occurred
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #11  
Old 27th September 2016, 12:25
Ajesh's Avatar
Ajesh Ajesh is offline
Guru
 
Join Date: Feb 2009
Posts: 444
Ajesh is on a distinguished road
Baan: LN 10.4 - DB: Oracle - OS: HP-Unix
And how do we get the Client Location from the Web UI? For example "c:\Users\Desktop\Import", i need to get this value in the script.....
Reply With Quote
  #12  
Old 27th September 2016, 12:53
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,286
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Hi,

client.get.upload.file (long id, long index [, ref string client.filename]) gives you the file name but it won't give you the directory name, again, due to security issues. And, AFAIK, you won't need directory name to do the uploading.

get.client.directory() was marked as untrusted and hence doesn't work with LNUI.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #13  
Old 16th February 2017, 15:25
dhruv_x0's Avatar
dhruv_x0 dhruv_x0 is offline
Member
 
Join Date: Oct 2010
Location: New Delhi
Posts: 80
dhruv_x0 is on a distinguished road
Baan: baan 4,erp ln6 FP2 - DB: MS SQL - OS: Windows XP,Windows 2000
Hi All,

I can't see any function for deleting the Local file also from LN UI? Is there any alternative?

Thanks
Reply With Quote
  #14  
Old 16th February 2017, 15:34
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,286
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
No. You can't do that directly through LN without user intervention. HTML 5 does not allow any client side automation.

What you can probably do is, write a simple bat file on server which has commands to delete X file. Now, send that file for downloading on users machine and let user run it. Once he runs it, the file will be deleted. I don't think there is any direct simpler way.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to call AFS in sp24? PV Ramone AFS/DDC/OLE: Function servers 4 2nd September 2008 11:06
Compile error,help! gavin_wusj Tools Development 5 5th April 2005 09:09
xml question steveauckly Tools Development 4 27th July 2004 10:41


All times are GMT +2. The time now is 00:26.


©2001-2017 - Baanboard.com - Baanforums.com