Tips & Tricks for your 4D Apps – February 2025 Edition
by Add Komoncharoensiri, Director of Technical Services at 4D Inc
Here we go with another set of tips and tricks.
The 4D Knowledge Base is a library of information about 4D technology where weekly tech tips and monthly tech notes are actively published. If you missed the last tips on the KB, that’s fine; here is a compilation from the past few weeks.
This blog post covers 15 tips:
Master HTTP Requests with 4D Request Handlers
In today’s web-driven world, servers process an overwhelming number of requests. Efficiently analyzing, counting, interpreting, and rerouting these requests is essential, especially when applying MVC principles.
In 4D 20 R8, with the introduction of HTTP Request Handlers on the 4D HTTP Server, you can define accurately which business logic you want to trigger regarding specific URLs patterns.
Main advantages of this feature are:
- Offering more granularity in implementing the code handling received requests. This business logic can be split in several classes. Forget extensive Case of statements in the On Web Connection database method.
- Allowing a redirection on a Qodly page which opens up new perspectives to extend 4D application on the web
This powerful feature unlocks many possibilities, as detailed below. Keep reading to learn more and work with concrete examples.
Improved FORM EDIT Command: Access Form Objects Easily
The 4D language allows you to develop outstanding business applications. Many of you have taken the initiative to create tools that streamline specific tasks: code, validating links to external elements like images, converting legacy code to ORDA, managing XLIFF resource files, or facilitating refactoring. These custom solutions enhance productivity and foster innovation.
In 4D 20 R8, the FORM EDIT command has evolved. You can now open a form and select a form object.
For instance, you can list the objects in a form from an analysis and introspection tool. Double-clicking on an element in the list will open the form, and you can select the form object to modify one of its properties using the new syntax of the command.
4D Write Pro commands optimized again!
As each new version is released, we take into account the feedback we receive from our customers on the general use of 4D Write Pro and its commands. While remaining 100% compatible, some commands and language functions are evolving!
Some commands, whose syntax have been improved in 4D 20 R8, now allow the use of modern parameters such as objects or collections. Others are now functions, making them easier to use. Finally, a number of new functions have been created. All this will make your code simpler, more generic and easier to maintain!
Empower Your Development Process with your forms
During the development phase, early detection of syntax errors is important for producing quality code. Real-time code checking is a valuable aid to developers. Not only does it improve efficiency, it also enhances quality and boosts productivity. By correcting errors immediately, you can concentrate on the functional development of your application, rather than on annoying bugs that crop up during compilation.
With 4D 20 R8, we’re delighted to introduce two new features that will transform the way you work.
- The first is the ability to associate a class with a form, enabling syntax checking with expressions such as Form.myProperty.
- The second is a real-time check of expressions in the property list, with a description of the error or warning displayed.
4D 20 R8 Beta Starts Today
Beta testing for 4D 20 R8 starts today, introducing a powerful release designed to simplify your workflow and expand your development capabilities.
- Smarter Syntax Checking in Form Editor: Detect errors early with enhanced validation, auto-completion, and object instantiation support.
- Form Editing Made Easy: Open forms and select objects directly with the updated FORM EDIT command for faster edits.
- HTTP Request Handlers: Manage incoming web requests with precision using the 4D HTTP Server’s powerful new features.
- Debugging in VS Code: Debug 4D code directly in Visual Studio Code with the new 4D-Debugger extension.
- Enhanced Document Handling: Simplify sections, tables, and content management in 4D Write Pro with updated commands.
- Excel Integration Updates: Gain greater control over Excel file imports and exports in 4D View Pro.
- And that’s not all — There are even more features to explore!
Download 4D 20 R8 now (Exclusive to 4D Partners)
Tips & Tricks for your 4D Apps – November 2024 Edition
by Add Komoncharoensiri, Director of Technical Services at 4D Inc
Here we go with another set of tips and tricks.
The 4D Knowledge Base is a library of information about 4D technology where weekly tech tips and monthly tech notes are actively published. If you missed the last tips on the KB, that’s fine; here is a compilation from the past few weeks.
This blog post covers 20 tips:
Energize your Web applications with the OutgoingMessage Class
In today’s digital world, a smooth and intuitive user experience is key to any web application’s success. A critical part of this experience is providing users with easy access to various resources—whether documents, images, or other data types. To make this possible, your server must manage and deliver different content formats efficiently.
With 4D’s 20 R7 new REST server feature, managing diverse content delivery is now easier than ever. Previously, the REST server could only return scalar, entity, or entity selection data. Now, it can deliver full web content directly—content ready for a browser to handle.
Downloading files or receiving binary data from the REST server is now straightforward, thanks to the new OutgoingMessage class. With it, you can easily customize responses to suit your needs.
Read on to explore how the OutgoingMessage class can enhance your application!
4D 20 R6 is Here
Introducing 4D 20 R6 – Available Now!
Here’s a quick look at what this feature release brings:
Download 4D 20 R6 (monthly Hot Fixes available)
- Code Editor: Customize which warnings are generated to stay focused on critical issues.
- Programming:
- Use new comparison operators to check if objects or collections share the same reference.
- Access classes from other components via namespaces for greater flexibility.
- Keep data consistent across sessions with Session Storage by ID.
- Automate PDF/A3 file extraction for electronic invoicing.
- Ensure security by default with Force Login for REST API,
- and boost performance with HTTP Agents through connection reuse.
-
- GitHub Components: Manage components directly in 4D, with automatic repository downloads and semantic versioning for smoother collaboration.
- 4D Write Pro: Keep documents clean with the wk empty datasource attribute, controlling how tables appear when datasources are empty.
- User Experience: Enjoy smoother subform navigation with enhanced scrolling behavior, improving user interaction.
- ORDA: Use the new clean() function to eliminate empty spaces and keep your interfaces tidy with less effort.
PDF/A3 Attachment Extraction
In previous posts, we explored embedding documents within PDF/A-3 files using 4D Write Pro, including generating electronic invoices. As e-invoicing becomes mandatory in various European countries—such as France and Germany—the ability to extract embedded XML files from these PDFs is becoming crucial. But the utility of PDF/A-3 extends beyond invoices; these files can embed various document types that may require extraction.
While tools like Adobe Acrobat Reader offer manual extraction, this post introduces an efficient, automated method using 4D 20 R6 to easily handle the process.
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