Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Manufacturing & Supply Chain

User login

Frontpage Sponsor

Main

Google search


Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
33%
Installation Wizard into new VRC
39%
Manual into existing VRC
6%
Manual into new VRC
22%
Total votes: 49

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 19th February 2018, 16:47
VishalMistry's Avatar
VishalMistry VishalMistry is offline
Guru
 
Join Date: Dec 2004
Location: India, Gujarat
Posts: 599
VishalMistry has a little shameless behaviour in the past
Baan: Baan IV, ERPLn - DB: SQL Server 2000 / 2008 - OS: Windows Server 2003 / 2008
Red face How to identify newly added sales order lines in tdsls051
Baan: Baan IVc4

Hi all,

Is there any way or any field in tdsls051 (sales order lines history) that indicates that it is a freshly entered sales order line.

Please guide.

Vishal
Reply With Quote
  #2  
Old 22nd February 2018, 12:56
vahdani's Avatar
vahdani vahdani is offline
Guru
 
Join Date: Aug 2002
Location: Cologne, Germany
Posts: 436
vahdani is on a distinguished road
Baan: all - DB: all - OS: Unix / Win2K
Hi,

Index5 of tdsls051 starts with the date. You could do something like the following in your script to find the newly eneterd lines:
Code:
	domain	tcdate	date.from
		long	last.ckor
	
	|Get all Positions entered since January forst 2018
	date.from = date.to.num(	2018, 	|long yearno 
					01,	|long monthno
					01)	|long month_dayno
					
	|or alternatively enter "date.from" in your session form!

	select	tdsls051.orno, tdsls051.pono, max(tdsls051.ckor):last.ckor
	from	tdsls051
	where	tdsls051._index5 >= {:date.from}
	group by tdsls051.orno, tdsls051.pono
	selectdo
		|Possible values of tdsls051.ckor are: 
		|1 =entered 2 =deleted 3 =invoiced
		if last.ckor = 2 then
			|Line was deleted!
			continue
		endif
		|Print or process found lines
		...
	endselect
__________________
May the force be with you!
Reply With Quote
  #3  
Old 23rd February 2018, 16:01
VishalMistry's Avatar
VishalMistry VishalMistry is offline
Guru
 
Join Date: Dec 2004
Location: India, Gujarat
Posts: 599
VishalMistry has a little shameless behaviour in the past
Baan: Baan IV, ERPLn - DB: SQL Server 2000 / 2008 - OS: Windows Server 2003 / 2008
Hi,

Thanks for your guidance. Below is my scenario:

1. On 22nd Feb, I added pos 10 in SO and did some modifications in line on same date. When I ran the report, it came fine printing only first record.
2. On 23rd Feb, I modified same line in same SO. When I ran the report for
23rd Feb, it printed the line with pos 10 thinking it was entered and not modified.

and one more thing, Wethere we add a new line or modify existing line, value of ckor remains 1.

function read.main.table()
{
on.change.check(tdsls051.pono)
select tdsls051.*
from tdsls051
where tdsls051._index5 inrange {:trdt.f} and {:trdt.t}
and tdsls051.cuno inrange :cuno.f and :cuno.t
order by tdsls051._index1
selectdo
if changed(tdsls051.pono) then
get.customer.name()
get.item.description()
rprt_send()
on.change.check(tdsls051.pono)
endif
endselect
}

Initially I wrote the above logic thinking everything from sales order line creation to modification happens in same date, but, it did not work if I modified a line which was created on a previous date.

Vishal
Reply With Quote
  #4  
Old 8th March 2018, 12:41
avpatil avpatil is offline
Guru
 
Join Date: Feb 2002
Posts: 720
avpatil is on a distinguished road
Baan: IVc3 - DB: SQL2000 - OS: Win 2003
The field ckor in tdssls051 that will show if it is new line, deleted line or modified line. I don't think your code is correct. Also, if a line is entered then deleted and again get created ckor will be 1, 2 and 1 again. What exactly is the definition of new line. Is it the first time the record getting created or what?
Reply With Quote
Sponsored Links
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
AFS Sales Order Insert eric.dizon AFS/DDC/OLE: Function servers 3 11th June 2014 22:46
Sales Order lines PaEspinel Distribution, Transportation & Warehousing 1 14th February 2013 18:37
Step Size in Sales Order Lines shah_bs Distribution, Transportation & Warehousing 2 18th August 2010 23:36
Dal king1980 Tools Development 6 19th March 2010 12:10
NO Transport order generated sammeer Distribution, Transportation & Warehousing 4 7th June 2003 08:02


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


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