PdcApplication.ShiftAllDatesInEnvironment

From External Bemet Wiki
Jump to navigation Jump to search

Declaration

ShiftAllDatesInEnvironment(blnMoveFromLastCheckpoint As Boolean, ShiftNrDays As Integer) as Boolean

Description

Starts the MoveAllDates conversion. This will shift all dates in your environment forward.

Parameters

blnMoveFromLastCheckpoint : After using this conversion, the date is was last used is stored in ConfigDB. If this boolean is true, then the number of days all dates will be shifted is calculated as the number of days since the last checkpoint. This means that the ShiftNrDays parameter will be ignored.
ShiftNrDays : The number of days that all dates in the environment will be shifted.

Notes

This method is meant for internal use only!!
If an exception occurs during this, the function will return false. An error message will be written to the LastErrorString property.
We have a generic script ShiftAllDatesInEnvironment that implements this function. This script can be used with or without a form. (Without a form it will always use blnMoveFromLastCheckpoint as true).

Code example

    If Not PDC.App.ShiftAllDatesInEnvironment(MoveFromCheckpoint, NrDays) Then
      ErrorMessage = PDC.App.LastError
      Return False
    Else
      Return True
    End If

Availability

Available since may 2023. Bemet 2023R3 and higher.