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

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 14th November 2017, 13:57
giggty giggty is offline
Junior Member
 
Join Date: May 2017
Posts: 5
giggty is on a distinguished road
Baan: Infor ERP 10.5 - DB: MSSQL Server 2008 R2 - OS: Windows Server 2012
using activate()
Baan: ERP LN 6.1 FP11 (Infor ERP 10.5)
C/S: Client

Hello.
So I am developing an LN Extension and I need a chunk of my code to run in a separate process. It appears that activate() is what i need. But it requires a session name or the name of an object file as the process to be activated. I created a function component whinh290dalnew in LN Studio, put my code in and compiled it. But when i try to run it like
Code:
act.return = activate("owhinh290dalnew", <parameters>)
i get an error
Quote:
Process 25 - Error : [MR_E_READNG] Cannot read session or object (owhinh290dalnew)
How to make sure object file gets created? Or am I doing it all wrong?
Reply With Quote
  #2  
Old 14th November 2017, 17:51
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,305
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 call a DAL like that. What you can do is this -

Code:
exec_dll_function("oasacp205","before.save.object",ret,DAL_NEW)

Where, ret is return value and DAL_NEW is mode i.e. the argument for before.save.object function.

activate() can be used for 4GL and 3GL programs.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
Sponsored Links
  #3  
Old 15th November 2017, 15:07
giggty giggty is offline
Junior Member
 
Join Date: May 2017
Posts: 5
giggty is on a distinguished road
Baan: Infor ERP 10.5 - DB: MSSQL Server 2008 R2 - OS: Windows Server 2012
Hi, Bhushan!
Quote:
Originally Posted by bhushanchanda View Post
You cannot call a DAL like that.
Why not? My whinh290dalnew script looks like this:
Code:
extern long res

function whinh290dalnew()
{
	res = dal.new.object("whinh290")
	if result = 0 then
	        dal.set.field("whinh290.oorg", argv$(1))
	        dal.set.field("whinh290.orno", argv$(2))
	        dal.set.field("whinh290.pono", argv$(3))
	        dal.set.field("whinh290.seqn", argv$(4))
	        dal.set.field("whinh290.dlin", 1)
	        dal.set.field("whinh290.cpor", tcpeg.cpor.manual)
	        dal.set.field("whinh290.cprj", argv$(5))
	        dal.set.field("whinh290.cact", argv$(6))
	        dal.set.field("whinh290.cspa", argv$(7))
	        res = dal.save.object("whinh290")
	        export("res", res)
	endif
}
My main concern is about why i can't call this function using activate() (regardless of what it is actually doing). I thought when you save component in LN Studio and build it, object file gets created on server and you are good to go.
I tried running your code, but it gave me a similar error:
Quote:
Process 57 - Error : [MR_E_READNG] Cannot read session or object (oasacp205) (after.save.object() in object otxestwhinh220.dbg)
Are you sure about "oasacp205"? I can't find it in ttstpbaandoc.
Reply With Quote
  #4  
Old 15th November 2017, 15:37
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,305
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,

That's a custom script.

What kind of script is whinh290dalnew?

What is the name of the script/object? Its clear that bshell is not able to find the object. Can you please double check the name of the object? And check if its exists in the directory or not.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #5  
Old 16th November 2017, 15:31
giggty giggty is offline
Junior Member
 
Join Date: May 2017
Posts: 5
giggty is on a distinguished road
Baan: Infor ERP 10.5 - DB: MSSQL Server 2008 R2 - OS: Windows Server 2012
Quote:
Originally Posted by bhushanchanda View Post
What kind of script is whinh290dalnew?
It is a function component, like those stored in ttadv2560m000.
Quote:
Originally Posted by bhushanchanda View Post
What is the name of the script/object? Its clear that bshell is not able to find the object. Can you please double check the name of the object? And check if its exists in the directory or not.
I see there are 3 files which are related to whinh290dalnew:
\bse\application\wh105C_0_bss\t_0003\baan\iwhinh\iinh290dalnew0
\bse\application\wh105U_0_a000\iwhinh\iinh290dalnew0
\bse\application\wh105C_0_bss\t_0003\iwhinh\iinh290dalnew0

Clearly, there is no object file oinh290dalnew
It seems like i misunderstood the concept of function. Here is the quote from "Infor LN Studio ApplicationDevelopment Guide":
Quote:
If you want to include a function in a program script, use the following statement:
#include "i<entire code>"
So a function component in LN is like .h file with inline function in C/C++, which you include and then use it in your code.
So my question is: what entity i need to create in LN, so that it gets compiled into an object file with the code i posted above inside, so that i can run it via activate()?
I found a related thread:
Code:
|* Second program script - zmadmnp
extern	long	ret.val
function main()
{
long	i
message("No. of args=%d", argc()-1)
for i = 1 to (argc() - 1)
	message("Argument(%d)=%s", i, argv$(i))
endfor
ret.val = 2003
export("ret.val", ret.val)
}
What is this zmadmnp? I need to create a similar one
Reply With Quote
  #6  
