FreedomSoft - "the future is freedom"
Process Before - Related

Under rare circumstances, it may be necessary to manually create or modify related data, before data currently being updated is validated and actually updated.

Please note that the Creating and Creating Not Validated relationship types can probably be used instead of this method, and may be more efficient. However, the Creating and Creating Not Validated relationship types require that the Cascade function be operating before the actual creation occurs, and this may place limitations on the usage of Creating and Creating Not Validated relationship types.

Please see the Help documentation for the Freedombase Designer for more information on the Creating and Creating Not Validated relationship types.

Sample code is:

     SUBROUTINE CIS_COURSE_After(Command,RawData,Instance,Instance_Key,ErrorMessage,Occurrence,DatabaseeClassList,KeyList,InstanceList,ErrorMessageList,SequenceList,NoUpdateFlagList,CurrentSelect,CascadeRecurse,Cascade_Cascade_KeyList,Cascade_CascadeToKeyList,PreviousDatabaseeClassList,PreviousKeyList,PreviousDateTimeWrittenList,PreviousNoUpdateFlagList,User,MetaErrorFlag)

$INCLUDE FB_BP Freedombase_Definition
$INCLUDE Process_BP CIS_CALENDAR_Definition
$INCLUDE Process_BP CIS_COURSE_Definition

     IF (Command = 'Save' OR Command = 'Load') AND ErrorMessage = '' THEN
        * Get the first Calendar instance for this Course.
        CALENDAR_Instance = ''
        CALENDAR_Instance<CIS_CALENDAR_COURSE> = Instance<CIS_COURSE_COURSE>
        CALENDAR_Instance<CIS_CALENDAR_DAY> = 1
        CALL CIS_CALENDAR_Process('Get','',CALENDAR_Instance,'','','','','','','','','','','','','','','','','',User,MetaErrorFlag)
        IF (MetaErrorFlag) THEN
           RETURN
        END
        * Set the Date of the first Calendar instance for this Course.
        CALENDAR_Instance<CIS_CALENDAR_DATE> = Instance<CIS_COURSE_STARTDATE>
        CALENDAR_ErrorMessage = ''
        CALL CIS_CALENDAR_Process(Command,'',CALENDAR_Instance,'',CALENDAR_ErrorMessage,'','','','','','','','','','','','','','','',User,MetaErrorFlag)
        IF (MetaErrorFlag) THEN
           RETURN
        END

     END

     RETURN

  END

previousnext
123456789101112131415161718192021222324252627