User login
|
|
Frontpage Sponsor
|
|
Google search
|
|
Poll
|
For ERP LN feature pack upgrade, what method of install are you using? Installation Wizard into existing VRC 38% Installation Wizard into new VRC 38% Manual into existing VRC 5% Manual into new VRC 19% Total votes: 42 |
Baanboard at LinkedIn
|

|
|
|
 |

16th May 2014, 13:46
|
 |
Junior Member
|
|
Join Date: Sep 2005
Posts: 16
|
|
Baan: BaaNIVc4 -
DB: SQL -
OS: NT
|
switch.to.company werkt niet
Ik gebruik in een reportscript de functie 'switch.to.company'.
Kort na deze functie volgt een update in tccom010 maar ondanks dat er geen error ontstaat bij bovengenoemde functie, wordt de update in hetzelfde (verkeerde) bedrijf gedaan. Kortom, er wordt niet van bedrijf gewisseld.
Zou iemand mij kunnen vertellen waar het precies fout gaat?
Met vriendelijke groet,
Jan
|

16th May 2014, 13:57
|
 |
Guru
|
|
Join Date: Sep 2012
Location: India
Posts: 2,345
|
|
Baan: LN FP 1-9, 10.4, a little bit of Baan IV -
DB: SQL Server 2008, Oracle -
OS: Windows Server 2008 R2, Unix
|
Use this:-
Code:
db.set.to.default(ttccom010)
switch.to.company(target_comp)
db.set.retry.point()
select tccom010.*
from tccom010 for update
as set with 1 rows
selectdo
....
...
...
db.update()
endselect
commit.transaction()
OR
Code:
db.set.retry.point()
db.set.to.default(ttccom010)
select tccom010.*
from tccom010 for update
where tccom010._compnr = :target_comp
as set with 1 rows
selectdo
....
...
...
db.update()
endselect
commit.transaction()
__________________
Regards,
Bhushan
Unless you try to do something beyond what you have already mastered, you will never grow!
|

20th May 2014, 15:03
|
 |
Junior Member
|
|
Join Date: Sep 2005
Posts: 16
|
|
Baan: BaaNIVc4 -
DB: SQL -
OS: NT
|
It is not working
No matter which way I try, it is not working.
Maybe i't will be more clear if I attach the whole script.
The script is creating debtors, based on records in pampa003
The value of pampa002.ctpc of the first record is "015", so according the case statement the target_comp = 212. The first record is processed the way it should be (a debtor is created in company 212). The second record has a pampa002.ctpc value of "016", the target_comp is set to 118. But during the update in table tccom010 (after function 'switch.to.çompany'
the record is inserted in company 212 instead of company 118.
That's the problem. 
|

20th May 2014, 15:22
|
 |
Guru
|
|
Join Date: Sep 2012
Location: India
Posts: 2,345
|
|
Baan: LN FP 1-9, 10.4, a little bit of Baan IV -
DB: SQL Server 2008, Oracle -
OS: Windows Server 2008 R2, Unix
|
Hi,
Check whether field pampa002.ctpc is added in Report Input Fields. Also check all other fields which you are using in your report script.
__________________
Regards,
Bhushan
Unless you try to do something beyond what you have already mastered, you will never grow!
|

20th May 2014, 17:35
|
 |
Senior Member
|
|
Join Date: Nov 2011
Location: hyderabad ; india
Posts: 240
|
|
Baan: ERPLN fp3 and 10.4 -
DB: oracle -
OS: Aix , Redhat linux 6
|
i would recommend .. to debug the report script
Moreover i would prefer using compnr.check with if else
if compnr.check (target.comp) then
.... do xyz
else
error while switching
endif
__________________
Regards,
Vamsi
|

20th May 2014, 20:06
|
 |
Guru
|
|
Join Date: Sep 2002
Location: Netherlands
Posts: 755
|
|
Baan: BaanIV, BaanERP, ERP LN 6.1 -
DB: Oracle, SQL Server -
OS: Unix, Windows
|
Ensure that the package combinations of 118 and 212 are equal to your current package combination. Probably 212 is, but 118 is not. If you check the return value of switch.to.company, you will see it failing.
Note that you can use different package combinations, but the data model (tables, domains, CDF, timestamps, MLE) need to be the same.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|