Module Invt.dd

     1Use  Windows.pkg           // Basic Definitions
     2Use  DataDict.pkg          // DataDictionary Class Definition
     3Use  DDvalTbl.pkg          // Validation Table Class Definitions
     4
     5Open Invt
     6Open OrderDtl
     7Open Vendor
     8
     9Register_Object Invt_sl
    10
    11Class Invt_DataDictionary Is A DataDictionary
    12
    13    Procedure Construct_Object
    14        Forward Send Construct_Object
    15
    16        Set Main_File To Invt.File_Number
    17        Set Cascade_Delete_State To False
    18
    19        Set Foreign_Field_Option DD_KEYFIELD DD_FINDREQ to True
    20        Set Foreign_Field_Option DD_INDEXFIELD DD_NOPUT to True
    21        Set Foreign_Field_Option DD_DEFAULT DD_DISPLAYONLY to True
    22
    23        Set Add_Client_File to OrderDtl.File_Number
    24
    25        Set Add_Server_File to Vendor.File_Number
    26
    27
    28        Set Field_Label_Long Field Invt.Item_ID To "Invt. Item ID"
    29        Set Field_Label_Short Field Invt.Item_ID To "Item ID"
    30        Set Field_Option Field Invt.Item_ID DD_AUTOFIND to True
    31        Set Field_Option Field Invt.Item_ID DD_REQUIRED to True
    32        Set Field_Option Field Invt.Item_ID DD_CAPSLOCK to True
    33        Set Field_Prompt_Object Field Invt.Item_ID to Invt_sl
    34        Set Key_Field_State Field Invt.Item_ID To True
    35        Set Status_Help Field Invt.Item_ID To "Inventory Item Id - user defined identification"
    36
    37        Set Field_Label_Long Field Invt.Description To "Invt. Description"
    38        Set Field_Label_Short Field Invt.Description To "Description"
    39        Set Field_Option Field Invt.Description DD_REQUIRED to True
    40        Set Status_Help Field Invt.Description To "Inventory Part Desription"
    41
    42        Set Field_Option Field Invt.Vendor_ID DD_CAPSLOCK to True
    43        Set Status_Help Field Invt.Vendor_ID To "Vendor Number"
    44
    45        Set Field_Option Field Invt.Vendor_Part_ID DD_REQUIRED to True
    46        Set Status_Help Field Invt.Vendor_Part_ID To "Vendor ID name for this item"
    47
    48        Set Field_Mask_Type Field Invt.Unit_Price To MASK_CURRENCY_WINDOW
    49        Set Field_Value_Range Field Invt.Unit_Price To 0 999999.99
    50        Set Status_Help Field Invt.Unit_Price To "Retail unit price"
    51
    52        Set Field_Value_Range Field Invt.On_Hand To -999999 999999
    53        Set Status_Help Field Invt.On_Hand To "Units currently available"
    54
    55    End_Procedure  //  Construct_Object
    56  
    57    Function Validate_Save Returns Integer
    58        Integer iRetVal
    59    
    60        Forward Get Validate_Save to iRetVal
    61        
    62        If iRetVal Function_Return iRetVal
    63    
    64        If Invt.On_Hand Lt 0 Begin
    65           Send UserError "Insufficient Inventory Stock" ""
    66           Function_Return 1
    67        End   
    68    End_Function  // Validate_Save
    69
    70
    71    Procedure Field_Defaults
    72        Forward Send Field_Defaults
    73    End_Procedure    // Field_Defaults
    74    
    75End_Class    //  Invt_DataDictionary
    76#IFDEF Is$WebApp
    77#ELSE
    78
    79Use Invt.sl          // Invt_sl
    80
    81#ENDIF
    82
    83