hall312 Posted December 14, 2008 Share Posted December 14, 2008 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? Link to comment Share on other sites More sharing options...
Raybaudi Posted December 15, 2008 Share Posted December 15, 2008 Set Field [ Contacts::Notes; TextColor ("---" & Get( CurrentDate ) & "@" & Get( CurrentTime ) & "by" & Get( UserName ) & "---"; RGB ( 0 ; 0 ; 255 )) & TextColorRemove ( ¶ ) ] Link to comment Share on other sites More sharing options...
hall312 Posted December 15, 2008 Author Share Posted December 15, 2008 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? Link to comment Share on other sites More sharing options...
Lee Smith Posted December 15, 2008 Share Posted December 15, 2008 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 ] Link to comment Share on other sites More sharing options...
Raybaudi Posted December 15, 2008 Share Posted December 15, 2008 Hi Lee I think that is better the inverse ( so someone can add notes in plain black text ) 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 ) ) ] Link to comment Share on other sites More sharing options...
LaRetta Posted December 15, 2008 Share Posted December 15, 2008 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. Link to comment Share on other sites More sharing options...
comment Posted December 15, 2008 Share Posted December 15, 2008 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. Link to comment Share on other sites More sharing options...
Raybaudi Posted December 15, 2008 Share Posted December 15, 2008 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 ) ) ] Link to comment Share on other sites More sharing options...
comment Posted December 15, 2008 Share Posted December 15, 2008 Couldn't there be something in the middle between erasing all the previous notes and duplicating them? Link to comment Share on other sites More sharing options...
Raybaudi Posted December 15, 2008 Share Posted December 15, 2008 Fixed, thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 5749 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 accountSign in
Already have an account? Sign in here.
Sign In Now