KAMALAKAR VARMA
22nd January 2009, 11:00
Dear All,
We are on BAAN IV c4 in5 SP21. We would like to know the functions to be used and the method for developing a session which could display multi company reports related to stocks, sales and purchase for users who do not have multi-company access, i.e. they have got access to single companies only.
Any one having a sample script and willing to share can post the copy on baanboard and / or send a copy of the same to kvarma-icc@modi.com or k_varma@sify.com.
Regards
Kamalakar Varma
Hitesh Shah
24th January 2009, 15:20
Getting multi-company reports from outside may be difficult (as background tables are different ) . But it's not at all difficult from within baan. U need to add ._Compnr conditions in the select clause like
select tfgld106.*
from tfgld106
where tfgld106._index3 = {:tmpleac}
and tfgld106.oyer = :year.f
and tfgld106.fprd between :prd.f and :prd.t
and tfgld106._compnr = :company.number
order by tfgld106._index3
U can get all group companies from tfgld001 .
Beware,u should select only companies with same package combination. Further there are some logical limitations on use of ._compnr clause in select . Please go through baan help for the same.
KAMALAKAR VARMA
27th January 2009, 12:46
Dear Hitesh,
Thanks for your feed-back. Basically we are looking to develop a session using which we are able to provide multi-logistic company report related to Sales / Purchase and Inventory. But the user would be having access to a single company only. Will the script take care of this issue also. We have tried to make a data consolidation program using the compnr function, but it is not able to access the data from Companies for which the user has not been given access to.
Hitesh Shah
27th January 2009, 14:47
This is the way the company authorizations works and u too dont want user to access unauthorized companies. Either make the user super user or give him/her that company authorization . Then only program will select records across companies .
prashant
3rd February 2009, 08:37
hi...
You may also use
switch.to.company()
for example
switched.comp = switch.to.company(company)
Hope this will help u.
Thanks
sushil
3rd February 2009, 09:41
Hi,
I assume switch.to.company() needs company permission also.
Workaround : Try this,
1.Set user default company - in maintain user data
2.Remove Change company session permission.
3.Then try switch.to.company() in Program scripts.
Hitesh's Logic must work for you.!! (that worked for me).
Regards,
Sushil Kumar Mudaliar