Baanboard.com

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

User login

Frontpage Sponsor

Main

Poll
Does your use of MS-SharePoint requires interface with your ERP system?
We do not use MS-SharePoint
46%
We do not have a need for an interface between SharePoint and ERP
18%
We need to insert or update data in SharePoint from the ERP
9%
We need to access SharePoint data from the ERP
1%
We need to access and insert data to SharePoint from the ERP
12%
We already have a third party tool to create the interface between SharePoint and ERP
10%
Other - Please Comment
3%
Total votes: 67

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 4th February 2011, 22:39
pur615 pur615 is offline
Junior Member
 
Join Date: Dec 2010
Posts: 6
pur615 is on a distinguished road
Baan: Ln - DB: Oracle - OS: Unix
UE Script
Baan: ERP LN 6.1 FP6
C/S: None/Unknown

Would much appreciate if someone posted a sample UE script. Thanks
Reply With Quote
  #2  
Old 4th February 2011, 22:46
vinceco252's Avatar
vinceco252 vinceco252 is offline
Guru
 
Join Date: Mar 2002
Location: Frederick, CO
Posts: 352
vinceco252 is on a distinguished road
Baan: Baan IVc3, IVc4, 5b, 5c, ERP LN 6.1, Infor ERP 10.x - DB: SQL Server, Oracle - OS: Windows, Linux, HPUX, AIX, (a little bit of) Solaris
Code:
|******************************************************************************
|* tdsls401ue  0  
|* Sales Order Lines
|******************************************************************************
|* Script Type: Library
|******************************************************************************
	table ttdsls400
	table ttdsls401
	table tbrarw010                                                                                
#include <bic_dal>


function extern long ue.before.before.save.object(long mode)
{
	on case mode
	case DAL_NEW:
		select	brarw010.*
		from	brarw010
		where	brarw010.cuno = :tdsls401.ofbp
		and	brarw010.item = :tdsls401.item
		selectdo
			tdsls401.corn = brarw010.cupo
		selectempty
			if not isspace(tdsls400.corn) then
				tdsls401.corn = tdsls400.corn
			else
				tdsls401.corn = ""
			endif
		endselect
		break

	case DAL_UPDATE:
		select	brarw010.*
		from	brarw010
		where	brarw010.cuno = :tdsls401.ofbp
		and	brarw010.item = :tdsls401.item
		selectdo
			tdsls401.corn = brarw010.cupo
		selectempty
			if not isspace(tdsls400.corn) then
				tdsls401.corn = tdsls400.corn
			endif
		endselect

		break
	endcase
	return(0)
}
__________________
Vincent Murphy
---------------
Senior ERP Consultant
OST
vmurphy@ostusa.com
Reply With Quote
  #3  
Old 4th February 2011, 23:48
bdittmar's Avatar
bdittmar bdittmar is offline
Guru
 
Join Date: Apr 2002
Location: Germany, 50.584097,8.544078
Posts: 1,395
bdittmar will become famous soon enough
Baan: 2.2/3.1/4c4/LN6.1 FP6/FP9/HiDox - DB: tbase, ms-sql7, oracle10gV1, 11g - OS: HP-UX, W2K3, SLES
user exit UE

Quote:
Originally Posted by pur615 View Post
Would much appreciate if someone posted a sample UE script. Thanks
Hello,

User Exit DLL Overview
Overview

A User Exit DLL (UEDLL) is a DLL that will reside outside the standard software. It will have the same name as a standard DAL with the extension 'ue' (for 'user exit'). E.g. 'whinh200ue' for table whinh200. Customers can implement a UEDLL in order to be able to define extra business logic before and after the standard 'before' and 'after' handling of saves and deletes, by means of specific hooks that will be executed by the 4GL engine and/or DAL Engine. In this way it is possible to e.g. conditionally publish data changes to the outside world.

Interaction with 4GL Engine / DAL Engine

When present, the User Exit DLL for a certain table will be loaded by the 4GL engine/DAL Engine by the time the DAL for this particular table will be loaded. In situations where no DAL is present this will be the moment at which a DAL would be loaded if it existed. This means that there is no need to have a DAL in order to make use of the UEDLL.

Preconditions

A DLL becomes a UEDLL when it meets the following conditions:

Its name is consisting of the table code with 'ue' as suffix, like whinh200ue
It includes bic_dal, as follows: #include <bic_dal>
Restrictions

A UEDLL is treated like a regular DAL. This means all kind of DAL related functionality can be used, like:

Function with.old.object.values.do()
Function with.object.set.do()
Pre-defined variable subdal
Note however that the following restrictions apply:

Business methods cannot be implemented in a UEDLL Instead the business logic should be programmed in another (separate) general DLL.
It is strongly discouraged to define other external functions in a UEDLL and link the UEDLL directly to other scripts. Instead, use a normal general DLL. (This also applies to regular DALs).
User Exit Hooks

A UEDLL script can contain the following hooks:

ue.before.before.save.object()
ue.after.before.save.object()
ue.before.after.save.object()
ue.after.after.save.object()
ue.before.before.destroy.object()
ue.after.before.destroy.object()
ue.before.after.destroy.object()
ue.after.after.destroy.object()
Related topics

Data Access Layer


Regards
__________________
//Bernd
Reply With Quote
  #4  
Old 5th February 2011, 02:24
pur615 pur615 is offline
Junior Member
 
Join Date: Dec 2010
Posts: 6
pur615 is on a distinguished road
Baan: Ln - DB: Oracle - OS: Unix
That was helpful. Thanks a lot.
Reply With Quote
  #5  
Old 7th February 2011, 17:53
benito's Avatar
benito benito is online now
Guru
 
Join Date: Jan 2002
Location: Eastern US
Posts: 319
benito is on a distinguished road
Baan: ERPLn 10.2.1 / BaanIVc4 - DB: Oracle11/Informix - OS: Unix/Linux
question

do you attach the ue script to a table or a session?
Reply With Quote
  #6  
Old 7th February 2011, 19:40
bdittmar's Avatar
bdittmar bdittmar is offline
Guru
 
Join Date: Apr 2002
Location: Germany, 50.584097,8.544078
Posts: 1,395
bdittmar will become famous soon enough
Baan: 2.2/3.1/4c4/LN6.1 FP6/FP9/HiDox - DB: tbase, ms-sql7, oracle10gV1, 11g - OS: HP-UX, W2K3, SLES
Table !

Quote:
Originally Posted by benito View Post
do you attach the ue script to a table or a session?
Hello,
as described:

A User Exit DLL (UEDLL) is a DLL that will reside outside the standard software. It will have the same name as a standard DAL with the extension 'ue' (for 'user exit'). E.g. 'whinh200ue' for table whinh200.

User Exit for Table tisfc001 is tisfc001ue.
User Exit for Table timfc010 is timfc010ue aso.

Regards
__________________
//Bernd
Reply With Quote
  #7  
Old 7th February 2011, 20:20
benito's Avatar
benito benito is online now
Guru
 
Join Date: Jan 2002
Location: Eastern US
Posts: 319
benito is on a distinguished road
Baan: ERPLn 10.2.1 / BaanIVc4 - DB: Oracle11/Informix - OS: Unix/Linux
that's exactly what i did but cant make it to work. i created a standard library called ticpr200ue. it is also outside the standard software, meaning not linked to a table. any new tips?
Reply With Quote
  #8  
Old 7th February 2011, 21:30
vinceco252's Avatar
vinceco252 vinceco252 is offline
Guru
 
Join Date: Mar 2002
Location: Frederick, CO
Posts: 352
vinceco252 is on a distinguished road
Baan: Baan IVc3, IVc4, 5b, 5c, ERP LN 6.1, Infor ERP 10.x - DB: SQL Server, Oracle - OS: Windows, Linux, HPUX, AIX, (a little bit of) Solaris
I don't have an LN environment in front of me, but I think you do have to attach the script to the table as you would a standard DAL.

Vince
__________________
Vincent Murphy
---------------
Senior ERP Consultant
OST
vmurphy@ostusa.com
Reply With Quote
  #9  
Old 7th February 2011, 21:48
benito's Avatar
benito benito is online now
Guru
 
Join Date: Jan 2002
Location: Eastern US
Posts: 319
benito is on a distinguished road
Baan: ERPLn 10.2.1 / BaanIVc4 - DB: Oracle11/Informix - OS: Unix/Linux
i have tried that also but im having a message "change the value of the program script/library field. Reason: script already exists in package VRC ti B61U a stnd". I was wondering if im missing some enabling parameter. ticpr200 has the DAL library already and looks like its not allowing me to add another one on top of this.
Reply With Quote
  #10  
Old 7th February 2011, 22:55
vinceco252's Avatar
vinceco252 vinceco252 is offline
Guru
 
Join Date: Mar 2002
Location: Frederick, CO
Posts: 352
vinceco252 is on a distinguished road
Baan: Baan IVc3, IVc4, 5b, 5c, ERP LN 6.1, Infor ERP 10.x - DB: SQL Server, Oracle - OS: Windows, Linux, HPUX, AIX, (a little bit of) Solaris
Ok, so it is NOT attached to the table. It needs to be a general library with the naming convention as indicated above (i.e., tdsls401ue for a UE library for table tdsls401). You also need to include bic_dal. I don't see this listed as a requirement, but I would also suggest you declare the table for which you are writing the script.

That should be it.

Vince
__________________
Vincent Murphy
---------------
Senior ERP Consultant
OST
vmurphy@ostusa.com
Reply With Quote
  #11  
