Views:
​​​​​​​
Attempting to lock down postings to prior periods in GL under GL Setup | Posting Options | Allow Posting to Closed Fiscal Periods.  An error is received stating: "Can not disable posting to prior periods because unreleased batches in prior periods exist". 

The easiest way to identify the referenced unreleased batch(es) is to run the following SQL statement in SQL Server Management Studio against your Microsoft Dynamics SL application database:

select BatNbr,EditScrnNbr,Status,PerPost,Module,* from Batch where STATUS IN ('B', 'H')

Identify the batches that have a value in the perpost field prior to the current fiscal period. Delete or release the batches on the screen that are noted in the EditScrnNbr field.