×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

AccpacSignonMgr - Automatic detect signed in user

AccpacSignonMgr - Automatic detect signed in user

AccpacSignonMgr - Automatic detect signed in user

(OP)
Hi All,

I created a simple program and attached it inside SAGE 300 using Program Object. Now, I want that when they open the program (A) it auto-detect the current login user and company details.



I'm using the below code, but I don't want the user to login and select again to the company.

CODE --> VB

Dim mAccpacSignOn As AccpacSignonManager.AccpacSignonMgr
Dim mAccpacSession As AccpacCOMAPI.AccpacSession
Dim mAccpacDBLink As AccpacCOMAPI.AccpacDBLink

mAccpacSignOn = New AccpacSignonManager.AccpacSignonMgr
mAccpacSession = New AccpacCOMAPI.AccpacSession

mAccpacSession.Init("", "XY", "XY1000", "61A")
mAccpacSignOn.Signon(mAccpacSession)
mAccpacDBLink = mAccpacSession.OpenDBLink(AccpacCOMAPI.tagDBLinkTypeEnum.DBLINK_COMPANY, AccpacCOMAPI.tagDBLinkFlagsEnum.DBLINK_FLG_READWRITE)

MsgBox(mAccpacSession.CompanyID) 

Is there any other way to achieved the auto-login or Single Sign-on.

Thanks,

RE: AccpacSignonMgr - Automatic detect signed in user

Don't use AccpacSignonManager, I never do.

Sage 300 Whisperer

RE: AccpacSignonMgr - Automatic detect signed in user

(OP)
Thanks for the response, then what is the best way to do my goal?

RE: AccpacSignonMgr - Automatic detect signed in user

Delete all the signonmanager lines

Sage 300 Whisperer

RE: AccpacSignonMgr - Automatic detect signed in user

(OP)
Can you give me an example? Sorry, I'm just new with this platform.

Thanks,

RE: AccpacSignonMgr - Automatic detect signed in user

Set Session = AccpacCOMAPI.AccpacSession

Session.Init "", "XY", "XY0001", "53A"
Session.Open sAccpacUser, sAccpacPW, sCompID, Date, 0, 0

Sage 300 Whisperer

RE: AccpacSignonMgr - Automatic detect signed in user

(OP)
So the variable sAccpacUser, sAccpacPW, sCompID are hardcoded? Is there anyway to automatically detect the current logged-in user?

RE: AccpacSignonMgr - Automatic detect signed in user

Yes - add a command line parameter to your icon in Sage: $objecthandle$

Use that parameter when you .Init your session object use that value for the first parameter and you'll be connected to the same session. No need to .Open the session after that.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close