This sample Dynamics GP Integration Manager script is placed in the 'Before Document' script area, and is used to cancel the document based on the date. This specific example will not allow dates greater than or equal to the first of the next month.
dtEOM = dateadd(
"m"
,1,Now())
dtEOM = month(dtEOM) &
"/1/"
& year(dtEOM)
if SourceFields(
"DOC DATE"
) >= dtEOM then
CancelDocument(
"The document date is in the future, document cancelled"
)
'msgbox("cancelled")
end if