Baanboard.com

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

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
37%
Installation Wizard into new VRC
39%
Manual into existing VRC
3%
Manual into new VRC
21%
Total votes: 38

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 22nd February 2007, 15:05
Gwehles Gwehles is offline
Junior Member
 
Join Date: Feb 2003
Posts: 4
Gwehles is on a distinguished road
Baan: Baan IVc4 - DB: Oracle - OS: WindowsNT, XP, 2003
Change VRC in a script?
Baan: Baan IVc4
C/S: Both

Hi all,
Is there a way to change the current VRC in a script?
I have on one server two companies, 200 and 300 which are in a different VRC. So when i execute the function switch.to.company(300) it returns me that this company is in a diffrent VRC.
I only need to read datas for creating a text file, so no need tu update!
Thanks for any suggestions.
Reply With Quote
  #2  
Old 22nd February 2007, 15:26
en@frrom en@frrom is offline
Guru
 
Join Date: Aug 2003
Location: Belgium
Posts: 1,219
en@frrom will become famous soon enough
Baan: B50B - DB: Oracle 8.0 - OS: Win2k AS
I have never tried to do this during runtime of a session, but theoretically you can do that easily. Since your Baan version details are not filled in, I do not know what version you are on. Talking from my Baan 5 environment:

The current package vrc per user is stored in table ttadv040 in company 000. The package vrc can be changed through session ttadv0140m000. So you could either write an api (afs) which calls ttadv0140m000 and changes the package vrc (-> recommended), or you could program to change the package vrc directly in table ttadv040. I am not sure, but I think there are no other actions taken by session ttadv0140m000 except for changing table ttadv040.

Of course after reading your data, don't forget to change it all back again before continuing your program...

Let us know the results...


Regards,
Eli Nager
__________________
Member of Baan Board

Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
Sponsored Links
  #3  
Old 22nd February 2007, 16:35
Gwehles Gwehles is offline
Junior Member
 
Join Date: Feb 2003
Posts: 4
Gwehles is on a distinguished road
Baan: Baan IVc4 - DB: Oracle - OS: WindowsNT, XP, 2003
Hi,
this could work, never thaught on that possibility.
The only problem that i could imagine is that even if i change the VRC for my user with API, my datadictionary hasen't changed. Or doesn't the DD have an influence there.
Thanks for this suggestion, i'l try it tomorow!
Reply With Quote
  #4  
Old 22nd February 2007, 16:40
en@frrom en@frrom is offline
Guru
 
Join Date: Aug 2003
Location: Belgium
Posts: 1,219
en@frrom will become famous soon enough
Baan: B50B - DB: Oracle 8.0 - OS: Win2k AS
Like I said I think all the regular session does is changing the table, but you should try it... About DD: this I can tell you, is not needed, so no problem there. The changes are effective without updating/converting dd

Regards,
Eli Nager
__________________
Member of Baan Board

Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #5  
Old 22nd February 2007, 22:35
NPRao's Avatar
NPRao NPRao is offline
Guru
 
Join Date: Aug 2001
Location: Pacific NW, USA
Posts: 3,032
NPRao will become famous soon enough
Baan: iBaanERP-5.2a(Reger),SSA-ERP-LN-6.1,Infor LN-10.x - DB: Oracle-10g,11g,12c,MS-SQL - OS: HP-UX, Linux, Windows
Gwehles,
Quote:
Is there a way to change the current VRC in a script?
I have on one server two companies, 200 and 300 which are in a different VRC. So when i execute the function switch.to.company(300) it returns me that this company is in a diffrent VRC.
I only need to read datas for creating a text file, so no need tu update!
Thanks for any suggestions.
I think you are missing the basic point here -
Quote:
switch.to.company()
--------------------------------------------------------------------------------
Syntax
long switch.to.company( long new_compnr )
Description
This switches to another company and sets the read-only variable COMPNR to the specified company number. It performs several checks before switching company and switches company only if the checks are successful. For example, it checks if the user is authorized to change to the new company, it checks if the package combination linked to the old company contains the same package VRC's as the package combination linked to the new company, and it checks if the old and new companies have the same first day of the week.
Notes
compnr.check() and switch.to.company() perform similar functions, but switch.to.company() performs additional checks. So switch.to.company() makes heavier demands on system resources.
Be aware that when there is a switch to another company, the user's first day of the week does not change, even if the new company has a different first day of the week. switch.to.company() returns an error value if the old and new companies have different first days of the week. compnr.check() does not.
Super users are authorized for all company numbers. They always have authority to switch to a different company number. In addition, super users can also use the data dictionary to authorize other users for particular company numbers.

Return values
1 Success.

-1 Company not available.

-2 No permission to change to this company.

-3 Package combination does not correspond with new company number.

-4 First day of the week does not correspond to first day of the week of original company.

Context 3GL library function.
Companies are linked to package combinations and not VRCs. We have different package combinations with derived VRCs and we can switch companies because there are no DD differences (tables, domains).
Your alternative option is to use -
Quote:
compnr.check()
--------------------------------------------------------------------------------
Syntax
boolean compnr.check( long new_compnr )
Description
This switches to another company and sets the read-only variable COMPNR to the specified company number. It checks whether the user is authorized for the new company, and switches company only if so.

Notes
compnr.check() and switch.to.company() perform similar functions, but switch.to.company() performs additional checks. So switch.to.company() makes heavier demands on system resources.

Be aware that when there is a switch to another company, the user's first day of the week does not change, even if the new company has a different first day of the week. switch.to.company() returns an error value if the old and new companies have different first days of the week. compnr.check() does not.

Super users are authorized for all company numbers. They always have authority to switch to a different company number. In addition, super users can use the data dictionary to authorize other users for particular company numbers.

Return values
true User is authorized; Company switched.

false User is not authorized; Company not switched.

Context Bshell function.
__________________
The art of perfection does not lie in doing extraordinary things but, doing ordinary things extraordinarily well. [-N. Prashanth Rao]
How To Ask Questions The Smart Way,BaaNBoard,NPRao
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
ELP LN - Change Package VRC metbaan Tools Administration & Installation 1 1st May 2006 22:01
Error: Update VRC not allowed to be standard VRC mostrightfuture Tools Development 5 29th December 2005 15:08
Change VRC Level ganesh_kapase Tools Administration & Installation 4 21st June 2005 07:33
change to older version in script raj20033002 Tools Development 1 10th March 2003 16:06


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


©2001-2017 - Baanboard.com - Baanforums.com