Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem in loading the admin login of my document! Help needed very urgently!

Hi All,

I am not able to get any solution even after referring to all the available document with me. I know everything will not be there straight forward in the document. But though i posted this problem many times in the forum i did not managed to get the solution for my problem. So thought to put the new post in little different way for better understanding for the experts who can give solution for this problem.

Using below sql i used to get the USER's userid and password from the items table.


select i.c_account_code as account,i.c_item_code as itemcode,c_pack as pack,
i.c_mfac_code as mfaccode,rtrim(i.c_name)+' '+rtrim(i.c_pack) as itemname,
rtrim(i.c_account_code)+rtrim(i.c_mfac_code) as userid,rtrim(m.c_password) as password,
--rtrim(i.c_account_code)+rtrim(m.c_loginid) as userid,rtrim(m.c_password) as password,
i.n_mrp as MRP,i.n_newflag as recentitem,i.c_Scheme as schemes,m.c_name as mfacname,
c.c_name as contentname,c.c_note as contentname1
from item_mst i inner join mfac_mst m on i.c_mfac_code=m.c_mfac_code
left outer join content_mst c on i.c_content_code=c.c_content_code;


But for getting the ADMIN's userid and password is giving me trouble. To get the details i need to connect to the mfac_mst table. But due to the synthetic key problem i did not connect that. Let me know how can i get the ADMIN's user id and password from the current structure. Do i need to use the inline function to get the admin details ??? If yes let me know how to use it here to get the same and give the admin rights for the document.

I have also don't know how to define the USER and ADMIN user of my document. In my current structure i don't know how to define the same.

If i load the admin details using the below code it creates one more synthetic key.

select c_mfac_code as mfaccode,c_account_code as account,rtrim(c_account_code)+rtrim(c_mfac_code) as userid,c_password as password from mfac_mst where c_mfac_code in ('01','admin')


So i am confused what to here! I want to have the admin login very urgently in my document. For example when admin logins in my document he/she should be in a position to see all the details related to the logged in admin's account. For eg if if admin logs in with the account code 001001 he should be in a position to see the data related to 001001 and if the admin logs in with account code 001007 he should be in position to see the data related to 001007.

I have also attached the document which i am working on. Hope some one can help me out soon. It is very very urgent!

To open the document you can use userid:0010012021, password:c2info99.

Expecting some quick reply from the experts!

Thanks and Regards,

Rikab

28 Replies
Not applicable
Author

Hello Rakesh!

I didn't mean you to be 24x7 on community support. I have seen your post and it was really worth. By the i am a newbie and thats the reason i always look for some to reply me.

By the way i am at home now after reaching office i will the requested changes and will get back to you.

Thanks and Regards,

Rikab

Not applicable
Author

Hi Rakesh!

You have provided me the solution to get the admin login. But to be frank as i am newbie. I am not too sure how the script provided by works.

I think you are concatenating the common columns and naming it as the key field between the two tables. I am not sure how sales1 has been formed automatically. With this script you have managed to get the admin user's login. But let me know how to define the ADMIN and USER in the section access.

Also let me know why the below script has been written.

items:
LOAD *, account & '/' & itemcode as %Key;
sales:
LOAD *,
ac_code & '/' & it_code as %Key;


Though i have given explanation for few things. I request you to give the brief explanation for the solution provided by you.

Also requesting you to answer for the below query!

Wont the below one will not create synthetic key issue? I am seeing lots of synthetic has been formed after adding your script. Will it not create performance issue? (I want to study about the synthetic key issue first. Please send me the document if you have any)

Sorry from my side for asking so many things to you. It is not that i am not trying anything from my side. I am also trying from my side. Whatever i didn't understood i am putting it here.

Expecting your reply!

Happy weekend!

Thanks and Regards,

Rikab

disqr_rm
Partner - Specialist III
Partner - Specialist III

Hi Rikab,

It's very hard to give you 100% solution without knowling complete data model and data contents. Is there anyway you can upload your QVW file with some sample data in a file? Someone here, then, will provide you an example reading from that sample file, all you would need to do is then read from database and not file when you have it. Just keep the column names same in the data file.

