+ Start a Discussion
mikefmikef 

Leading line breaks

Just let me know if this is expected behavior or this is a bug.

I want to update/insert an sobject and in one of the text long fields I want leading new lines.
But I can’t get that to happen.



Here is a test script.

Account test = new Account(name='miketest',Description='\n\n what is going on?'); insert test; test = [select description from Account where id = : test.id]; System.debug('**** ' + test.description); test = new Account(id=test.id,Description='What\n\nis Going on?'); update test; test = [select description from Account where id = : test.id]; System.debug('**** ' + test.description);

 



Here is the debug log.

 

 

12:50:14 INFO - 20091029194505.598:AnonymousBlock: line 2, column 1: Insert: SOBJECT:Account 20091029194505.598:AnonymousBlock: line 2, column 1: DML Operation executed in 84 ms 20091029194505.598:AnonymousBlock: line 3, column 8: SOQL query with 1 row finished in 23 ms 20091029194505.598:AnonymousBlock: line 4, column 1: **** what is going on? 20091029194505.598:AnonymousBlock: line 6, column 1: Update: SOBJECT:Account 20091029194505.598:AnonymousBlock: line 6, column 1: DML Operation executed in 49 ms 20091029194505.598:AnonymousBlock: line 7, column 8: SOQL query with 1 row finished in 21 ms 20091029194505.598:AnonymousBlock: line 8, column 1: **** What is Going on? Cumulative resource usage:

 



So I can save line breaks after the first character of a string but not before

 



The outcome I want is:

 

20091029194505.598:AnonymousBlock: line 8, column 1: **** What is Going on?

 

 

 

Any insight would be helpful.