cancel
Showing results for 
Search instead for 
Did you mean: 

No current period when oCompany.Connect()

Former Member
0 Kudos

Hi All,

I have this error when i try to connect the company with the DI :

"-222 No current period"

In my company, i defined a current posting period : Posting Date from 01/01/2008 to 31/01/2008. The exercice begins in 2008. After i want to create my partners ...

This is the code, i'm use to connect the company throw the DI :

SboGuiApi = new SAPbouiCOM.SboGuiApi();

// by following the steped specified above the following

// statment should be suficient for either development or run mode

//SboGuiApi.AddonIdentifier = "5645523035446576656C6F706D656E743A4E3036323136303439343550F780D9E1AA20456293BA6DBC6CE031FF774237";

sConnectionString = Interaction.Command();

// connect to a running SBO Application

SboGuiApi.Connect(sConnectionString);

// get an initialized application object

SBO_Application = SboGuiApi.GetApplication(-1);

SBO_Company = new SAPbobsCOM.Company();

sCook = SBO_Company.GetContextCookie();

conStr = SBO_Application.Company.GetConnectionContext(sCook);

retour = SBO_Company.SetSboLoginContext(conStr);

if (retour != 0) SBO_Application.MessageBox("Error : SetSboLoginContext())", 0, null, null, null);

else retour = SBO_Company.Connect();

if (retour != 0) SBO_Application.MessageBox("Error : Connect() " + retour.ToString() + " ) " + SBO_Company.GetLastErrorDescription() + SBO_Company.GetLastErrorCode().ToString(), 0, null, null, null);

How can i resolve this problem ? Thanks for your response.

Best regards

Michael

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

the current date does not fall in to the current active posting period . This is the reason I beleive.

to test this create a ( or change ) posting period so the current date falls in it.

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for your response.

Michael

Former Member
0 Kudos

Hi All,

I'm using SAP B1 SP01 PL39.

In fact, i would know if it is mandatory to have a current period in the current Year i.e 2007, to use the function Connect() in an Add-On.

Thanks

Best regards

Michael.

Former Member
0 Kudos

Hi Michael,

To overcome this problem you can change your computer's date when you do the imports to some date in 2008 before you log in.

Hope it helps,

Adele

Former Member
0 Kudos

Hi Adele,

It was a possibility to change the system date but i can't do this solution in my customer.

It's possibl to execute an Add-On without a posting period greater than 2007.

In my company, i don't have a 2007 posting period and i think it was the problem.

How can i run my Add-On without a posting period in the current Year ?

Thanks for your response.

Best Regards

Michael