~Vamsi
6th December 2001, 08:02
Trying to work without Baan code has been an issue for quite a while. Those who discovered QKEY (http://www.redklay.com) know that 4GL sessions can be customized to a good extent without the source code. The idea of creating an equivalent has been in my mind for quite a while now. About a year ago I wrote a little bit of code as a proof of concept. And it has been stagnating ever since. I made an attempt to create a list of volunteer developers through this thread (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=355) without much success. People just did not say anything after receiving the code. I just do not know if they did not understand what the code did (very possible - I sent it out with practically no documentation - just like now) or they expected me to give a fully working script (this is not true even now - notice the DEV in the heading).
However inadequate the two scripts that I am posting may be, they do work (or atleast did before I made changes :)).
Deliverables expected at the end of this project:
a name for this project/product
documentation
technical design so that the maintenace can be easy
added features like ease of use / being not affected by changes to Baan standard object
Please try this program and post changes. Thanks to Krishna Eranki / Praveen Ambekar / Patrick Van der Veken (in chronological order of their contributions) for making this possible.
KlayVessel
30th December 2001, 05:59
Hmmm...interesting.
I don't think I could contribute to this project...I'm sure that would taint it! Ha!
Don't know whether to be happy about this or not...but I am always glad to see people working on innovative code.
evesely
3rd January 2002, 23:20
I have updated the code for ~Vamsi's main.bc file. I had a couple of problems running the original version. This now works well for me on IVc4. The following changes were made:
Extended to handle a larger number of functions (it died trying to handle tdsls4102 before)
Now works with functions that return values (e.g., function extern domain tcmcs.long tcedi0052.get.next.btno())
Added missing "functions:" statement
Fixed problem that occurred when parent had a "before.program" section
It is now skipping functions that seemed to be added as part of the compilation process (and hence caused the original compilation to fail) like g.check.input.funcs()
My compliments to MohanaVamsi Potluru and Praveen Ambekar on the original code. Also my apologies regarding my efforts to modify the copyright, disclaimer, etc. I was unsure how to put in my changes and still fit under the protection of the disclaimer. If I should fix this, please let me know -- I will be happy to do so.
A brief test seems to indicate that this works on Baan 5c, too, but I didn't do a lot of testing there. I'm sure others will have more features to add...
~Vamsi
7th January 2002, 21:24
Ed,
Could you post the revised main.bc file? The "disclaimers" apply to all authors. If you feel you have rewritten the code you can put your name in the author field while acknowledging the original author(s). Alternatively leave the original authors as such and add your name to the "contributors" (which is not present in the template at this moment).
evesely
8th January 2002, 17:23
I obviously forgot to attach this last time.
toolswizard
16th January 2002, 21:52
I tried to compile the sources and have many errors. Is the a compilable version?
~Vamsi
16th January 2002, 22:46
Toolswizard,
Thanks for trying the code. I have not worked on this code for a long time. My client does not have a need for such a product as they have source code. Hence it is not a priority on my list of things right now :(. I have posted the code I have in hopes that others will be able to extend it further and make it useful.
Since Ed posted revisions to main.bc I think he must have been successful in compiling the code. Please post your compilation errors to the thread and may be we can find out what the problem is.
toolswizard
16th January 2002, 23:02
I am taking a chance and changing the "options" variable and changing it to opt. It would seem baan has a macro (#define) for the work options and it is trying to expand it. It now compiles with a unrelated warning.
BTY did you get an email from me in the last few days asking more questions?
toolswizard
16th January 2002, 23:22
ok, I have it compiled and did run it against a small display session. I have a new file created by rush. Now does this file take place of the user script in the session, replacing the original script? Is it supposed to run stand alone? Please explain how I should test this out. Once I have a working model, I should be able to continue on more advanced development.
evesely
16th January 2002, 23:56
This file that is generated should be used as the program script for the session in question. It can be modified just like any other Baan 4GL program script. The one caveat is that you can't have the same section name as an external function call. For example, this is not allowed:
choice.cont.process:
on.choice:
code
...
function extern on.choice.cont.process()
{
other code
}
You can put things in either place, but not both.
Once you have attached this program script to the session, you should be able to run that session and access all of the functionality of the parent (i.e., standard Baan) script plus or minus any changes you desire. Unfortunately, you don't have the ability to modify the underlying functionality, but rather only decide if and when that code runs. If you want more flexibility, getting the Baan source code would help. ;-)
toolswizard
17th January 2002, 00:28
Thanks ED,
I am not trying this for my regular job. This is more of a curiosity. I would like to help get this into a usefull open source product. As your post states, you can use the call in either syntax, but not in both. I was already thinking of how this can be used to make the code more readable for the user.
I have access to development systems and source code to test all of this out. I can see where knowing the fuctionality of the standard is going to be needed to do any kind of development. Expecially to test it out fully. A programmers guide is surely going to be needed for those new to Baan.
If anyone is planning to try a development effort please let me know.
Bill Prokurat
aka toolswizard@spire.com
klixy23
20th February 2002, 17:27
I tested the program. I made the changes from toolswizard in this thread (variable "options" to "opt"). I compiled and run it.
IT WORKS.
Thanks for this great idea.
klixy23
22nd February 2002, 17:16
In my last post I wrote "IT WORKS", but somthing is wrong.
I tested the session tisfc0202m000 (Report Complete Order and Adjust Stock) and add an information field.
The session did the work, but the field tisfc001.cmdt wasn't update correctly, it was blank. This is always happen, if the form field cmdt.frm leave blank and the user press the continue button.
If the user fill the field, then all is ok.
So I changed back to the original session. I tested in the same way and the field is updated correctly. I think there is something in the original baan code, that fill the field automatically if it is blank or there is an internal function call.
Can someone check this? Or do you need more information?
Thanks.
klixy
~Vamsi
22nd February 2002, 21:09
What version of Baan? Once klixy responds could someone who has that version with code check to see what is really happening. I have access only to Baan 5b.
toolswizard
22nd February 2002, 22:24
I have access to almost all versions of source. But I really would like to see his code also. klixy can you please post your source for that field.
klixy23
25th February 2002, 10:35
Hi ~Vamsi, toolswizard
Thanks for reply.
We work with BaaN IV c4. I attach the output file of program "rush".
It is the original output without any changes.
I insert following lines:
extern domain tcmcs.str80 txt_str(1)
...
field.txt_str:
before.display:
text.to.buf("tisfc001.txta", "3", 1, txt_str)
I copy the form to the current VRC and add the field txt_str as the last field.
klixy
klixy23
25th February 2002, 10:38
Oooops, here is the file:
klixy
toolswizard
27th February 2002, 22:15
I have not tested this out myself, but I do have an idea. The field you are talking about is a form field and not part of the table. In the original code it is declared as external, form fields have to be declared as external to be used in the code. It may not be getting passed through the new program from the form to the old program. Declare the form field in the new program as external and see if that helps. Please give us feed back to it is part of this post.
klixy23
4th March 2002, 12:25
Toolswizard, thanks for your idea.
I tested the following:
extern domain tcdate cmdt.frm
extern domain tcyesno comp.frm
I think, these are the original form variables and get part with my problem. But the result is the same.
Is it possible that the functions check.input.cmdt.frm() or check.input.comp.frm() are the reason for fail?
toolswizard
4th March 2002, 21:42
I looked at several versions of the source and found that if comp.frm is tcyesno.yes then cmdt.ftm is set to todays date. If comp.frm is tcyesno.no then the cmdt.ftm is set to 0. I would try the test again maing sure that the comp.frm is set the same for both tests.
EDIguru
6th March 2002, 21:24
Hi,
This is great !! I find this extremely useful. Works perfectly. The only question i have is - has anyone tried this and extended the functionality for any tools sessions ?? I have a requirement where i need to do this but i am having difficulties copying the forms and sessions form the actual tools VRCs to the development packages and VRCs. Any suggestions / comments will be greatly appreciated !!
Regards
EDIguru.
|*********************|
|* Been There, Done That *|
|*********************|
KlayVessel
9th March 2002, 22:14
Originally posted by EDIguru
The only question i have is - has anyone tried this and extended the functionality for any tools sessions ?? I have a requirement where i need to do this but i am having difficulties copying the forms and sessions form the actual tools VRCs to the development packages and VRCs.
You won't be able to copy the components for development because Baan does not authorize access to the standard VRC and, even more rarely, the tt package. In addition, this package is not part of your package combination so when your development pacc was created, there was no dev VRC created for the tt package (if you used "one step")....manually you cannot create a tools VRC either (no security rights). You can manually compile and install your code (I've experimented with the idea myself), but I would not recommend this as Baan may say that you have voided your support with them. They do not, in any way, support a customer (or consultant) changing anything in the tt package.
EDIguru
10th March 2002, 09:18
Thanks for your reply Kevin.
I am fully aware of the facts you have outlined in your response. What i was referring to was, has anyone tried copying the tools forms, reports, sessions, scripts to any other package in any other VRC or maybe even at the file level / UNIX level and played around with them and tried to mimic the functionality. I was trying some stuff the other day, but was runnign into issues and did not want to invest too much time / reinvent the wheel in case someone has already done it successfully.
Regards
EDIGuru
|*************************************************|
|Engineering is fun, but Reverse Engineering is even more fun |
|*************************************************|
vladimir
20th March 2003, 16:47
Hello.
Thanks MohanaVamsi Potluru for idea.
Thanks Mark Holland for Sample Qkey script.
#!/usr/local/bin/perl
use strict;
my $OBJ = shift @ARGV;
my $BIC_INFO = "bic_info6.1 -e ";
#==============================================================================
print q{
|******************************************************************************
declaration:
long _p_dll_id
long _p_func_id
long _p_err
#define _p_exe0(a) _p_err = exec_function(_p_dll_id, a)
#define _p_exe1(a)
^ _p_func_id = get_function(_p_dll_id, a)
^ _p_err = exec_function(_p_dll_id, _p_func_id)
#define _p_exe2(a)
^ _p_func_id = get_function(_p_dll_id, a)
^ _p_err = exec_function(_p_dll_id, _p_func_id, ret_val)
|****************************** PROGRAM SECTION ***************************
before.program:
_p_dll_id = load_dll("} . $OBJ . q{",0)
if (_p_dll_id <= 0) then
message("Unable to load parent object dll!")
stop()
endif
_p_exe1("before.program")
|******************************************************************************
} ;
#==============================================================================
my @IGNORE_FUNCTIONS = (
'long\s+g_check_input_funcs',
'long\s+library_has_maintable',
'before.program'
);
sub get_object_functions {
local *BI;
my @f;
1. Run
perl gen_wrap.pl baan_object >new_object.bc
2. Create new empty baan script (ttadv2131m000) then paste code from new_object.bc
3. Change Program Script for original session to new_object
baanfan
9th April 2003, 16:12
Hello All,
Can we say that we can use this script for almost all the
types of sessions.Is it possible that sum sections of the baan
session wont get executed by using this method.cuz i have
a reqt of putting sum field level checks on standard sessions like
Mntn. production orders and wud like to know if it is safe to
implement it.
Thank You
~Vamsi
10th April 2003, 04:43
Baanfan,
I do not know how many people are using this solution. I do not. It was a fun project to code.
If you need assurance then should look to www.redklay.com or www.rmcis.com as they both have similar products with support.
klixy23
10th April 2003, 09:17
We use the solution with "rushdll" in session tisfc0202m000. I had some trouble with the form field "cmdt.frm". See my earlier posts in this thread.
Have a nice day.
vladimir
10th April 2003, 11:03
Klixy,
The problem may be in function g_check_input_funcs which is generated by std_gen for all subsections of check.input.
Try to run attached script generated by gen_wrap.pl
Regards.
vladimir
10th April 2003, 12:01
Script
~Vamsi
10th April 2003, 19:07
Vladimir,
All I can say is 'duh'. People have consistently reported problems of check.input not firing and I had not a clue. Thanks for running with the idea and fixing the problems.
Thanks for rewriting the code in Perl. Sigh! So many languages to learn and so little time.
This is the kind of improvements that we envisaged when we started the Code and Utilities forum. It was to have been a forum for people to share ideas and collaboratively develop solutions that the populace would be interested in. So far it has been a forum for one person writes and everyone downloads :). Glad things are changing for the better.
r_nagu
7th May 2003, 17:36
Hi,
I've used this code extender for some sessions with considerable success. I was able to pretty much get done what I wanted with this but, here's is a requirement I ran into today.
I created an extended code using this dll for a session in order to make some process changes after the fact the standard process is done. In order to do that I need to know what is been entered into some of the form field (not table fields) in this session. Now, is it possible to retrieve/catch those values entered on the form fields?
Thanks,
NS
baanfan
24th June 2003, 10:49
hello ,
I have used the code extension successfully for sum finance
sessions like tfacp1120s000 by changing the program script
entry with that of my customized script.Now the problem is when
i maintain the session tfacp1120s000 in maintain trans. types
it gives an invalid session message.Looking at the code i found
that the field level check is using the function tt.session.present()
and it is giving the error.Can anybody please tell me what must
be the problem
Thank you.
vladimir
24th June 2003, 12:22
Function tt.session.present() search record for object in ttiex330000. You may insert record into table or run session ttiex3226m000 (Patch Objects after Error Solving) for new object.
Best regards
baanfan
24th June 2003, 13:32
Thanks for the quick response vladmir.well the entry is present
in the session.what really im not able to understand is that
if i just execute the step ret = tt.sessio.present("tfacp1120s000").
it gives me a return value of 2.But somehow when the standard
session executes the instruction it doesnt get the return value2.
Any suggestions why it might be happening.
vladimir
24th June 2003, 14:39
Solution 152148 from Baan Knowledge Base
Best regards.
baanfan
24th June 2003, 17:34
Thanks Vladmir ur soln. worked after i maintained the entry for
the customized script in the table ttiex330.But shudnt creating
a runtime dd for the sessions shud take care of this.and also
one question still remains in my mind..that why i was getting
a return value of 2 when using tt.session.present
('tfacp1120s000").and behaving differently for the standard
session...
Thanks.
Punitha
6th May 2004, 21:39
Hello,
First of all, thanks to MohanaVamsi Potluru, Praveen Ambekar, Vladimir for the great idea!!
I tried it and it's excellent!
I have a question though.
I would like to use this idea for the standard Baan "PRINT" session "ticst0401m000". The standard script for this session selects by "prod order". What I would like to do is also provide a selection criteria by "item". But, I do not know how to force the SQL to include the selection criteria. Is this possible?
Thanks in advance,
Punitha.
mark_h
6th May 2004, 21:52
You really can not change the actual selects, but you can re-write the sections and use your own code. I usually use the report to provide the filters like you are talking about. I am not familiar with this report, but usually you can just add a check in the detail layout to see if the item is in the selected range then skip the record using lattr.print=false. Yes, the session still does a lot of processing, but it beats the heck out of duplicating the code.
Mark
Punitha
6th May 2004, 22:06
Thank You Mark.
You are right. I didn't want to use the report script to filter the records because it would take all the time in the world to get the data when the user selects by "item" and gives an open range of the "prod order".
I was hoping to do the selection by using ideas like query.extension(which would have worked if I had a main table) or something like that. Do the other wrappers like RMC, QKEY have the same restriction?
Thanks,
Punitha
mark_h
6th May 2004, 22:16
Yes - we actually use Qkey. The worst one I had to do was add main work center to the print production order priority report. The users still complains about it to this day - when they run it manually. Since we did not own source code I really could not do it any better. It works, but slow as a snail. The final solution was to run this in batch to a file at night. Then I wrote a session that literally read thru the file looking for the only the work centers the user requested. Not sure if something like this is feasible in your case.
In a couple of cases I forced them to enter another range just so it did not get bogged down on running everything in the world.
Mark
Punitha
6th May 2004, 22:20
Thanks again Mark! I guess I just have to rewrite the code or have it customized(again!) by a Baan Partner. I wanted to avoid the customization as it is a hassle everytime I put in service packs. You know the story....
I appreciate your input.
Punitha
Punitha
6th May 2004, 23:53
Mark,
I made a workaround that works great for me. By logical reasoning it should work and I did just a quick test now and it works for me without affecting performance and without affecting the code. Of course, I need to do extensive testing. Based on what you said about the main work center on the "prod priority code", I think it'll work for you too...
What I did was as follows:
I used the "rush" to get the dll's(thanks again to the authors, Vamsi and Ambekar). I then redid the selection criteria based on my requirement ie. based on item. I did so by building an additional select query and redefined the selection criteria variables with these new values.
In my case, Baan had the standard selection criteria variables "pdno.f" and "pdno.t".
I created two new variables "item.f" and "item.t" for my requirement.
I reset pdno.f and pdno.t to the min and max values of the prod order with my SQL based on the selected range for "item.f" and "item.t".
Now, everything works as I required.
Thanks Mark, Baanboard and to everyone who contributed to this
thread,
Punitha
~Vamsi
7th May 2004, 07:31
Punitha,
Please post final code as an example if you can.
Punitha
7th May 2004, 15:38
Vamsi,
I'll certainly post my sample code here before the end of the day today or by Mon morning.
Punitha
mark_h
7th May 2004, 15:51
I think I see what you are saying. Do a like a pre-select and run an event or DLL routine inside the selectdo. Sounds like a good solution and much better than using the report.
Mark
Punitha
7th May 2004, 15:53
You are right Mark! "pre-select" is the idea...
Punitha
Punitha
7th May 2004, 23:47
I have attached here, my modifications to the template generated by "RUSH".
I have highlighted in "YELLOW" on my modifications.
Thanks everybody,
Punitha
mostrightfuture
13th July 2004, 12:16
hi all,
All discussion looks great and really worthwile. One thing that is confusing for me. The library (4GL Programm) generated by the RUSH, how I use it? I mean where that library (4GL Program) will be add/use, with the actual session or where ? for example I want to extended the functionaliy of a print session (cisli2405m000). Can I add the generated library (4GL program) to a device script to load the print session in the bakgroud and print the report?
Thanks in advance
Mahmood
dorleta
20th July 2004, 10:29
I never have tested it but this maybe another solution.
bic_cstub6.1 [-s] [-a] -d <library> -o <object>
this function converts a baan dll ( I suppose and program script too ) in a c source. Of this way ( if this works like help says ) let you have the source of all object of baan and changes their funcionality.
Anybody have tested something about?
goooch
27th July 2004, 14:02
Hi All!
Could you describe all problems and solutions with check.input functions and g_check_input_funcs?
I saw the one (but there are several):
The original script:
declaration:
extern domain tcdsca one,two
long error
before.program:
error=true
choice.cont.process:
before.choice:
check.all.input()
on.choice:
message("Are you here? How could you manage this?")
after.choice:
error=true
field.two:
check.input:
error=false
field.one:
check.input:
if error then
message("Something wrong")
set.input.error("")
endif
In this case you'll see the questions
The Rush script (only part!)
before.program:
parent.object.function.id = get_function(parent.object.dll.id,"before.program")
parent.object.error = exec_function(parent.object.dll.id, parent.object.function)
field.one:
check.input:
parent.object.function.id = get_function(parent.object.dll.id,"check.input.one")
parent.object.error = exec_function(parent.object.dll.id, parent.object.function)
field.two:
check.input:
parent.object.function.id = get_function(parent.object.dll.id,"check.input.two")
parent.object.error = exec_function(parent.object.dll.id, parent.object.function)
choice.cont.process:
before.choice:
parent.object.function.id = get_function(parent.object.dll.id,"before.choice.cont.process")
parent.object.error = exec_function(parent.object.dll.id, parent.object.function)
on.choice:
parent.object.function.id = get_function(parent.object.dll.id,"on.choice.cont.process")
parent.object.error = exec_function(parent.object.dll.id, parent.object.function)
after.choice:
parent.object.function.id = get_function(parent.object.dll.id,"after.choice.cont.process")
parent.object.error = exec_function(parent.object.dll.id, parent.object.function)
In this case you'll see the message "Something wrong"
The sample is simple, but the idea was, can i recognize the check.input's order?
Maybe I did some mistakes, sorry
lbencic
27th July 2004, 18:34
I may be missing something too, but I think this would depend on the Form Field Order. If the field 'one' is first on the field order, it would generate this message. If it is after the field 'two', it should not.
Did not test this though, is that true? If not, maybe you can trace the calls and see when that variable is set to false.
goooch
28th July 2004, 07:55
Hi Lisa!
The Field order is not responsible for check.input order while check.all.input works
I think the order of sections check.input in the program is responsible (if I change the order of the sections in the last sample and the result will be the same as the first).
The function g_check_input_funcs has this order, and this function is used
where check.all.input happens
Ok, I can manage the order of check.input sections
but how can I be sure that the order is true (the same as the original)?
Of course, i can follow the field order, but if the originator did not followed this way?
I met this problem with tdilc1122 program. I' ve done the rush script with the alphabet order and has an unexpected result. Restoring section in the field order I have it Ok. I (Everybody?) need the universal remedy
Thank you
hydbaan
10th August 2004, 18:29
did any one try extending a DAL using rush dll
SriksAdi
28th August 2004, 09:43
Hi All,
I am on BaanIVc4 - SP15.
I tried to use RUSH with Sales Orders and Display Customers List.
In both the cases, I could successfully generate the script. But on compiling the generated script, I am facing these compilation errors:
ptccom1510010( 56): Error: Function 'before.program' already declared.
ptccom1510010( 65): Error: Missing RETURN(..) in function 'g_check_input_funcs'
ptccom1510010( 77): Error: Missing RETURN(..) in function 'library_has_maintable'
ptccom1510010( 89): Error: Missing RETURN(..) in function 'tcedi0052.get.next.btno'
ptccom151001g( 116): Error: Function 'library_has_maintable' already declared.
ptccom151001g( 121): Error: Inconsistent number of args function 'g_check_input_funcs' line ptccom1510010(61)
ptccom151001g( 122): Error: Function 'g_check_input_funcs' already declared.
ptccom151001g( 123): Error: 'count' not declared
I have commented a few functions before.program(), g_check_input_funcs(), library_has_maintable(), tcedi0052.get.next.btno and g_check_input_funcs and it went through.
Does it have a fix or shall I continue to comment the script ?
On problem I forsee in commenting is the before.program of the parent would not be executed.
Regadrs
Sriks
PS: Attached is the script generated by RUSH
vktonk
6th March 2007, 10:35
Hi...
I tried using the extended code, I create a dll - tccomdllrushwith rushdll.bc
and 3gl program script tccomrush3gl,compiled, create run time dd.
Now when i try to run that 3gl through Run Program / Session in menu browser, message : cannot start session appears.
Please help me out.
mark_h
7th March 2007, 18:14
The session script should still be a 4gl script - so I am not sure what you are referring to.
kysersoze12
26th March 2007, 12:02
Highly useful utility .Excellent work buddy .
I was confused when first time I saw your scripts .I had to think really deep to understand what you did .I now realise when we compile 4gl script .It is compiled into 3gl .In 3gl object our session choices and field sections are stored as functions .Great work .
I also wanted to inform you that I got an error "array index out of bound" while creating decompiled script of tdsls4101m000 .
david7
12th April 2007, 15:58
This part of code did not work for me :(. I am trying it on LN and my server is on NT.
temp.file = creat.tmp.file$(bse.tmp.dir$())
options = "-e " & strip$(directory) & " -qo " & temp.file
ret = run.baan.prog("bic_info", options, RP_WAIT)
|hopefully the above works on NT!
run.baan.prog returns 1 (ret=1)
I have read some threads and understood that you have to be physically on the NT server. Is there a solution for this problem?
Any ideas?
- David
george7a
24th April 2007, 11:55
I have read some threads and understood that you have to be physically on the NT server. Is there a solution for this problem?
Any ideas?
- David
Hi,
The following thread solves your problem:
http://www.baanboard.com/baanboard/showthread.php?t=34138
- George
Nad2006
24th October 2007, 22:42
Hi ~VAMSI,
I am copying a standard baan form into my dev VRC then I am adding a new field to it .And I am including this into the program script (Qkey).
However at the execution at the form level the field is not recognised and I get " unknown form field refb.f" error message.
The question is it possible to add new fields to the original baan session?
Then how to do it?
Thanks for your Help!
Nad
mark_h
24th October 2007, 23:32
Yes - that is exactly what this is for. Wait are you using Qkey and not ~Vamsi solution? It you are using Qkey post your script in a new post in the tools forum - not on this thread. I suggest compiling it in debug mode to make sure it is running the correct script.
rmarles
17th June 2008, 21:52
Hi All,
Firstly, thanks to ~vamsi and the other supporters of this project; it's an excellent contribution. Also, thanks to mark_h, getting me going on another issue I had (http://www.baanboard.com/baanboard/showthread.php?t=52666), utilizing these routines.
After some guidance from mark_h, I was able to compile both the RUSH DLL and the RUSH program script.
I am running into one more issue however; when trying to solve my problem, I was getting some errors invoking the RUSH program script, errors below.
Upon debugging, I found that it was the section of code that read
input.string("Get Parent Object", "parent object", 16, 16, parent.object)
does not work.
I could hardcode the variable values into the program script, comment out the input strings, and recompile everytime I wanted to use RUSH, but I'd rather get things working correctly moving forward.
We're running ASCII mode, Mark wasn't quite sure if "input.string" was unsupported in ASCII mode - can anyone provide any advise?
Thanks.
Error Messages:
Error [BaFindObjectInProcess ]: Process 196: object 379 not found
Error [BaChangeMainWindow ]: Main window 379 doesn't exists in process 196
Error [BaFindObjectInProcess ]: Process 196: object 379 not found
Error [BaGetMainWindowData ]: Main window 379 doesn't exists in process 196
Error [BaFindObjectInProcess ]: Process 196: object 379 not found
Error [BaChangeMainWindow ]: Main window 379 doesn't exists in process 196
Error [BaFindObjectInProcess ]: Process 196: object 379 not found
Error [BaChangeMainWindow ]: Main window 379 doesn't exists in process 196
rmarles
18th June 2008, 20:39
Quick update; the program script worked fine when I hardcoded the variable values;
If anyone has any recommendations for getting input.string working, or an alternative, please let me know. (ASCII mode)
Thanks.
litrax
19th June 2008, 11:02
I saw some code here or elsewhere and have it running.
You first have to determine if you are in graphical mode:
if graphical.mode then
input.ok = input.string(formname, "target company", 3, 3, s_comp_t)
else
input.ok = ascii.input.string(formname, "target company", 3, s_comp_t)
endif
Then you need to put in the function for ascii.input.string:
function long ascii.input.string(string mwindow.title(80),
string label(80),
long p.width,
ref string s_comp_t() )
{
long win_id
long height, width, row, col
long attrs(WINMAXSIZE)
long new_color, red_int, green_int, blue_int
mwindow.title = strip$(mwindow.title)
label = strip$(label)
new_color = rgb(0,0,0)
red_int = red.component( new_color ) | 46
green_int = green.component( new_color ) | 139
blue_int = blue.component( new_color ) | 87
height = 5
width = max(len(mwindow.title), len(label) + p.width + 2) + 4
win_id = current.window()
get.window.attrs(win_id, attrs)
row = win.height(attrs)
col = win.width(attrs)
row = int(row / 2.0) - int(height / 2.0)
col = int(col / 2.0) - int(width / 2.0)
win_id = sub.window(win_id, height, width, row, col )
box(1, 1, width, height, 1)
row = 1
col = 3
if not isspace( mwindow.title) then
print cp$(col, row) & " " & mwindow.title & " "
endif
row = 3
if not isspace(label) then
print cp$(col, row) & label
col = col + len(label) + 2
endif
data.input(sprintf$("%d %d 0 %d L='\E'", col, row, p.width),
s_comp_t,
s_comp_t)
cl.screen(1, 1, width, height)
del.window(win_id)
refresh()
return (s_comp_t <> chr$(27))
}
Perhaps this is useful for you.
indian_sumesh
7th November 2008, 10:38
Dear Baan Friends,
I wants to use Rush Technique to extend the func. of a Session so how I can get started with the rushdll and main.
some doubts
1) rushdll - in dllusage info it is mentioned that tccomdllrush is used in this dll
from where i can find this tccomdllrush dll?
2) Then I have to create the rushdll ? by copy the contens of the given rushdll script ?
3) Then from where I can run the main script to generate the file showing all the extern functions in the standard session?
Pl. help or explain the steps to use this.
Thanks & regards
Umesh
rmarles
7th November 2008, 14:59
Hi There,
I meant to do up some documentation but never got around to it. The long and short of it.
Grab the code for the tccomrush and tccomrushdll program scripts in post #1 (http://www.baanboard.com/baanboard/showpost.php?p=2475&postcount=1) and post #5 (http://www.baanboard.com/baanboard/showpost.php?p=3239&postcount=5). You'll want the rushdll.bc from post #1 and the main.bc code from post #5.
In ttadv2131m000, Maintain Libraries, create the library tccomdllrush. Copy and paste the contents of the rushdll.bc file from post #1 into here.
In ttadv2130m00, Maintain Program Scripts, create a program script tccomrush. It is a 3GL - Program without Main Table script type ("3GL (Without Stnd.Prgr.)"). Copy and paste the main.bc code in the program script from post #5. Compile.
To run the rush code, run the program "ottcomrush".
It was about 5 months ago when I did this so I hope I remembered all the steps correctly!! :)
mark_h
7th November 2008, 15:10
The main.bc program will create a script. Put this script in your development VRC. At this point you can make code changes inside the script for the changes you need. I also recommend reading very carefully all of the posts in this thread.
indian_sumesh
10th November 2008, 06:03
Dear Marles,
Thanks for the details.
I tried by copy the rushdll.bc code to a new library but while complile got the attached error.
Pl. help.
Thanks & Regards
Umesh
mark_h
10th November 2008, 17:11
The attached compiles cleanly in our environment.
indian_sumesh
12th November 2008, 06:31
The attached compiles cleanly in our environment.
Hi Mark,
What are the latest stpapi patches needs to be install ?
and the error 33 occurs for the line
options = "-e " & strip$(directory) & " -qo " & temp.file
My environment is
OS - Sun solaris
Baan4C4 SP -15 porting - 7
Thanks & Regards
Umesh
mark_h
13th November 2008, 16:45
DId you change the script? My version has
option_rush = "-e " & strip$(directory) & " -qo " & temp.file
I am not sure I would use the variable name "options". That might be the problem.
In this case you do not need to worry about stpapi patches - that is my matra for the API function servers and is not related to this.
kmcinc
28th April 2009, 23:22
Hi All,
I was quite excited to find this thread and have the opportunity to include custom code in standard Baan business processes. Compiling the script and DLL worked fine but I don't get any output file. I
1. specify the object, such as 'otiitm0101' and
2. specify the output file, such as 'pitm0101.c'.
I searched the entire server but did not find the output file. Any suggestions as to what the problem might be? We are working on a Windows platform with Baan IVc4 on SP25.
mark_h
1st May 2009, 19:57
I recommend putting the scripts in debug mode and just tracing thru it to see what directory is getting set. I noticed from the original post several comments in the code about nt. Not sure how much that helps.
simonngou
28th November 2009, 20:31
Hi All,
This idea is very very very Great! It help me so much.
Up to the latest version I got, I found some problems when I was trying to extend code of standard object whinh3512.
The problems:
1. Parsing Extern Function with return value will always return false
Reason is:
Funtion extern domain tcbool somefunction()
will be transferred to
parent.object.function.id = get_function(parent.object.dll.id, "domain tcbool somefunction" )
parent.object.error = exec_function(parent.object.dll.id, parent.object.function.id, ret_val)
return(ret_val)
This problem is fixed after I enchaned the logic of processing return value and function name
2. Missing arguments, I have found some extern function need argument
sunch as when.synchronized.with.child, and it will cause a fatal error at function execution
This problem is not yet fixed but I also have an idea. Extract the arguments and put it behind the ret value at exec_function. But the logic is not yet implemented
3. And I also did a little change :P, I pass the object path directly to the load_dll function, and then i don't need to include otccomdllrush and the extened version (it is just personal style)
WRITELN(" parent.object.dll.id = load_dll(""" & path & """,0)")
WRITELN(" if (parent.object.dll.id <= 0) then")
WRITELN(" message(""Unable to load parent object dll!"")")
WRITELN(" stop()")
WRITELN(" endif")
Thks so much for this great idea, and i help me to solve so many problems
Regards
Simon
mark_h
1st December 2009, 14:20
Nice update! Thanks Simon.
Senthil Kumar R
31st December 2010, 10:54
Hi
I tried these programs and noticed the result is fine, as per the authors statement, here with attached the functional document with step by step procedure. As I am a functional consultant I not made the technical document. Also I am attaching the two files dllrush & main which I used for my customization. Please any Technical (Tools) consultant who used these programs provide technical document for the same.
rajib.koley
31st December 2010, 11:41
Dear Senthil,
I have used this excellent creativity by Mohana Vamsi and Praveen Ambekar. Its very useful, please find the attachment for details. I have also attached the generated script.
Thanks & Regards-
Rajib Koley
joepte
5th November 2012, 20:57
Hi, I know this is a little old now but is the first post in this thread still the latest version for the code wrapper? Thanks...
mark_h
5th November 2012, 21:02
As far as I know it is still the latest version.
~Vamsi
5th November 2012, 22:32
There are issues with the original code to which other users have contributed fixes. You will need to read through all the posts in this thread to get the most benefit.
eric.dizon
29th November 2012, 00:30
I followed the instructions from Senthill Kumar; I created the tccomdllrush - General Library, tccomrush - 3GL (Without 4GL engine) and session to start the program from the files posted from his thread. But when I try to generate otdsls4100 nothing gets generated ? Any help will be greatly appreciated
eric.dizon
29th November 2012, 00:31
Does this wrapper DLL work in ERP LN FP 7 ?
mark_h
29th November 2012, 01:03
Can't answer the "if it works in ERP LN FP 7". But can you put the script in debug mode and watch it run? See if it is generating anything at all or where the break down might be. You should be able to see it creating the file. This would confirm the object is being read and if not where the issue might be.
bhushanchanda
9th January 2014, 21:30
Does this wrapper DLL work in ERP LN FP 7 ?
Yes it works!
FrenkR
9th March 2014, 21:08
..........
benito
25th March 2014, 20:21
i'm in 8.2.1 (fp8) and have 2 sessions built on that.
Does this wrapper DLL work in ERP LN FP 7 ?
kevalghelani
26th August 2014, 11:06
hi..All
i have write wrapper on script whinh3512
but at time of closing detail view of session:whinh3512m100 , it gives fatal error as:
ILLegal number of arg(0) for function when.synchronized.child.exists expected 1
I can't understand which value to be passed to following function after ret..
long ret
parent.object.function.id = get_function(parent.object.dll.id, "when.synchronized.child.exits")
parent.object.error = exec_function(parent.object.dll.id, parent.object.function.id,ret,?)
return(ret)
bhushanchanda
26th August 2014, 11:43
Hi,
Have you tried with 3 arguments?
parent.object.error = exec_function(parent.object.dll.id, parent.object.function.id,ret)
e.g.
#define func(X)
^ parent.object.function.id = get_function(parent.object.dll.id,"X")
^ if parent.object.function.id <> 0 then
^ parent.object.function.return = 0
^ parent.object.error = exec_function(parent.object.dll.id,
^ parent.object.function.id,
^ parent.object.function.return)
^ else
^ message("Function %s not found", "X")
^ endif
giggty
21st August 2018, 16:00
Hello,
not long ago I faced a task which would require altering the behavior of the standard session which Extensibility wouldn't help with. As I had stumbled upon this thread already I thought the time has come at last, time to test this inventive tool that is (I pay deepest respect to MohanaVamsi Potluru and Praveen Ambekar for the original idea). While I was messing around with it I became familiar with the internals of rush and I thought I could try making it even better. So here's my attempt at improving^W fiddling with rush!
Details:
1. I moved all the wrapper-forging code to the dll, so it returns the array of function no more: tccom.dllrush.get.parent.functions() became tccom.dllrush.generate.wrapper.script(). The main reason for that relates to the next point:
2. All string manipulation (file reading and writing) now uses dynamic arrays which grow when needed so no hardcoded limits anymore!
3. This tool now supports wrapping of report objects (can't tell whether this can really be useful, please let me know :))
4. The biggest improvement: functions with arguments are now properly wrapped with the arguments being accurately forwarded.
5. Some refinemnets here and there (path.* functions utilisation for example)
6. main() now shows a dialog where one can pick an object type and zoom into ttadv2539m000 (or ttadv3536m000) to select the object instead of typing its name.
I would love to hear some feedback.
P.S. The question posed by authors is still open: how are the paths inside fd-file separated in case there are drive letters? And what about unix-like systems?
P.P.S. One of the first things that got my attention was the fact that rush parses fd-file to search for parent object. There are standard functions for this, like pathname() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_directory_file_operations_pathname) and search.path.object from ttdllsrch_path. I even rewrote most of the code for using pathname() before I realised that pathname() couldn't tell the difference between standard object and customized one, so it would return "the top" one in terms of the VRC derivation structure which is obviously not gonna work in all cases! So don't step on the same rake :P
Ajesh
30th August 2018, 14:50
I was just checking it out and no need for me to point out that, its an excellent utlity.I was checking out for a standard Session tdsls4401m000 and generated the Code Print Sales Order Acknowledgement/RMAs but one thing i found out that the program never goes to this specific part,function extern on.choice.print.data().
Any Clues??
giggty
31st August 2018, 11:33
What do you mean by "the program never goes to this specific part,function extern on.choice.print.data()"? Had you generated wrapper script, customized on.choice.print.data event and it didn't work?
Ajesh
1st September 2018, 19:23
Yes.. It never hit the on.choice.print data event...
giggty
17th September 2018, 14:35
Sorry for the late reply. Now I can't really remember what was on my mind, when I asked you for a clarification :)
Have you seen this (http://www.baanboard.com/baanboard/showthread.php?t=58974) thread?
vinceco252
17th September 2018, 17:48
I would expect that to mean that the choice.print.data is not present in the original script...
giggty
18th September 2018, 09:57
But why does osls4401 export choice.print.data() then?
mark_h
18th September 2018, 14:27
It could simply be because that is an option on the form - I have seen some qkey sessions export events that never get hit either. It would be nice if you owned source and could look at it to debug exactly what happens. My best guess is that on some of the 4c4 sessions one event launches something so you never hit some of the events that you expect to hit.
tmannais
16th January 2019, 12:17
I am interested in this software but I can't figure out how to use it.
I downloaded main.bc and rushdll.bc files from giggty's post, which I think is the latest version of this.
Also, I use LN 10.5 and 10.6 so I want to know if it will work with those versions.
Please advice.
benito
16th January 2019, 15:43
I use LN10.5 and the wrapper still works. Just go through the discussion and you should be able to make it to work.
I am interested in this software but I can't figure out how to use it.
I downloaded main.bc and rushdll.bc files from giggty's post, which I think is the latest version of this.
Also, I use LN 10.5 and 10.6 so I want to know if it will work with those versions.
Please advice.
mark_h
16th January 2019, 16:06
I am interested in this software but I can't figure out how to use it.
I downloaded main.bc and rushdll.bc files from giggty's post, which I think is the latest version of this.
Also, I use LN 10.5 and 10.6 so I want to know if it will work with those versions.
Please advice.
See posts on page 5 http://www.baanboard.com/baanboard/showthread.php?t=559&page=5 I think post 65/66 it describes high level steps of what do do.
BaaNovva
2nd June 2020, 21:21
In your wrapper class script you did not declare your form field "refb.f'' as "extern''.
BaaNovva
2nd June 2020, 21:24
In your wrapper class script you did not declare your form field "refb.f'' as "extern''.
Hi ~VAMSI,
I am copying a standard baan form into my dev VRC then I am adding a new field to it .And I am including this into the program script (Qkey).
However at the execution at the form level the field is not recognised and I get " unknown form field refb.f" error message.
The question is it possible to add new fields to the original baan session?
Then how to do it?
Thanks for your Help!
Nad