December 14, 200817 yr 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?
December 15, 200817 yr Set Field [ Contacts::Notes; TextColor ("---" & Get( CurrentDate ) & "@" & Get( CurrentTime ) & "by" & Get( UserName ) & "---"; RGB ( 0 ; 0 ; 255 )) & TextColorRemove ( ¶ ) ]
December 15, 200817 yr Author 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?
December 15, 200817 yr 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 ]
December 15, 200817 yr 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 ) ) ]
December 15, 200817 yr 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.
December 15, 200817 yr 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.
December 15, 200817 yr 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 ) ) ]
December 15, 200817 yr Couldn't there be something in the middle between erasing all the previous notes and duplicating them?
Create an account or sign in to comment