Smarter Copy-Paste to Protect Your Data

You work across environments — test, production, staging — and you copy more than text. Sometimes it’s formulas. Sometimes it’s data that shouldn’t move as freely as your cursor does. With 4D 20 R10, paste behavior gets smarter.

Formulas copied within the same app stay intact. But across environments, only values are pasted — never the underlying logic.

Expressions and formulas

Styled texts and 4D Write Pro documents can contain formulas that are executed on demand or during specific events, such as printouts or exports.
These formulas are generally “harmless”. Whether they return the current date or a page number is of little importance. However, when they reference database elements or methods, things can become more sensitive.

Contexts and applications

When the environment is under control, there’s no reason to filter anything. Copying a formula from one 4D Write Pro document to another within the same application is no problem at all. The same applies to styled text.
If a user has access to formulas that display a salary or social security number, there’s no reason they shouldn’t be able to copy those same formulas to another document in the same environment.

On the other hand, if it’s not the same application — but based on the same structure (for example, one in test, the other in production) — the situation is quite different. In the latter case, copying-pasting can have completely unintended consequences.

Values vs. formulas

When a copy action is performed, the formula (or formulas) are copied to the clipboard, along with the values returned by those formulas — whether text, dates or images.
When pasting, depending on the context, either the formula or just the resulting value will be used.

When pasting within the same application, the formulas are pasted as-is.

However, if pasting into another environment, only the values — calculated at the time of copying — will be pasted, either as plain text or as an image. The formulas themselves will not be transferred.

Conclusion

This behavior is not optional; it is active starting in 4D 20 R10.
A small change in behavior — a big step toward better data security and integrity!

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.