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
37%
Installation Wizard into new VRC
39%
Manual into existing VRC
3%
Manual into new VRC
21%
Total votes: 38

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 11th January 2017, 07:46
sachinbaan's Avatar
sachinbaan sachinbaan is offline
Senior Member
 
Join Date: Oct 2013
Posts: 166
sachinbaan is on a distinguished road
Baan: ERP LN - DB: MS SQL - OS: Microsoft Server
Execute Job From Session
Baan: Other/Unknown
C/S: None/Unknown

Hello,

Can i execute job from my 4gl program?

On the click of button i want to execute job.
__________________
Regards,
Sachin

TO DREAM THE PERSON U WOULD LIKE 2 B, IS 2 WASTE THE PERSON U R.
Reply With Quote
  #2  
Old 11th January 2017, 11:17
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,314
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,

What have you tried? Check this thread for a way. Another way you can try is through AFS. Also, if on windows, you can create a task scheduler for the required job and then execute the task scheduler through your 4GL script.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #3  
Old 11th January 2017, 13:11
sachinbaan's Avatar
sachinbaan sachinbaan is offline
Senior Member
 
Join Date: Oct 2013
Posts: 166
sachinbaan is on a distinguished road
Baan: ERP LN - DB: MS SQL - OS: Microsoft Server
Hello,

My requirement is to merge three files in to one, i have one ".exe" which merges all 3 files in one file, i.e, 3 excel file in to 1 excel file (3 tabs).

I used app_start() which executed on BECS, but i want to execute same on LN UI.

I tried different functions like, run.prog(), but it is not working.

So if i run the session using job, there won't be any LN UI specific problem.

I wrote AFS but at the end of the program, the session which gets open using AFS is not closing hence, AFS is also not working, please check if there is anything wrong in AFS, I have attached code.
Attached Files
File Type: txt afs.txt (1.2 KB, 28 views)
__________________
Regards,
Sachin

TO DREAM THE PERSON U WOULD LIKE 2 B, IS 2 WASTE THE PERSON U R.
Reply With Quote
Sponsored Links
  #4  
Old 12th January 2017, 18:47
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,924
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
My question is - if "on a click of a button" it executes a job - why does it have to be a job? Why not let them click a button and it calls a library, a session or something else to combine the 3 files. I think that might have been where Bhushan was going with the AFS, but I could be wrong. I have not written any AFS code to run jobs - so not much help with that.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #5  
Old 12th January 2017, 20:32
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,314
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
I am not sure, but a shot in a dark would be - it's a permission issue.

Few questions -

1. Are you on Windows Server?
2. How did you use run.prog()?
3. Is the .exe executable to the everyone/all users?

You can try passing the output to an error file and see if you can catching anything there. Calling an external utility through Baan/LN has always been more of a trial and error thing. It all depends on the implementation of the external utility.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #6  
Old 13th January 2017, 06:13
sachinbaan's Avatar
sachinbaan sachinbaan is offline
Senior Member
 
Join Date: Oct 2013
Posts: 166
sachinbaan is on a distinguished road
Baan: ERP LN - DB: MS SQL - OS: Microsoft Server
Hello,

@mark: i want to execute ".exe" which is working fine from BECS, but requirement is to execute same thing from LN UI and i am not getting any LN UI specific function to execute ".exe", so if i do it using job there will be no question of LN UI.

@Bhushan:

1. Yes i am on windows server
2. run.prog() : i have created a bat file and same path is been passed to the function, if same function i execute on BECS it executes properly, but on LN UI it gives return value as 0 (Success) but nothing is happening to the files.
3. Yes, .exe is executable to every user.
__________________
Regards,
Sachin

TO DREAM THE PERSON U WOULD LIKE 2 B, IS 2 WASTE THE PERSON U R.
Reply With Quote
  #7  
Old 16th January 2017, 16:03
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,924
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I was looking at the AFS code - on you baan version can you actually execute thru ttaad5500m000? I know on my 4c4 session I would actually go straight to ttaad5203m000 and execute it there. So my code would look something like below - what I am not sure of is after the continue I would have to wait for it to complete. I know at times for my afs code I have to use suspend to get my code to pause to give the session I called time to complete cleanly. Also I could not use the exec command for continue, but just copied your code.

Code:
function extern tccom.runjob.execute.job(domain	tcmcs.str32 i.job)
{
	i.main.session = ""ttaad5203m000"

	stpapi.put.field(i.main.session, "ttaad500.cjob", i.job)

	o.return.value = stpapi.find(i.main.session, o.error.message)

	if o.return.value = 1 then
			stpapi.form.command(i.sub.session,  5, "exec.cont.process", o.error.message)
	endif
	stpapi.end.session(i.main.session)
}
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
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
Handling Unit functionality baazigar Distribution, Transportation & Warehousing 4 19th February 2012 16:54
DEM - Can a normal user be authorized for 'Execute SQL Query' session? syarragu DEM & Workflow 4 8th September 2010 15:21
synchronizing different occurrences on parent session from child Ruskin Tools Development 8 18th March 2008 18:56
Session will not run as a job pjohns Tools Administration & Installation 9 17th January 2003 14:10
Fully automated session and job mgmt Paul P Tools Administration & Installation 2 20th December 2002 14:34


All times are GMT +2. The time now is 22:20.


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