Have you applied a different format to the field on your layout? If so, remove that format and I think you'll see what you want.
Do you have an Auto-Enter Calculated value set on this field to format the text? This would explain what is happening as you set the field and then the Calculated value kicks in and reformats the text.
If this is the case you could modify the Calculation and script slightly to not trigger when you run your script.
Modify the Auto-Enter Caluclated value to:
If ( IsEmpty ( $DontFormat ) ; Proper ( Self ) ; Self )
And then add in a Set Variable step to set a variable $DontFormat to "1", so it will look like:
Set Variable [ $DontFormat; Value:1 ]
Set Field [ TABLE::Clinic_Name ; Proper ( TABLE::Clinic_Name ) ]
Commit Records/Requests [ Skip data entry validation; No dialog ]
I would also change your Insert Calculated result to a Set Field, as it does not require the field to be on the layout and the Set Field step gives you better control without the limitations.
I hope this helps.
Phil - thanks for the suggestion but that's not the problem. There is no case formatting on the field.
I should add that for entries in the field that are formatted correctly the script has no effect and that data remains formatted properly.
No auto calc on the field.
See my comment above about properly formatted entries.
I used the Insert Calc just in case the problem was the Set Field command. But it wasn't.
Thank you for your post.
Your calculation and the answer provided by "Orlando" are fine.
For testing purposes, create a calculation field with the formula:
Proper ( <table>:: Clinic_Name )
This should display the information you want it to appear. If this doesn't display correctly, then please post an example.
If this does display correctly, then replace the contents of the field with this formula.
Thanks - your suggestion worked.
Can you explain why my approach didn't?
First, I'm glad you got it to work.
Your formula is fine, and the only reason I can think of why it didn't work is if the first character follows a punctuation mark. For example, if the contents of the field was:
(wizard of oz)
...you would expect the result ot be: (Wizard Of Oz)
However, TitleCase capitalizes the first character after a space, so the actual result would be:
(wizard Of Oz)
That is, the parenthesis is being evaluated for uppercase; not the "w" in wizard.
I hope this helps.