SelectBestColumn - cWebList

Finds the best column for the passed table and column number

Type: Function

Return Data Type: Integer

Parameters: Integer iFile Integer iField

iFileTable number to find
iFieldColumn number to find

Return Value

Function SelectBestColumn Integer iFile Integer iField Returns Integer

Call: Get SelectBestColumn iFile iField to IntegerVariable


SelectBestColumn is used to by relational prompt lists to determine which column best matches the binding data for the invoking data entry object (DEO). It does this by searching for a column that has the same binding table and column values that were passed to the function. If it cannot find a match, it returns -1. You can use this and other conditions to determine which column should be used as your update column.

Procedure Prompt_Callback Integer hoPrompt
    Integer iCol

    WebSet peUpdateMode of hoPrompt to umPromptValue

    // get best column for
    Get SelectBestColumn of hoPrompt Customer.File_Number 1 to iCol
    If (iCol=-1) Begin
        Move 0 to iCol // if no good column, use 0
    WebSet piUpdateColumn of hoPrompt to iCol