This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v20 R7
On Drop Database Method

On Drop Database Method  


 

 

The On Drop Database Method is available in local or remote 4D applications.

This database method is automatically executed in the case of objects being dropped in the 4D application outside of any form or windows context. Different drop actions are supported, depending on the platform and the application type:

ActionPlatform(s)Comment
Drop in an empty area of the MDI windowWindowsNot available when the database is executed in SDI mode since there is no MDI window in this context (see SDI mode on Windows section).
Drop on the 4D icon in the DockmacOS
Drop on the 4D icon in the system desktopWindows(*) & macOSThe On Drop Database Method is only called when the application is already launched, except in the case of applications merged with 4D Desktop. In this case, the database method is called even when the application is not launched. This means that it is possible to define custom document signatures.

(*) Not supported on Windows when this action launches a new application instance (system feature).

On Mac, you need to hold down the Option+Command keys during the drop in order for the database method to be called.

Example  

This example can be used to launch the printing of labels when a label document is dropped outside of any form:

  // On drop database method
 If((Position(".4LBP";$droppedFile))=(Length($droppedFile)-4)
    ALL RECORDS([Employee])
    PRINT LABEL([Employee];$droppedFile)
 End if



See also 

Database Methods

 
PROPERTIES 

Product: 4D
Theme: Drag and Drop

 
PAGE CONTENTS 
 
HISTORY 

 
ARTICLE USAGE

4D Language Reference ( 4D v20 R7)