Skip to main content

Posts

Showing posts from October, 2013

Looping Map in Apex Salesforce

How to loop map?Use values().It is quite useful if the map contain object where we need to get the object property. Map < String , String > mapStr = new Map < String , String >(); mapStr . put ( 'A' , ' angsa ' ); mapStr . put ( 'B' , ' beruk ' ); mapStr . put ( 'C' , ' cicak ' ); system . debug ( ' @mapStr ====== ' + mapStr ); for ( String s:mapStr . values ()){ system . debug ( '@' + s ); } The output : DEBUG|@mapStr ======{A=angsa, B=beruk, C=cicak} DEBUG|@angsa DEBUG|@beruk DEBUG|@cicak

Escape from Single Quote

Everytime I need to do soql statement I have to googling around.I keep forgeting. Okay, I copy this from salesforce link here . Sequence Meaning \n   or   \N New line \r   or   \R Carriage return \t   or   \T Tab \b   or   \B Bell \f   or   \F Form feed \" One double-quote character \' One single-quote character \\ Backslash LIKE expression only:   \_ Matches a single underscore character ( _ ) LIKE expression only: \% Matches a single percent sign character ( % ) This is how I run query using escape for single in Force Explorer . select Id,Name from Country where Name in ( 'COTE D\' IVOIRE ',' CURACAO ',' KAZAKHSTAN ', ' LAO PEOPLE \ 'S DEMOCRATIC REPUBLIC' , 'LIBYAN ARAB JAMAHIRIYA' , 'MACAO' ) order by Name Done.:)