Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 3 Jahren, 7 Monaten
Letzter Beitrag:
vor 3 Jahren, 7 Monaten
Beteiligte Autoren:
SolutionJ-Reg, Arie, Ola, Stefan Bentvelsen

Customer specific captions

Startbeitrag von SolutionJ-Reg am 30.10.2014 18:35


I want to allow different companies who use a computer system I've written to choose different names for certain database fields.

So, for example, I might have a field called ProductID, which has a caption in the Analysis set to 'Product', but a particular company might want to see this as 'Item' on every form and report it appears on.

Currently I do this in code which examines the caption of every data field on every form and report as they open. I enclose the caption on the form/report in # (so e.g. #Product#) and then use string functions to replace it with the required value which I retrieve from a table.

This works, but is complex and must slow the system down. Is there a better way of doing this?



Hi Reg,

Here's what I do:
Put the changeable field captions in fields in a global one-record parameter file, where the user can give any names to them.

Replace the field names in forms with something like ProdId..Caption = PARAM.ProdIdName.

If these fields are used in tables and reports, they must be moved to column headers with something like Table.ProdIdName..Caption = PARAM.ProdIdName

And you can take this even further by defining the caption names in the product group (or category) file, so that they can be different in different category products.

If these are optional fields, and their caption fields are empty, then grey them or make them invisible.

Best regards

von Ola - am 30.10.2014 20:44
Hi Reg,

if the speed is a problem, you could try to use MyWindow..DisplayEnabled before and after the replacement in your window.

// Before the replacement:
MyWindow..DisplayEnabled = False

// Your caption replacements
// ...

// After the replacement:
MyWindow..DisplayEnabled = True

The window is than refreshed ones.

von Stefan Bentvelsen - am 31.10.2014 08:19
Hi Ola,

Thanks for this, it sounds like a cleaner way to do it.


von SolutionJ-Reg - am 31.10.2014 08:21
Hi Stefan,

Thanks, that's a good idea.


von SolutionJ-Reg - am 31.10.2014 08:21
I would do this in the opening section of a window. Before the window is shown in the first place.
Otherwise the user may see thee 'old' caption first and then the change to a new caption.

I can;t imagine speed will be a problem, at least not the drawing part. Or you must have dozens of controls, which could possibly change.
If you read the new captions from let's say the database, just be sure to create proper indexes on the table holding this info.
Or use an array and read these values once, ie when starting.

von Arie - am 31.10.2014 08:37
Thanks Arie

von SolutionJ-Reg - am 31.10.2014 08:38
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.