Convert classic 4D forms to dynamic forms

Your forms may need to be changed depending on your customer or user needs. For example, the color black might be perfect for one user but not so much for another user (who sees blue as the ultimate perfection). Luckily, dynamic forms (introduced with 4D v16 R6) are here to help you handle your users’ preferences. But rewriting an existing form to a dynamic form could be a difficult task, and it’s not always easy to start with a blank page. Ideally, it’d be best to have a draft that can be modified and improved. With 4D v17 R3, it’s now possible to easily convert a classic 4D form (stored in .4DB file) to a dynamic form.

Database example

For this, a new command is available. Pass the form name and you’ll receive an object describing the form.

$oForm:=FORM Convert to dynamic("myProjectForm")

Then you can make changes to the form quickly and easily. For example, you can change the font color for all objects with the “Cancel” label in your form by code:

// iterate on all objects of first page
$pageObjects:=$oForm.pages[1].objects
For each ($object;$pageObjects)
  If (String($pageObjects[$object].text)="@Cancel@") // all widgets with a "Cancel" caption text
    $pageObjects[$object].stroke:="red" // change it to red color
  End if
End for each

DIALOG($oForm)

Other example, you can save the dynamic form in a file on the user’s computer and do a implement personalized modifications for this specific user only.

The font color was just a simple example. But that’s not all … font, font size, enterable, format, position, resize, resizing option, assigned object method or form events, and much more. You can completely redesign a form on the fly. The possibilities are endless!

Vanessa Talbot
• Product Owner •Vanessa Talbot joined 4D Program team in June, 2014. As a Product Owner, she is in charge of writing the user stories then translating it to functional specifications. Her role is also to make sure that the feature implementation delivered is meeting the customer need.Since her arrival, she has worked to define key features in 4D. She has worked on most of preemptive multi-threading new features and also on a very complex subject: the new architecture for engined application. Vanessa has a degree from Telecom Saint-Etienne. She began her career at the Criminal Research Institute as a developer for the audiovisual department. She has also worked in media and medical fields as expert in technical support, production as well as documenting new features.