Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5823 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

This is a part of the script I have for a Notes field. It enters the date, user, time in blue.

Insert Calculated Result [Contacts::Notes; TextColor (--- " & Get(CurrentDate) & "@" &Get(CurrentTime) & "by" &Get(UserName) & "---"; RGB (0;0;255))]

I want it to go back to black on the rest of the information the user enters. Example.

[color:blue]12/15/2008 @ 1155 by Bob Smith

The quick brown fox jumps over the lazy dog.

As it stands now, everything is blue. What step do I need to change back to black after the time date heading?

Posted

Set Field [ Contacts::Notes; TextColor ("---" & Get( CurrentDate ) & "@" & Get( CurrentTime ) & "by" & Get( UserName ) & "---"; RGB ( 0 ; 0 ; 255 )) & TextColorRemove ( ¶ ) ]

Posted

Thank you Daniele for the quick response. It works other than one thing - it erases all the other info in the box when I add a new entry. Any further help on that issue?

Posted

try it this way

Set Field [ Contacts::Notes; TextColor ("---" & Get( CurrentDate ) & "@" & Get( CurrentTime ) & "by" & Get( UserName ) & "---"; RGB

( 0 ; 0 ; 255 )) & TextColorRemove ( ¶ ) [color:blue]& Contacts::Notes ]

Posted

Hi Lee

I think that is better the inverse ( so someone can add notes in plain black text ):B

Set Field [ Contacts::Notes ; Let ( t = TextColor ("---" & Get( CurrentDate ) & "@" & Get( CurrentTime ) & "by" & Get( UserName ) & "---"; RGB

( 0 ; 0 ; 255 )) & TextColorRemove ( ¶ ) ; If( IsEmpty ( Contacts::Notes ) ; t ; Contacts::Notes & ¶ & t ) ) ]

Posted

hall312, please notice that both Lee and Daniele are suggesting you use Set Field [ ] and NOT Insert Calculated Result. It does not require that the field be on the layout which Insert Calculated Result requires. Overall, Set Field [ ] is the best choice in almost every instance.

Posted

But perhaps not in this instance where it would be convenient to place the cursor in the field, ready for typing. And 'Undo' would be available, too.

Good point.

So:

Insert Calculated Result [ Contacts::Notes ; Let ( t = TextColor ("---" & Get( CurrentDate ) & "@" & Get( CurrentTime ) & "by" & Get( UserName ) & "---"; RGB

( 0 ; 0 ; 255 )) & TextColorRemove ( ¶ ) ; If( IsEmpty ( Contacts::Notes ) ; t ; Contacts::Notes & ¶ & t ) ) ]

This topic is 5823 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.