Pass Currently opened COMPANYID to C# program in Sage 2012

SOLVED

Hi,
I have create a new program using C# to be used inside Sage300 as a program.
Currently to create a session, I hardcode the companyID for the parameter.
However, the program is going to be used by multiple companies.

Hence my question, how to pass the CompanyID of the currently opened Company as argument below?

Parents
  • 0

    You should use the parameter $objecthandle$ and then pass that object handle to your session.init call. That will connect you directly to the session and from there you can call session.companyid to get that information.  Search the forums for $objecthandle$ for more detailed answers on how to use it.

Reply
  • 0

    You should use the parameter $objecthandle$ and then pass that object handle to your session.init call. That will connect you directly to the session and from there you can call session.companyid to get that information.  Search the forums for $objecthandle$ for more detailed answers on how to use it.

Children