Baanboard.com

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

User login

Frontpage Sponsor

Main

Poll
What version of Baan have you installed
Baan IV
36%
FP3
5%
FP4
0%
FP5
0%
FP6
0%
FP7
0%
10.2 (incl. 10.2.1)
0%
10.3
9%
10.4
18%
10.5
27%
Other
5%
Total votes: 22

Baanboard at LinkedIn


Reference Content

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 23rd November 2017, 10:42
giggty giggty is offline
Junior Member
 
Join Date: May 2017
Posts: 8
giggty is on a distinguished road
Baan: Infor ERP 10.5 - DB: MSSQL Server 2008 R2 - OS: Windows Server 2012
Question updating whinh290 upon inserting into whinh220
Baan: ERP LN 6.1 FP11 (Infor ERP 10.5)
C/S: None/Unknown

Hello everyone,

so I need to create a new record in whinh290 when a new row is inserted into whinh220. I tried different approaches:

1. I created Extension for whinh220, where inside after.save.object(long mode) hook I added my code. But it was not working. Judging from the trace file it seems like adding a record into whinh290 causes an update on whinh220 creating recursion.
2. So I decided to try out running whinh290 update code with activate() as a separate process. I fiddle around a bit with suspend() to leverage actual running times of main and child threds. And sometimes it does seem like a record in whinh290 was created (i'm checking it in ttaad4100), but after a while it gets removed so I suspect transaction doesn't end properly.
3. I also tried creating whinh220ue DLL and using ue.after.after.save.object(long mode) hook for updating whinh290. Same problem: it recurs.
Quote:
Process 65 - Fatal Error : Function 'ue.before.after.save.object': recursion not possible; refcount=2.
Process 65 - Fatal Error : Can not continue in whinh2120m000 in DLL: owhinh220ue (ue.after.after.save.object)[last function:exec_function]
Process 65 - Error : whinh2120m000: A not terminated transaction is aborted (ue.after.after.save.object() in object owhinh220ue)
(Also for some reason I can't use CDFs inside whinh220ue)

I'm using dal.new.object() and dal.save.object() for inserting records into whinh290.

What can be done here?
  #2  
Old 28th November 2017, 15:21
giggty giggty is offline
Junior Member
 
Join Date: May 2017
Posts: 8
giggty is on a distinguished road
Baan: Infor ERP 10.5 - DB: MSSQL Server 2008 R2 - OS: Windows Server 2012
If anyone is interested, here are two possible solutions:
1. Use db.insert() instead of dal.new.object(), so that whinh290 DAL doesn't get called.
2. Before calling dal.save.object() one should issue
Code:
dal.start.business.method("whinh290", "set.update.outbound.line.to.false", ret.val.long)
and no update on whinh220 will follow
Sponsored Links
  #3  
Old 28th November 2017, 19:16
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,949
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Always interested in solutions - it might help someone in the future. So thanks for posting those possible solutions.
__________________
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.
Closed Thread


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
fatal error while updating packing slip wrongly entered by user sandeeprana302 Blogs and Web links 1 13th June 2014 13:37
Discrepency of inserting records into table satishnara Tools Development 3 21st May 2010 16:18
inserting or updating data in multiple companies from same program veyant Tools Development 3 22nd May 2004 11:06


All times are GMT +2. The time now is 11:03.


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