4D Blog

Home Tips Keep track of your formulas with this new command

Keep track of your formulas with this new command

June 12, 2018

Tips

Imagine you have a list of formulas containing table names and some fields … then days later you decide to rename your tables. Now your formulas are no longer valid, which is totally understandable!

Well, good news: the new Parse formula command allows your formulas to remain valid when renaming 4D language or structure elements.

This command makes it possible to transform the contents of a 4D formula into different formats. For example, a formula containing the name of a table and a field can be transformed into a formula containing the corresponding virtual structure and vice versa.

It also lets you tokenize or detokenize a formula. This makes it possible to save a user-defined formulas by converting it to its tokenized format. You can then display the formula in a detokenized format without worrying about problems caused by changing a table or field name.

code snippet

Here is an example of this command in action:


// ask the user to type their favorite formula

$formula:=""
EDIT FORMULA([Table_1];$formula)
 
// save the formula for later use
CREATE RECORD([users_preferences])
$persistentFormula:=Parse formula($formula;Formula out with tokens)
[users_preferences]formula:=$persistentFormula
 
// later: execute the previously saved formula
CREATE RECORD([Table_1])
EXECUTE FORMULA([users_preferences]formula)

And voilà, no more invalid formulas!

Discuss

Tags Programming, v17

Latest related posts

  • September 15, 2025

    Find the right spot in your 4D Write Pro document with AI

  • September 2, 2025

    Intelligent 4D Write Pro document analysis with AI

  • August 25, 2025

    ORDA – Constructor and touched event – Detailed behaviour through a network

Fabrice Mainguené
Fabrice Mainguené
• Product Owner •Fabrice Mainguené joined 4D Program team in November, 2016. As a Product Owner, he is in charge of writing the user stories then translating it to functional specifications. His role is also to make sure that the feature implementation delivered is meeting the customer need.After obtaining a Bachelor degree in Computer Science at CNAM, Fabrice joined a small software publishing company as a Windev developer. Then he worked for different companies in industry and trade areas as a Windev and web developer as well as technical advisor on new features.
  • 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-Analyzer 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 vscode Web Word processor

Tags

4D-Analyzer 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 vscode Web Word processor
Subscribe to 4D Newsletter

© 2026 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