cancel
Showing results for 
Search instead for 
Did you mean: 

SP01(?): Set Default posting period using DI SDK?

mark_eley
Discoverer
0 Kudos

Is there a way to set the default posting period using the DI SDK?

I have a program that creates invoices from delivery notes which works fine as long as the docdate is in the same period as the current month. I need to create invoices for delivery notes shipped on Apr 28. The invoice needs to be posted to April but today is May 2. I am using 2005A SP1. Adding an invoice with Apr 28 docdate generates error -5002 Date deviates from permissible range [OINV.DocDate]. 2005A SDK now has a companyservice object that exposes the period information but I have not figured out how to set the default period for a given company connection.

Has anyone done this or are there examples (samples) that show how to use the companyservice object?

Thanks

Mark Eley

Accepted Solutions (1)

Accepted Solutions (1)

Eneveux
Product and Topic Expert
Product and Topic Expert
0 Kudos

Mark,

The period information being exposed is for reading purposes only, ie you can get the current period.

Sorry,

Eddy

Answers (1)

Answers (1)

Former Member
0 Kudos

Once connected to the DI API the period is the period as determined by the client's system date. I do not think there is a way to change this. I have however, written a vb.net program that changes the system date, connects to the DI API, posts the entries and then disconnects and re-sets the system date. This works, (but ugly!).