Old 16th November 2017, 20:44
NPRao's Avatar
NPRao NPRao is offline
Guru
 
Join Date: Aug 2001
Location: Pacific NW, USA
Posts: 3,029
NPRao will become famous soon enough
Baan: iBaanERP-5.2a(Reger),SSA-ERP-LN-6.1,Infor LN-10.x - DB: Oracle-10g,11g,12c,MS-SQL - OS: HP-UX, Linux, Windows
Quote:
It seems like i misunderstood the concept of function. Here is the quote from "Infor LN Studio ApplicationDevelopment Guide":

So a function component in LN is like .h file with inline function in C/C++, which you include and then use it in your code.
Yes, it is similar to the C/C++, however the functions cannot be directly compiled or the objects are generated for them.
Quote:
What is this zmadmnp? I need to create a similar one
The zmadmnp, is a custom 3-GL program, that I created to illustrate an example.

Refer to the Tools Programmer's manual -
activate()

wait.and.activate()
__________________
The art of perfection does not lie in doing extraordinary things but, doing ordinary things extraordinarily well. [-N. Prashanth Rao]
How To Ask Questions The Smart Way,BaaNBoard,NPRao
Reply With Quote
  #7  
Old Yesterday, 09:36
giggty giggty is offline
Junior Member
 
Join Date: May 2017
Posts: 5
giggty is on a distinguished road
Baan: Infor ERP 10.5 - DB: MSSQL Server 2008 R2 - OS: Windows Server 2012
Quote:
Originally Posted by NPRao View Post
The zmadmnp, is a custom 3-GL program, that I created to illustrate an example.
Right, and how do I create one? Can I do it in LN Studio (i believe i cannot)? Or do i need to create a text file with my source, upload it to the server and fire some binary to compile it into object file? Can you guide me through or point where i can find step-by-step procedure for that? Sorry, I have started recently and I have not touched some aspects of LN in my work yet.
Reply With Quote
  #8  
Old Yesterday, 16:58
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,305
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
Quote:
Originally Posted by giggty View Post
Right, and how do I create one? Can I do it in LN Studio (i believe i cannot)? Or do i need to create a text file with my source, upload it to the server and fire some binary to compile it into object file? Can you guide me through or point where i can find step-by-step procedure for that? Sorry, I have started recently and I have not touched some aspects of LN in my work yet.
Hi,

There are a few ways to create 3GL script.

1. Just use Worktop/BECS and use LN tools to create it. Just go to Tools -> Application Development -> Program Scripts -> Create new -> Use script type as 3GL.
2. Create a script manually under the applications directory and use command line tool bic6.2/ bic for compiling (More info here)
3. In the script tab, for the script type option change it to 3GL. More info can be found in Infor LN Studio Application Development Guide.

Here's a sample bic command for compiling a sample script tccomtest

Code:
bic  -T 1805  -Pvariant=0  ptccomtest0 -z -u -o otccomtest -f "E:\Infor\erpln\bse\tmp\tmp082332508" -pacc b61prod -qe "E:\Infor\erpln\bse\tmp\tmp082332510"
Quote:
Usage: bic [-ilpstzEV] [-u[level] -f fn] [-w[level]] [-Idir[:dir ...] [-Dmacro[=
value]] [-d dll[:dll ...] [ -pacc pack_comb ] [-T TIVNumber] source [-o object]
[ -qo outfile ] [ -qe errfile ] [ -qx xmlfile ]

-i: Assembler output in <source>.i
-l: Object runs in debug mode
-p: Object runs in profiling mode(time analyse)
-pacc pack_comb: Use specified package combination
-s: Generate symbol table to stdout
-t: Print tokens after preprocessor pass
-u[l]: Create 'where used' list [for level l]
-f fn: File name for 'where used' output file.
-z: Ignore the BAAN_SCM_GRP
-E: Only preprocessor pass output to stdout
-w[l]: Suppress warnings of level <l>
-W[l]: Give warnings of level <l>
-d dll:Load dll[:dll ...] for search lib.functions
-Idir: Add dir[:dir ...] to searchpath #include <>
-Ddef: define a macro. Or with value -Ddef[=value]
-qo fn: Redirect standard output to file fn
-qe fn: Redirect error output to file fn
-qx fn: Generate XML document with compile errors in file fn
-6: Generate 6.1 object format
-7: Generate 7.2 object format
-V: Print release number
-T num: Add 'num' as Tools Interface Version number to the object
__________________
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
activate job in background chenna.deepa Tools Development 2 13th February 2014 13:47
Activate Job directly bstecche Tools Administration & Installation 4 20th March 2006 22:40
Activate the Job using the AFS noorulhaq AFS/DDC/OLE: Function servers 4 28th December 2005 15:42
How to activate ttiex1280s000? Ruskin Tools Development 5 14th April 2005 10:47
IS it possible to activate a particular job from Program script jaymukh Tools Development 2 21st June 2002 22:55


All times are GMT +2. The time now is 02:55.


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