Skip to content

phmPromptSeedBufferCallback - cDbCJGridPromptList

Defines a custom message to be sent to the invoking object to seed the prompt list's file buffer

Type: Property
Access: Read/Write
Data Type: Handle
Parameters: None

Syntax

Property Handle phmPromptSeedBufferCallback
Access Type Syntax
Read Access: Get phmPromptSeedBufferCallback to HandleVariable
Write Access: Set phmPromptSeedBufferCallback to HandleVariable/Value

Description

Normally, the seeding process is determined relationally (peUpdateMode is umPromptRelational) or through the use of piUpdateColumn and psSeedValue. The buffer will be seeded and an initial record will be found. This all occurs inside of SeedData.

If this seeding process is not sufficient, you can override it by setting the callback property phmPromptSeedBufferCallback. If set, this will contain a callback event that will be sent to the invoking object. That event is then used to seed your table buffer. The seed event is passed the object handle of the prompt list.

This property is normally set within the invoking object's Prompt_Callback event.

When called, the table buffer is cleared. If you seed the buffer, that inactive seeded buffer will be used for the find within SeedData.

Procedure SeedBuffer Handle hoPrompt
    Get Value of oDivision to Customer.Division       
    Get Value to Customer.Customer_Number
End_Procedure

 Procedure Prompt_Callback Integer hPrompt
      Set peUpdateMode of hPrompt to umPromptValue
      Set piUpdateColumn of hPrompt to 0
      Set phmPromptSeedBufferCallback of hPrompt to (RefProc(SeedBuffer))
End_Procedure

If you seed the buffer and find the record yourself, that active record will be used as your seed.

Procedure SeedBuffer Handle hoPrompt
    Handle hoServer

    Get Server to hoServer
    Get Value to Customer.Customer_Number
    Get Value of oDivision to Customer.Division       
    // first search in supplied division
    Send Request_Read of hoServer GE Customer.File_Number 3
    If  (Not(found)) Begin
        // if not found, search in unassigned division
        Move "NONE" to Customer.Division
        Send Request_Read of hoServer GE Customer.File_Number 3
    End
End_Procedure

 Procedure Prompt_Callback Integer hPrompt
      Set peUpdateMode of hPrompt to umPromptValue
      Set piUpdateColumn of hPrompt to 0
      Set phmPromptSeedBufferCallback of hPrompt to (RefProc(SeedBuffer))
End_Procedure

The phmPromptSeedBufferCallback is not used when peUpdateMode is umPromptNonInvoking, as there is no invoking object to callback to.