Also explain when is the relation between Sales and Items tables. Are they typical Sales header and items table?

Rakesh

Not applicable
Author

Hi Rakesh!

Happy Morning!

It's very hard to give you 100% solution without knowling complete data model and data contents. --> Provided you the data contents in data contents sheets of the attached document.

Is there anyway you can upload your QVW file with some sample data in a file? Someone here, then, will provide you an example reading from that sample file, all you would need to do is then read from database and not file when you have it. Just keep the column names same in the data file. --> Sample data file has been provided to you in QVD format. It is available in the document folder.

Also explain when is the relation between Sales and Items tables. Are they typical Sales header and items table? --> Yes, they are typical sales and items table.

To open the application use userid: 0010011161, password: 7426

Thanks and Regards,

Rikab

disqr_rm
Partner - Specialist III
Partner - Specialist III

This is how I would do it very quickly. Hope this gives you enough idea on how to continue.

Not applicable
Author

Hi Rakesh!

Looks like you have almost finished it. But still i want to inform few things to you.

The document which i am working on is for pharma distributors. The actors here are the DISTRIBUTOR(They have unique account(Distributor1:001001,Distributor2: 001007) code and there are N no of mfac(representative) comes under them) and COMPANY representative(N no of mfac(MFACCODE: N no of mfacode comes under the account code)

So when i logs in with 0010012021(account:001001,mfacode:2021). It will show the data of mfaccode:2021 which belongs to the account:001001). if logs in with 0010072021(account:001007,mfacode:2021). It will show the data of mfaccode:2021 which belongs to the account:001001). For example when admin of (001001) logs in it should show the performance of all the manufactures and where as when the company rep with accountcode:001001 and mfacode:2021 they should be in a postion to see the item wise performance. Same like what is happening now.

So i user with the account code 001001 will have one admin and the user with the account code 001007 will have one admin. To see the performance of both together there will be one more admin who can see both the account data(001001+00107).

As per your logic you are concatenating the upper(account) & '/' & upper(mfaccode) as SecurityLink, in this case if i think i can see the over all data but if i want to login with admin with account(001001) i will not be able to see the data of the account:001001.

Do i need to load the data every time from QVD? Is it possible for you to load it using the select query instead of LOAD. If this is not possible do i need to create separate document in the same folder to load the data in to the QVD and so that same will be loaded like what you are doing it here.


LOAD
'USER' as [ACCESS], upper([userid]) as [USERID], upper([password]) as [PASSWORD],
upper(account) & '/' & upper(mfaccode) as SecurityLink // I used this as a filter. But you have concatenated it. Because of this admin of account(001001) will be able to see the over all data which comes under the account: 001001)
resident TempTab;

concatenate(SecurityTable)
LOAD * INLINE [
ACCESS, USERID, PASSWORD, SecurityLink
ADMIN, ADMIN, ADMIN, *


I am trying to learn your logic and method. I am really thankful for all your effort.Many thanks to you!

When find time please do reply!

Thanks and Regards,

Rikab

Not applicable
Author

Hi Rakesh!

Have you found any solution??? Sorry if i am disturbing you on this regard. Please help me out to complete this issue which i am facing from a long time.

Regards,

Rikab

Not applicable
Author

Hello Rakesh!

Still i did not get any solution which i was looking for. Requesting you to work on it as i couldn't over come this issue from such a long time.

Waiting for your reply!

Thanks and Regards,

Rikab

Not applicable
Author

Hello Rakesh!

I am waiting for your reply! Please help me out.

Thanks and Regards,

Rikab

disqr_rm
Partner - Specialist III
Partner - Specialist III

This should give you enough idea. Not sure why it's taking you too long to figure this out, may be you need to hire some help.

Anyway, try enclosed with following:

user: 0010011171 password:7636 --> Only access to 001001 account and 1171 mfacode

user: 001001 password: 001001 --> all mfacodes of Account 001001

user: admin password: admin --> full document code access