4D Blog

Home Product Meet the Updated Print form & FORM LOAD Commands

Meet the Updated Print form & FORM LOAD Commands

April 28, 2023

Product

4D v16 R5 brought a significant improvement to the DIALOG command. An improvement that lays in the possibility of passing a new parameter “formData” of type object. It was great to hear that this new addition has been well received by 4D developers.

With 4D v20, two other commands are upgraded, Print form and FORM LOAD! The benefit will be just as great. The object’s content passed in the parameter will be directly exploitable in the printed forms or forms loaded in memory.

code SAMPLE

Print form

The PRINT FORM command is widely used by 4D developers thanks to its recent improvements.

The PRINT FORM command can now pass an optional parameter of type object accessible via the Form function in the invoked form. Either directly using the Form function as expressions for the form objects (Form.firstname / Form.lastname / etc.) but also when the on printing detail event is executed.

$formData:=New object()
$formData.lastname:="Smith"
$formData.firstname:="john"
$formData.request:="I need more COFFEE"
$h:=Print form("Print_obj"; $formData; Form detail)

Where the form “Print_obj” looks like this:

 

FORM LOAD

Following the same principle, the FORM LOAD command can now receive an object as a parameter. If it is passed (optional), then the content of this object can be exploited in different ways and modified during the execution of the on load event (only event managed and only inside a sequence OPEN PRINTING JOB / CLOSE PRINTING JOB).

OPEN PRINTING JOB

$formData.LBcollection:=New collection()
$formData.LBcollection.push(New object("reference"; "alpha"; "quantity"; 3; "total"; 120.99))
$formData.LBcollection.push(New object("reference"; "bravo"; "quantity"; 2; "total"; 599.99))

FORM LOAD("GlobalForm"; $formData)  // $formData NEW !!!

$over:=False
Repeat 
	$full:=Print object(*; "LB")  // the datasource of this "LB" listbox is Form.LBcollection	
	LISTBOX GET PRINT INFORMATION(*; "LB"; lk printing is over; $over)
	If (Not($over))
		PAGE BREAK
	End if 
Until ($over)
CLOSE PRINTING JOB

…where the “GlobalForm” contains a listbox “LB” using Form.LBcollection as a datasource.

blank

Conclusion

This new programming possibility will save you time and make your code “lighter.”

As usual, feel free to share your feedback on the 4D forums. Looking forward to hearing from you!

 

Discuss

Tags Language, Objects, Printing, v20

Latest related posts

  • December 3, 2025

    Give AI to a 30 years old 4D application

  • November 28, 2025

    ORDA – Handle an event-driven logic during database operations

  • November 27, 2025

    ORDA – Permissions – Restrict / allow web access to the resources in one click

Roland Lannuzel
Roland Lannuzel
• Product Owner & 4D Expert • After studying electronics, Roland went into industrial IT as a developer and consultant, building solutions for customers with a variety of databases and technologies. In the late 80’s he fell in love with 4D and has used it in writing business applications that include accounting, billing and email systems.Eventually joining the company in 1997, Roland’s valuable contributions include designing specifications, testing tools, demos as well as training and speaking to the 4D community at many conferences. He continues to actively shape the future of 4D by defining new features and database development tools.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • AI
  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy