Previous Thread

8/18/2006 8:28:12 AM    Formating data in text field in CRM 3.0
Hello, 
 
I have a problem with some field (ex. my_field ntext(5000)). 
 
I have some code in OnSave() and there I insert to my_field some data. 
 
First problem is, how can I return actual date. Now I use field 
 
modifitedOn in CRM. 
 
But I can't format this date, like this (ex. 2006-06-18). 
 
Now I have this format "Fri Aug 18 16:21:02 UTC+0200 2006" and I want 
 
format (2006-06-18). 
 
Second problem is, how can I insert char of enter to my_field. 
 
Now it look like this: Mark Twain - 2006-06-18 - OK Mark Twain - 
 
2006-07-18 - OK etc. 
 
and I want: Mark Twain - 2006-06-18 - OK 
 
Mark Twain - 2006-07-18 - OK 
 
I don't know how can I insert char of enter, whitch will break line in 
 
text. 
 
anyone can help me? 
 
thanks 
 
Andrej



8/18/2006 6:31:10 PM    Re: Formating data in text field in CRM 3.0
Andrej, 
 
To insert line breaks in your code, add the following in the onload event of 
 
your form: 
 
crmForm.all.your_textField.style.whiteSpace = "pre"; 
 
Look at 
 
http://msdn.microsoft.com/library/en-us/script56/html/ce2202bb-7ec9-4f5a-bf48-3a04feff283e.asp 
 
to get a list of methods and properties of the JScript Date object. 
 
-- 
 
Michael 
 
http://www.stunnware.com/crm2 
 
---------------------------------------------------------- 
 
"Andrej" <puszykk@poczta.onet.pl> schrieb im Newsbeitrag 
 
news:1155914892.088158.191920@i42g2000cwa.googlegroups.com...