Date deviates from permissible range – Error code: -5002 10000047

Symptom

At task run time, the step fails with the error:

Failed to Add SAP B1 Business Object (-5002): 10000047 - Date deviates from permissible range

Cause

This error occurs on A/R Invoice and A/P Invoice documents, and is caused by the due date on the document in a posting period being locked. (By default, a posting period’s due date is set to cover January 1 – December 31 of a calendar year.)

Solution

This can be resolved within SAP Business One from the Main Menu -> Administration -> System Initialization -> Posting Periods and setting the document due date into the next calendar year.