Baanboard.com

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

User login

Frontpage Sponsor

Main

Poll
As a Customer What would do to keep your ERP Implementation intact
Proactively define Business Process-- Take the Project Ownership
50%
Handover everything to System Integrator from drawing BP till implementation of ERP
20%
Hire more inhouse skilled & capable IT Resource to work directly with SI
30%
Rely on SI Architects/Consultants
0%
Total votes: 10

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 12th January 2021, 19:31
RobertP RobertP is offline
Member
 
Join Date: Mar 2003
Location: South Africa Cyprus Canada
Posts: 60
RobertP is on a distinguished road
Baan: 4 or 5 - DB: Oracle - OS: Unix
activate() session in LN with Arguments
Baan: Other/Unknown
C/S: None/Unknown

Hello,

I want to start exchange session "create import programs" via a script and pass it Exchange scheme from/to and Batch from/to. AFS is not an option because I want the session to actually startup in order to view the errors if any. start.session does not have option to add arguments but apparently wait.and.activate() and activate() do. I tried below code. The session starts but without arguments. How can these arguments be passed?

wait.and.activate( "daxch0227m000",
"MYXCH", "MYXCH", |exchange from / to
"MYBATCH", "MYBATCH", |batch from to
"1", |Debug y/n
"2", |profile y/n
"1" ) |display error y/n

FYI - the arguments were passed in order of sequence of form fields.

Thanks
__________________
Better to die on your feet than live on your knees
Reply With Quote
  #2  
Old 12th January 2021, 21:09
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,542
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I only recall seeing this a couple of times and the programs I saw used something like pdno.f = val(ARGV$(1)) to pull in the passed arguments. So what you could do is try like the source extender to add code to the program to import the variables. Hopefully someone else has a better solution or another way to activate an exchange scheme.
__________________
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
  #3  
Old 14th January 2021, 15:24
vahdani's Avatar
vahdani vahdani is offline
Guru
 
Join Date: Aug 2002
Location: Cologne, Germany
Posts: 462
vahdani is on a distinguished road
Baan: all - DB: all - OS: Unix / Win2K
Hi,

please take a look at processes overview and synopsis functions

I wrote the following 3GL Script which starts a different session:
Code:
	long	g.processno

function main()
{
	g.processno = act.and.sleep("tccom0401m000")

	if g.processno > 0 then
		 put.var(g.processno, "emno.f", "dude")
		 put.var(g.processno, "emno.t", "dude")


		reactivate(g.processno)
	endif
}

and it seems to work (see below) .

Of course you have to know the name of the external variables used on your form.
In your case these would be: cxch.f, cxch.t, cbat.f, cbat.t, debug.yn, profile.yn and disp.error
Attached Images
File Type: jpg activate.JPG (54.9 KB, 10 views)
__________________
May the force be with you!

Last edited by vahdani : 14th January 2021 at 15:51.
Reply With Quote
  #4  
Old 14th January 2021, 20:47
RobertP RobertP is offline
Member
 
Join Date: Mar 2003
Location: South Africa Cyprus Canada
Posts: 60
RobertP is on a distinguished road
Baan: 4 or 5 - DB: Oracle - OS: Unix
This is fantastic Vahdani.

Thanks, I'll give it a try. Hope to finally blackbox exchange.

Cheers
__________________
Better to die on your feet than live on your knees
Reply With Quote
  #5  
Old 16th January 2021, 17:30
RobertP RobertP is offline
Member
 
Join Date: Mar 2003
Location: South Africa Cyprus Canada
Posts: 60
RobertP is on a distinguished road
Baan: 4 or 5 - DB: Oracle - OS: Unix
Vahdani,

How would you have the program click the "Print" button? I kicked off session daxch0228m000 (tuxch0228m00 in B4) with corerct args, but the session does not continue the process. Activate() does this tho but without ARGS.

Any idea?



Quote:
Originally Posted by vahdani View Post
Hi,

please take a look at processes overview and synopsis functions

I wrote the following 3GL Script which starts a different session:
Code:
	long	g.processno

function main()
{
	g.processno = act.and.sleep("tccom0401m000")

	if g.processno > 0 then
		 put.var(g.processno, "emno.f", "dude")
		 put.var(g.processno, "emno.t", "dude")


		reactivate(g.processno)
	endif
}

and it seems to work (see below) .

Of course you have to know the name of the external variables used on your form.
In your case these would be: cxch.f, cxch.t, cbat.f, cbat.t, debug.yn, profile.yn and disp.error
__________________
Better to die on your feet than live on your knees
Reply With Quote
Sponsored Links
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
Changing Session Description of MMT Satellite pillai.ganesh Tools Development 1 26th December 2014 14:23
adding a session in Special preethi Tools Development 3 20th August 2010 12:21
Launching a Session from within a Session mark_h Tools Development 2 15th November 2004 14:37
Call a customized session form Standard Session das_k_tushar Tools Development 20 2nd September 2004 17:11
what about calling a session with arguments? areanvv Tools Administration & Installation 5 29th November 2001 15:28


All times are GMT +2. The time now is 08:54.


©2001-2020 - Baanboard.com - Baanforums.com