Old 8th February 2011, 07:19
ulrich.fuchs's Avatar
ulrich.fuchs ulrich.fuchs is offline
Guru
 
Join Date: Aug 2001
Location: Germany
Posts: 500
ulrich.fuchs is on a distinguished road
Baan: IV, LN6.1 - DB: --- - OS: ---
Again, it's just a DLL following a particular naming convention. No need to link it to a table somehow.

Next: You're showing "FP3" there. For User Exits to be available, you need at lease Tools-Version 7.6.b4, or Tools Version 7.6.a4 with Solution 224004.
__________________

Dipl. Ing. Ulrich Fuchs
- ERP consulting and software development -
Hiltroper Straße 103 - 44807 Bochum - Germany
mail@ulrich-fuchs.de - www.ulrich-fuchs.de
sofcab.blogspot.com (Blog zur Software formally called Baan)
Reply With Quote
  #12  
Old 8th February 2011, 14:22
benito's Avatar
benito benito is online now
Guru
 
Join Date: Jan 2002
Location: Eastern US
Posts: 319
benito is on a distinguished road
Baan: ERPLn 10.2.1 / BaanIVc4 - DB: Oracle11/Informix - OS: Unix/Linux
thank you but...

still not working...see attachment.
Attached Files
File Type: doc user_exit.doc (54.0 KB, 137 views)
Reply With Quote
  #13  
Old 8th February 2011, 17:52
ulrich.fuchs's Avatar
ulrich.fuchs ulrich.fuchs is offline
Guru
 
Join Date: Aug 2001
Location: Germany
Posts: 500
ulrich.fuchs is on a distinguished road
Baan: IV, LN6.1 - DB: --- - OS: ---
Again, do NOT link the user exit script anywhere. Neither to the Table, nor as a library of the DAL of that table.

Most important thing: The user exit script is always exectuted WITHIN the standard's transactions.

!!!!! NEVER EVER use either one of db.retry.point (), commit.transaction () or abort.transaction() in such a script or any DLL function that is called from that script!!!!!

This will certainly mess up the standard functionality of the software a lot, creating corrupt data.

Also, please ** READ ** what people are telling you here, if they are taking the time to help you. You're on an outdated tools version that does not support user exits, unless a solution is installed. Is it installed?

Third, user exists are only triggered if the table is accessed
* as the main table of a session. Since there is no session for maintaining records in ticpr200, that's not true for you
* or programmatically, using dal.save-commands instead of db.updates. This may not be the case in your situation. Especially in older patch levels of FP3 (even up to nowadays FP7) there might be situations when the standard scripts update tables directly. In that case, the User Exit will not be triggered. I can easily imagine that eg during cost price calculation that might be the case.

Uli
__________________

Dipl. Ing. Ulrich Fuchs
- ERP consulting and software development -
Hiltroper Straße 103 - 44807 Bochum - Germany
mail@ulrich-fuchs.de - www.ulrich-fuchs.de
sofcab.blogspot.com (Blog zur Software formally called Baan)
Reply With Quote
Sponsored Links
  #14  
Old 8th February 2011, 19:28
benito's Avatar
benito benito is online now
Guru
 
Join Date: Jan 2002
Location: Eastern US
Posts: 319
benito is on a distinguished road
Baan: ERPLn 10.2.1 / BaanIVc4 - DB: Oracle11/Informix - OS: Unix/Linux
ulrich,

most of the information you gave are new to me (e.g. not to use db.retry.point, etc., including the trigger of the table. ). solution 224120 (that includes 224004) is already installed in my system. i guess i will have to look for a table that is being used as main table and try it from there.
Reply With Quote
  #15  
Old 10th February 2011, 20:30
lbencic's Avatar
lbencic lbencic is offline
Guru
 
Join Date: Dec 2001
Location: Lisle, IL, USA
Posts: 1,148
lbencic will become famous soon enough
Baan: 2.2d - LN - DB: most - OS: most
Solved yet? it should be that simple, if your tools are patched. maybe it's not using dal commands to update your values to begin with, so your ue is not calling either? just a thought.
Try testing if the ue works at all -
in TEST!! Generate a simple maintenance session for the table you are working with, and put your ue code in debug so you can see if it even comes up when you change/save a record (if it works is a different matter
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
Code: Sample Qkey Script mark_h Code & Utilities 7 9th December 2013 14:33
can 1 session has more than 1 program script? niralibaan Tools Development 6 5th February 2010 13:14
Good Practice for storing 'external' source code in BAAN shah_bs Code & Utilities 1 30th July 2008 22:02
Variable value different in pgm. script & report script ? PacSun Tools Development 5 28th June 2006 19:09
unix script not executing properly Eddie Monster Tools Development 7 19th January 2006 19:55


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


©2001-2013 - Baanboard.com - Baanforums.com