The Silver Lining

Lessons & Learnings from a salesforce certified technical architect.

Archive for July 2009

Formatting Salesforce OutputText

with 3 comments

Quite recently I came across an interesting forum post by XactiumBen that mentioned some awesomesauce abilities of params in outputTexts. I’ve written an article detailing the basics of this functionality before, and thought I’d document these advanced capabilities too. For anyone interested you can read Part 1 here.

Now I’m sure some of you thought that simply being able to use dynamic custom labels was pretty smashing in it’s own right, but you ain’t seen nothing yet. Imagine a world where you could not only use dynamic custom labels, but were also able to use decision structures in those labels. That’s the world we live in buddy! Read the rest of this entry »

Written by Wes

July 24, 2009 at 4:25 pm

Meaningful Error Messages #94

with 3 comments

This one is a hoot,

Error Error: java.sql.SQLException: ORA-00001: unique constraint (CORE.AKAPEX_CLASS) violated ORA-06512: at “SNEEZY.CAPEX”, line 505 ORA-06512: at line 1 : {call cApex.update_class(?,?,?,?,?,?,?,?,?,?,?,?)})}

Sneezy.Capex, what a cute name.

The number of question marks in the error message scares me a bit so I may take an early lunch and try to forget about it. Solution pending.

Written by Wes

July 17, 2009 at 11:37 am

Meaningful Error Messages #24

leave a comment »

Having just managed to discover the cause of a particular error message, I thought I’d share the solution with the community.

Once in while you come across error messages that point you in absolutely no direction at all. Most recently I’ve been receiving ‘Failed validation: ApexPage‘. Thinking that I might get something more meaningful from the in-browser IDE I dumped my code there and got this little gem

Error Error: common.request.servlet.PageDispatcher$Hack404
Error Error: null
Considering that I was working with a several hundred line file, this made me less than happy. At times like these I whip out that old faithful tool of developer’s everywhere, the binary search algorithm. Read the rest of this entry »

Written by Wes

July 14, 2009 at 11:51 am

the sharing model cannot be updated through the api

leave a comment »

Now I’m sure there’s a reason for this but it makes me sad a bit. Especially when working with a team of developers. Recently I found myself in the following situation,

My team and I had been building a Force.com application and were interested in implementing an UAC model. We had setup the UAC model on one of the Orgs using profiles, roles and sharing rules(we had some issues here too) and then attempted to commit these changes into our SVN repository. Happy that things were going so well, each developer checked out the code and BHAM! we were no longer able to deploy object definitions. [Slow pan to me on my knees screaming to the heavens. A thunderbolt, then a thunderclap overhead] Read the rest of this entry »

Written by Wes

July 13, 2009 at 1:28 pm

Handling System.QueryException

with 5 comments

When attempting to fetch a single record from the database it is easy to run into the above exception. I’ve seen two schools of thought in dealing with this issue – mostly in the forums – and have been hoping to find a more official standpoint. Read the rest of this entry »

Written by Wes

July 9, 2009 at 1:04 pm

Unit Test Data Consistency

leave a comment »

I’m sure every Apex developer has had their Developer Org data interfere with their unit testing. Or perhaps you have coded unit tests that function perfectly within your Developer Org but when deployed to another Org fail because of a different, partial or empty database.

Of course as a developer this type on inconsistency within your work environment is extremely counter-productive. Initially I developed a methodology that did the job but wasn’t nearly as concise as I would have liked. More recently however I’ve developed a technical solution that is universal as well as quick to implement. Read the rest of this entry »

Written by Wes

July 5, 2009 at 9:28 pm

How to avoid Governor Limits [Part 1 of N]

with 5 comments

This topic is waaaay too big to cover in one post, so for now I’m going to concentrate on avoiding this particular exception: ‘Too many SOQL queries’. I will also touch on the ‘Too many DML rows’ exception, and expand on it’s solutions in another post. Bulkifying your triggers is another topic I will cover at some later date, but the methodologies mentioned here should go some way towards helping you avoid some of the Governor Limits there too.

Read the rest of this entry »

Written by Wes

July 1, 2009 at 2:55 pm

%d bloggers like this: