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 13th February 2020, 12:08
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
tdsls101.ldam in DAL method - always 0 value
Baan: Infor ERP 10.5
C/S: Both

Similar to this thread: http://www.baanboard.com/baanboard/s...ad.php?t=48318

I need to use DAL to update fields in Sales Order Line and Sales Quotation Line.
There is a problem when I try to update discount in the line.

I solved the issue in Sales Order Line using the solution in mentioned link.

However, the same method does not solve the same issue in Sales Quotation Line.

The field is tdsls101.ldam.

This is current code.

Code:
	select	tdsls101.*
	from	tdsls101 for update
	where	tdsls101.qono = :i.sales.quotation
	and		tdsls101.pono = :i.position
	as set with 1 rows
	selectdo
		dal.change.object("tdsls101")
		dal.set.field("tdsls101.item", i.item)
		dal.set.field("tdsls101.qoor", i.qty)
		dal.set.field("tdsls101.pric", i.price)
		dal.set.field("tdsls101.ldam", i.ldam, 1)
		dal.set.field("tdsls101.dorg", tdgen.dorg.manual, 1)
		if dal.save.object("tdsls101") <> 0 then
			while dal.get.error.message(error.msg) > -1 
				message(error.msg)
			endwhile
		endif
	endselect
Current situation from this code is that both tdsls101.ldam and tdsls101.dorg are 0 and Not Applicable respectively after the code gets executed while other fields get updated correctly. No errors whatsoever.

Any clues?
Reply With Quote
  #2  
Old 17th February 2020, 09:57
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
Right now my workaround is to query the record and set the discount separately from other fields as follows:

Code:
        domain	tdcrm.emsg	error.msg
	select	tdsls101.*
	from	tdsls101 for update
	where	tdsls101.qono = :i.sales.quotation
	and		tdsls101.pono = :i.position
	as set with 1 rows
	selectdo
		dal.change.object("tdsls101")
		dal.set.field("tdsls101.item", i.item)
		dal.set.field("tdsls101.qoor", i.qty)
		dal.set.field("tdsls101.pric", i.price)
		if dal.save.object("tdsls101") <> 0 then
			while dal.get.error.message(error.msg) > -1 
				message(error.msg)
			endwhile
		endif
	endselect
	| Workaround for updating Discount Amount
	select	tdsls101.*
	from	tdsls101 for update
	where	tdsls101.qono = :i.sales.quotation
	and		tdsls101.pono = :i.position
	as set with 1 rows
	selectdo
		dal.change.object("tdsls101")
		dal.set.field("tdsls101.ldam", i.ldam, 1)
		dal.set.field("tdsls101.dorg", tdgen.dorg.manual, 1)
		if dal.save.object("tdsls101") <> 0 then
			while dal.get.error.message(error.msg) > -1 
				message(error.msg)
			endwhile
		endif
	endselect
If anyone has a better idea, feel free to share. I'm always looking for better solutions.
Reply With Quote
  #3  
Old 18th February 2020, 12:49
Sahil Sharma Sahil Sharma is offline
Member
 
Join Date: Jul 2018
Posts: 37
Sahil Sharma is on a distinguished road
Baan: FP 10.4 - DB: BAAN - OS: windows 10
Code:
select	tdsls101.*
	from	tdsls101 for update
	where	tdsls101.qono = :i.sales.quotation
	and		tdsls101.pono = :i.position
	as set with 1 rows
	selectdo
		dal.change.object("tdsls101")
		dal.set.field("tdsls101.item", i.item)
		dal.set.field("tdsls101.qoor", i.qty)
		dal.set.field("tdsls101.pric", i.price)
		dal.set.field("tdsls101.ldam(1)", i.ldam)
		dal.set.field("tdsls101.dorg(1)", tdgen.dorg.manual)
		if dal.save.object("tdsls101") <> 0 then
			while dal.get.error.message(error.msg) > -1 
				message(error.msg)
			endwhile
		endif
	endselect
You can try it like this.
Reply With Quote
Sponsored Links
  #4  
Old 19th February 2020, 03:53
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 Sahil Sharma View Post
Code:
select	tdsls101.*
	from	tdsls101 for update
	where	tdsls101.qono = :i.sales.quotation
	and		tdsls101.pono = :i.position
	as set with 1 rows
	selectdo
		dal.change.object("tdsls101")
		dal.set.field("tdsls101.item", i.item)
		dal.set.field("tdsls101.qoor", i.qty)
		dal.set.field("tdsls101.pric", i.price)
		dal.set.field("tdsls101.ldam(1)", i.ldam)
		dal.set.field("tdsls101.dorg(1)", tdgen.dorg.manual)
		if dal.save.object("tdsls101") <> 0 then
			while dal.get.error.message(error.msg) > -1 
				message(error.msg)
			endwhile
		endif
	endselect
You can try it like this.
It does not work. Gives the same result as my original code.
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
Insert fields DAL RavCOder Tools Development 0 25th October 2019 13:49
tdsls401.disc in DAL method - always 0 value rmloduchowski Distribution, Transportation & Warehousing 11 18th October 2019 10:25
ue.before.after.destroy.object pralash Tools Development 8 6th August 2018 14:37
bpmdm001 DAL Sandy Blondino Tools Development 4 6th November 2014 16:12
When DAL 1 or DAL 2 in Infor LN 6.1 gget79 Tools Development 5 27th May 2009 11:23


All times are GMT +2. The time now is 09:00.


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