Baanboard.com

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

User login

Frontpage Sponsor

Main

Poll
How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
19%
200 - 500 GB
28%
500 - 800 GB
2%
800 - 1200 GB
7%
1200 - 1500 GB
7%
1500 - 2000 GB
12%
> 2000 GB
24%
Total votes: 83

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 12th December 2019, 06:36
tmannais's Avatar
tmannais tmannais is offline
Senior Member
 
Join Date: Jul 2017
Location: Bangkok, Thailand
Posts: 264
tmannais is on a distinguished road
Baan: LN 10.5, 10.6, 10.7 - DB: MSSQL - OS: Windows
Error when using DAL to insert a date field
Baan: Infor ERP 10.5
C/S: Both

I am working on a customized session where I am trying to insert a Sales Order Line into a Sales Order Header using DAL.

Code:
if dal.new.object("tdsls401") <> 0 then
	dal.get.error.message(error.msg)
	return(error.msg)
endif
dal.set.field("tdsls401.orno", i.sales.order)
dal.set.field("tdsls401.ofbp", i.stbp)
dal.set.field("tdsls401.odat", utc.num()) |* The error occurs when I add this line
dal.set.field("tdsls401.pono", i.position)
dal.set.field("tdsls401.item", i.item)
dal.set.field("tdsls401.qoor", i.qty)
dal.set.field("tdsls401.pric", i.price)
dal.set.field("tdsls401.ldam", i.discount)
if dal.save.object("tdsls401") <> 0 then
	dal.get.error.message(error.msg)
	return(error.msg)
endif
See the error in attached image.
The error happens when it reaches "dal.set.field("tdsls401.odat", utc.num())".
If I don't add the line, it will display another error Release Date is required but it is also a date field, which I also cannot solve that error even when I send a date.

Any help is appreciated.
Attached Images
File Type: png sol-odat-error.png (19.4 KB, 16 views)
Reply With Quote
  #2  
Old 12th December 2019, 17:01
martin.f martin.f is offline
Member
 
Join Date: Nov 2019
Location: Germany, Kempten
Posts: 35
martin.f is on a distinguished road
Baan: LN 10.5 - DB: Microsoft SQL - OS: Microsoft Windows 10
Try to initialize the date outside:

domain tcdate today
today = utc.date()


dal.set.field("tdsls401.odat", today)

Regards
Martin
Reply With Quote
  #3  
Old 13th December 2019, 03:44
tmannais's Avatar
tmannais tmannais is offline
Senior Member
 
Join Date: Jul 2017
Location: Bangkok, Thailand
Posts: 264
tmannais is on a distinguished road
Baan: LN 10.5, 10.6, 10.7 - DB: MSSQL - OS: Windows
Quote:
Originally Posted by martin.f View Post
Try to initialize the date outside:

domain tcdate today
today = utc.date()


dal.set.field("tdsls401.odat", today)

Regards
Martin
I tried it but it does not work.
The error is still the same.

Last edited by tmannais : 13th December 2019 at 04:01.
Reply With Quote
  #4  
Old 13th December 2019, 07:48
srkndnsn srkndnsn is offline
Member
 
Join Date: Aug 2016
Posts: 34
srkndnsn is on a distinguished road
Baan: Infor Ln10.4 - DB: Oracle - OS: Unix
Quote:
Originally Posted by tmannais View Post
I am working on a customized session where I am trying to insert a Sales Order Line into a Sales Order Header using DAL.

Code:
if dal.new.object("tdsls401") <> 0 then
	dal.get.error.message(error.msg)
	return(error.msg)
endif
dal.set.field("tdsls401.orno", i.sales.order)
dal.set.field("tdsls401.ofbp", i.stbp)
dal.set.field("tdsls401.odat", utc.num()) |* The error occurs when I add this line
dal.set.field("tdsls401.pono", i.position)
dal.set.field("tdsls401.item", i.item)
dal.set.field("tdsls401.qoor", i.qty)
dal.set.field("tdsls401.pric", i.price)
dal.set.field("tdsls401.ldam", i.discount)
if dal.save.object("tdsls401") <> 0 then
	dal.get.error.message(error.msg)
	return(error.msg)
endif
See the error in attached image.
The error happens when it reaches "dal.set.field("tdsls401.odat", utc.num())".
If I don't add the line, it will display another error Release Date is required but it is also a date field, which I also cannot solve that error even when I send a date.

Any help is appreciated.
dal.set.field("tdsls401.odat", utc.num()) this should be worked. We are using everyday in Infor LN 10.4 . Maybe in the 10.5; the domain has been changed in the tdsls401. Can you check this?

Best,
Serkan
Reply With Quote
  #5  
Old 13th December 2019, 08:32
tmannais's Avatar
tmannais tmannais is offline
Senior Member
 
Join Date: Jul 2017
Location: Bangkok, Thailand
Posts: 264
tmannais is on a distinguished road
Baan: LN 10.5, 10.6, 10.7 - DB: MSSQL - OS: Windows
Quote:
Originally Posted by srkndnsn View Post
dal.set.field("tdsls401.odat", utc.num()) this should be worked. We are using everyday in Infor LN 10.4 . Maybe in the 10.5; the domain has been changed in the tdsls401. Can you check this?

Best,
Serkan
The domain is tcdate.
Reply With Quote
Sponsored Links
  #6  
Old 13th February 2020, 12:00
tmannais's Avatar
tmannais tmannais is offline
Senior Member
 
Join Date: Jul 2017
Location: Bangkok, Thailand
Posts: 264
tmannais is on a distinguished road
Baan: LN 10.5, 10.6, 10.7 - DB: MSSQL - OS: Windows
I just solved the problem.

It is accidentally caused by another variable in my script named "status" as extern variable.

This name is used in some dll that dal apparently calls within itself. So, the variable name collides with standard dll hence the error.

Changing the variable name from "status" to something else does solve the issue.
Reply With Quote
  #7  
Old 13th February 2020, 13:30
srkndnsn srkndnsn is offline
Member
 
Join Date: Aug 2016
Posts: 34
srkndnsn is on a distinguished road
Baan: Infor Ln10.4 - DB: Oracle - OS: Unix
Quote:
Originally Posted by tmannais View Post
I just solved the problem.

It is accidentally caused by another variable in my script named "status" as extern variable.

This name is used in some dll that dal apparently calls within itself. So, the variable name collides with standard dll hence the error.

Changing the variable name from "status" to something else does solve the issue.
I am glad you have solved it. But that one is tricky.

We should never prefer the variable names which can be used in dll
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
ue.before.after.destroy.object pralash Tools Development 8 6th August 2018 14:37
CDF Date field Sachinjoshi Tools Development 5 5th February 2017 08:59
Compilation Error baansavvy Tools Development 4 20th April 2010 17:25
Baan null date field view from oracle sql zaidlaz Tools Development 9 21st June 2006 18:13
Date Field Error during Load Oracle Data into Microsoft SQL server through ODBC wangxn Tools Administration & Installation 2 11th April 2002 15:07


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


©2001-2018 - Baanboard.com - Baanforums.com