I am stuck with an issue, not sure what to check, on the customer file , their is a customer code field
lets say with a value of CUSJOHN . this value is stored in another file, customer tranx, . 99.99999 % of the time it saves correctly as CUSJOHN, but their is that 0.00001 % time it will save as cusjohn.
Any suggestions would be apprciated
check the field(s) where this is created/updated and make sure the UPR is on the field control
See entry_declare_a_data_entry_control_.htm [Clarion Community Help]
If it allows lowercase then someone could enter or update the value
UPR in the field propertys is not helping if somebody is pasting a value with copy&paste.
The only 100% thing is really to do a field=upper(field) bevor saving the record.
If you really want to enforce the UPPER, regardless of the source of the data being written comes from, add code to the file manager object triggers.
If your project is multi-DLL, then open your data DLL APP, otherwise open the APP for the EXE.
Go to the Global Embeds.
Probably best to press the Collapse tree button to make it easier to navigate.
The open the Global Objects → ABC Objects → File Manager tree branch.
Find the file manger for your table and open that branch.
Then find the PreInsert method and open that.
Add code to the Start of Scope priority
PRE:MyField = UPPER(PRE:MyField)
Add the same code to the PreUpdate method.
These methods get invoked when you do a FileManager.Update/Insert or if you use the Clarion commands ADD/PUT.
You can also add this logic in the dictionary in the Triggers section for the table. If you are using Legacy template, I believe the only way to add the trigger logic is via the dictionary.
Thank you Rick, Will apply these changes.