Baanboard.com

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

User login

Frontpage Sponsor

Main

Google search


Poll
How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
15%
200 - 500 GB
30%
500 - 800 GB
4%
800 - 1200 GB
4%
1200 - 1500 GB
11%
1500 - 2000 GB
15%
> 2000 GB
22%
Total votes: 27

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 6th July 2018, 10:10
tracylee tracylee is offline
Member
 
Join Date: Sep 2011
Posts: 71
tracylee is on a distinguished road
Baan: ERP LN 6.1 - DB: MYSQL - OS: ERP LN
dll script issue
Baan: ERP LN 6.1 FP11 (Infor ERP 10.5)
C/S: None/Unknown

Hi,

Now i try to write a dll script but when I compile a script prompt the message "Error: Unresolved reference to function 'tcmcs.dll0050.check.and.generate.order.number'.
". Please refer my script. Please advise. Thanks.

Code:
|******************************************************************************
|* tccus020  0  VRC B61C a  pmb 
|* DAL for Project Order - Header
|* is
|* 06-07-18 [13:49]
|******************************************************************************
|* Script Type: DAL
|******************************************************************************
                                                                                
#include <bic_dal2>
#define NUMBER.GROUP	"PRJ"	| Project Order Header - Series No.

table ttccus020		| Project Order
table ttcmcs050		| First Free Numbers
table ttcmcs051		| Number Groups


function extern long set.object.defaults()
{
	tccus020.user = toupper$(logname$)
	tccus020.nrgr = NUMBER.GROUP
	tccus020.hsta = tchsta.new

	return(0)
}

function extern long before.open.object.set()
{
	dal.field.depends.on("tccus020.srno", HOOK_UPDATE, "tccus020.orno")

	return(0)
}

function extern long before.save.object(long type)
{
	long	ret
	domain	tcorno	orno

	if type = DAL_NEW then
		

		orno = tccus020.orno
		ret = tcmcs.dll0050.check.and.generate.order.number(3, orno, tccus020.nrgr, 9, "")

		tccus020.orno = orno
	endif

	return(0)
}

function extern long tccus020.orno.check(long has_changed)
{
	long	ret, cnt

	ret = 0
	cnt = 0

	if has_changed = DAL_NEW then

		select count(*) :cnt
		from tcmcs050
		where tcmcs050.nrgr = :tccus020.nrgr
		and tcmcs050.seri = :tccus020.orno
		selectdo
			break
		endselect

		if cnt = 0 then
			|| Invalid requisition number!
			dal.set.error.message("txcus00001")
			ret = DALHOOKERROR
		endif

	endif

	return(ret)
}

function extern void tccus020.srno.update(long has_changed)
{
	if has_changed = DAL_NEW then
		tccus020.srno = tccus020.orno
	endif
}

function extern boolean tccus020.hsta.is.derived()
{
	return(true)
}

function extern boolean method.is.allowed(long method)
{
	boolean		ret
	long		cnt

	ret = true

	on case method
	case DAL_NEW:

		break

	case DAL_UPDATE:

		break

	case DAL_DESTROY:

		on case trim$(tccus020.srno)
		case "POR":
			select count(*) :cnt
			from tccus021 a1
			where a1.orno = :tccus020.orno
			and a1.lsta not in(tclsta.canceled, tclsta.rejected)
			selectdo
				break
			endselect

			ret = (cnt = 0 and tccus020.hsta = tchsta.new)

			break
		endcase

		break
	endcase

	return(ret)
}
Reply With Quote
Sponsored Links
  #2  
Old 6th July 2018, 10:25
vahdani's Avatar
vahdani vahdani is offline
Guru
 
Join Date: Aug 2002
Location: Cologne, Germany
Posts: 438
vahdani is on a distinguished road
Baan: all - DB: all - OS: Unix / Win2K
hi,

the compiler cannot find the function. For us it is easy to know that the function is in the DLL tcmcsdll0050 but we must also tell this to the compiler!!

You could add tcmcsdll0050 to the list of Libraries. Just mark your DAL and call "libraries" option
... or you can add the library to the script as follows:
Code:
table ttccus020		| Project Order
table ttcmcs050		| First Free Numbers
table ttcmcs051		| Number Groups

#pragma used dll otcmcsdll0050	|Check order series
... and don't forget the "o"
__________________
May the force be with you!
Reply With Quote
  #3  
Old 6th July 2018, 10:36
tracylee tracylee is offline
Member
 
Join Date: Sep 2011
Posts: 71
tracylee is on a distinguished road
Baan: ERP LN 6.1 - DB: MYSQL - OS: ERP LN
Quote:
Originally Posted by vahdani View Post
hi,

the compiler cannot find the function. For us it is easy to know that the function is in the DLL tcmcsdll0050 but we must also tell this to the compiler!!

You could add tcmcsdll0050 to the list of Libraries. Just mark your DAL and call "libraries" option
... or you can add the library to the script as follows:
Code:
table ttccus020		| Project Order
table ttcmcs050		| First Free Numbers
table ttcmcs051		| Number Groups

#pragma used dll otcmcsdll0050	|Check order series
... and don't forget the "o"
Hi Vahdani,

Thanks for your reply. Now can compile after add the library to the script. Thanks a lot.
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
Report Script Issue johnmark Tools Development 4 11th May 2013 07:55
Call DLL fucntion in Program Script layswan Tools Development 3 8th October 2012 13:18
VBA automation from ERPLn session script / DLL VishalMistry Tools Development 3 9th August 2010 20:24
Help regarding tools session rahul.kolhe22 Tools Development 4 22nd January 2010 14:31
VB script and Baan DLL avpatil Tools Development 4 19th March 2002 23:16


All times are GMT +2. The time now is 19:12.


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