Qodly Studio for 4D
Direct 4D server access for qodly studio testing and debugging
Qodly Studio for 4D enhances your applications with web pages, now fully integrated into the 4D Developer Edition.
With the release of 4D 20 R7, you can access Qodly Studio for 4D directly from your 4D server, allowing for easier debugging and testing of your web application.
To start, open Qodly Studio for 4D from the “Window” menu when your project is in interpreted mode. The new “Preview Qodly app” option enables real-time visualization of changes.
You can also attach the debugger to Qodly Studio for 4D, but remember that only one debugger can be active at a time.
4D Classes
OutgoingMessage Class
4D 20 R7 introduces the OutgoingMessage class, simplifying how developers deliver custom content, such as files or binary data, in web applications. This class lets you set HTTP headers, body content, and status codes, giving you complete control over responses. With the new onHTTPGet keyword, you can now call functions via a browser’s GET request, making it easy for users to access content like PDFs or images directly through their browser.
Compiler
Simplify variable declarations with direct typing
The new direct typing feature in 4D 20 R7 simplifies variable declarations by eliminating the need for “Compiler” methods.
This change lets developers declare process and inter-process variables directly in their code, enhancing organization and encapsulation. Instead of relying on type inference—which can slow compilation and lead to errors—the compiler pauses when encountering an untyped variable, ensuring type safety without sacrificing efficiency. Direct Typing is enabled by default for new projects, and existing projects can easily toggle the feature in the compiler settings for a smooth transition. This marks a significant improvement in flexibility and control for 4D developers.
4D Write Pro
Elevate document management with new section functions
In 4D 20 R7, significant enhancements ease managing sections and subsections in 4D Write Pro.
The new WP DELETE SECTION command allows complete deletion of a section’s content and properties without causing index shifts or unintended merges, ensuring at least one section remains in the document.
Additionally, a standard action for deletion prompts user confirmation and permits one section deletion at a time.
The WP DELETE SUBSECTION command removes all associated attributes, including headers and anchored images or text boxes. The updated WP RESET ATTRIBUTES command enables the simultaneous deletion of all attributes for sections or subsections, reverting them to inherited properties.
Lastly, new toolbar and sidebar items provide context-sensitive actions for deleting sections or resetting attributes, enhancing overall document management and user control.
Temporary visibility for hidden table borders
In 4D 20 R7, working with 4D Write Pro tables just got easier with the new visibleTableBorders property, which displays hidden internal and external table borders as dotted lines.
This feature enhances your ability to manage layouts and data entry, particularly with merged cells, without affecting the final document.
You can access this property in the toolbar and sidebar for convenient use.
Listbox
Introducing “blank if null” for time columns and footers
With 4D 20 R7, the “Blank if null” property is now available for “time” type columns and footers in listboxes, addressing a long-standing limitation.
You can easily define the display behavior through the display theme or by programming. This enhancement allows for clearer and more intuitive results, whether you use a simple checkbox or a line of code.
Singletons
Session Singletons
4D 20 R7 introduces session singletons, allowing developers to manage user-specific data within sessions while isolating it between users. Ideal for web and client-server environments, session singletons ensure smooth handling of user requests across multiple processes, simplifying use cases like personalized shopping carts and other session-based data management tasks.
Component manager
Adding and removing local components
In 4D 20 R7, managing local components is made easy with an improved Project Dependencies interface. This interface allows users to add and remove components with just a few clicks.
The ‘dependencies.json’ file centralizes project dependencies for better consistency, while ‘environment4d.json’ enables customizable component paths. Adding components is straightforward, and removal includes confirmation prompts to prevent mistakes.
A restart is required to apply changes, with notifications to guide you. This enhancement simplifies your 4D development experience, facilitating faster access to pre-existing code and components, and future GitHub integration will further improve management.
Administration
Optimize process and session management
Managing processes and sessions is vital for optimizing your 4D applications, and with 4D 20 R7, we’re introducing enhancements that simplify these functions and boost your code’s performance.
New features include:
- a Process info command that returns an object for easier manipulation of process properties,
- a Session info command that allows direct access to session info via session ID,
- an updated Process number command for retrieving process numbers from IDs,
- and the addition of a creationDateTime property to track when a process was created.
- Additionally, the Process activity command has been improved to filter results more efficiently by session, allowing you to easily retrieve processes linked to a specific session.
IMAP API
Simultaneous unread email counts for multiple mailboxes
With 4D 20 R7, the IMAPTransporter.getBoxList() function now retrieves unread email counts and mailbox properties simultaneously, improving response times.
You can get counts for multiple mailboxes in one call using the “withBoxInfo” parameter. For specific mailboxes, simply pass their names in a collection. These enhancements keep users updated about unread emails and are also applied to the Gmail API of 4D Netkit.
Security
Enhanced certificate authority validation for client-server communication
In 4D 20 R7, certificate authority validation enhances security for client-server communications by allowing clients to verify server certificates against trusted certificate authorities (CAs).
This feature helps prevent man-in-the-middle (MITM) attacks, ensuring the server’s identity is authenticated.
To implement this, developers need to add two values to the buildSettings.xml file: the location of a file containing valid CA signatures and the server’s domain name.
This allows the client to confirm that the server’s certificate is issued by a valid CA and matches the expected domain. For flexibility, a list of valid domain names can also be provided.
User Interface
Custom icons for every window type
The SET WINDOW DOCUMENT ICON command lets you define a custom icon for each window type, improving user navigation and experience. Using the command syntax, you can set an icon or document for a window, making your interface more visually appealing. The icon will be visible in the window and Windows taskbar, providing clear visual cues. This feature also supports associating icons with documents, offering additional customization options.
4D View Pro
New user-friendly features for data manipulation
The latest update to SpreadJS enhances the 4D View Pro development experience with user-friendly features that ease data manipulation and visualization.
Key updates include:
- Moving or inserting rows and columns by dragging headers simplifies data organization.
- New chart options, such as Waterfall charts and smooth line formatting, improve data representation. Users can now create charts from multiple non-contiguous selections, and the Lollipop Variance Sparkline effectively shows data variances with minimal space.
- Enhanced paste special options allow for selective data pasting, while customizable sheet tabs improve visual organization.
- Additionally, events now support pixel scrolling for better responsiveness, and Excel import retains sort conditions, ensuring data integrity.