COMPILE FUNCTION OBJ_OVERRIDE_LOG(Method, Parms)

DECLARE FUNCTION Get_Status, Msg, Utility, obj_Tables, NextKey,  obj_Prod_Spec, Send_Dyn
DECLARE FUNCTION Environment_Services, Datetime, NextKey
DECLARE SUBROUTINE  Set_Status, Msg, obj_Tables, Send_Dyn
DECLARE SUBROUTINE ErrMsg

$Insert OVERRIDE_LOG_EQUATES


ErrTitle = 'Error in Stored Procedure "OBJ_OVERRIDE_LOG"'
ErrorMsg = ''

IF NOT(ASSIGNED(Method))	THEN ErrorMsg = 'Unassigned parameter "Method" passed to subroutine'
IF NOT(ASSIGNED(Parms))		THEN Parms = ''

IF ErrorMsg NE '' THEN
    Set_Status(-1,ErrTitle:@SVM:ErrorMsg)
    RETURN ''
END

Result = ''

BEGIN CASE
    CASE Method = 'Create'			; GOSUB Create
        
    CASE 1
        
        
END CASE

IF ErrorMsg NE '' THEN
    Set_Status(-1,ErrTitle:@SVM:ErrorMsg)
END

RETURN Result



* * * * * * *
Create:
* * * * * * *

    LogDTM = Datetime()
    Record = Parms
    
    Table = Record<OVERRIDE_LOG_TABLE$>
    Key = Record<OVERRIDE_LOG_KEY$>
    orUser = Record<OVERRIDE_LOG_USER$>
    orComment = Record<OVERRIDE_LOG_COMMENT$>
    orDTM = LogDTM
    orCategory = Record<OVERRIDE_LOG_CATEGORY$>
    
    RecKey = Nextkey('OVERRIDE_LOG')
    
    orRec = ''
    orRec<OVERRIDE_LOG_TABLE$> = Table
    orRec<OVERRIDE_LOG_KEY$> = Key
    orRec<OVERRIDE_LOG_USER$> = orUser
    orRec<OVERRIDE_LOG_COMMENT$> = orComment
    orRec<OVERRIDE_LOG_DTM$> = orDTM
    orRec<OVERRIDE_LOG_CATEGORY$> = orCategory
    
    obj_Tables('WriteRec','OVERRIDE_LOG':@RM:RecKey:@RM:@RM:orRec)

    
    Result = RecKey
