Solving Error: SObject row was retrieved via SOQL without querying the requested field:

Got this tricky bug with my simple setup. I have a Visualforce page displaying one custom field(Percent) form to set a new value. I’m using a StandardController on the Quote object with an extension for other custom logic. Once value is passed a new visualforce page displays the new data.

It works fine like validation if value is non numeric or below 0 or higher then 100, but further testing such as adding two blanks spaces then an integer like 1 causes the error.

It would throw the SObject Exception error:

SObject row was retrieved via SOQL without querying the requested field: Quote.Name

Turns out to be a common problem as reference to

http://blog.jeffdouglas.com/2010/12/28/neat-salesforce-urlfor-trick/ and

http://forums.sforce.com/t5/Visualforce-Development/error-referencing-field-using-standard-controller-extension/m-p/83237

As for the fix simply adding the error field being reference, in my case the I added {!quote.name} in my Visualforce page solved the problem.

Move WordPress site from shared hosting to Amazon EC2

This is a followup post from last week when I moved this blog from shared hosting on Bluehost.com to Amazon Web Services EC2 Micro instance.

Basically the steps are straightforward for your old host
1. First is backup all your files
2. Backup the database.

Next series of steps are for the AWS side, first is to create an account
3. Create an account by signing up at aws.amazon.com and go through all verification to get your account activated.
Read the rest of this entry »

Permissions are too open ‘pem’ Warning! Unprotected Private Key File

I’m planning on taking on a Linux certification exam soon so I’ll be dropping some quick fix and tricks here for notes.

If you are getting an error when trying to SSH to your server with your private key, this means your permissions are too open.

Quick fix enter the following the command line.

#chmod 600 mykeyfile.pem

Finally moved my blog hosting to be hosted on the Cloud with AWS EC2 Micro package

When I first signed up to Bluehost they advertise the $4.95 per month cost of shared hosting. But after your the first(year(s)) subscription runs out the monthly would be $8.95/month and that’s not so cheap. Since I’ve been into Cloud Computing for years and my not so active blog needs a new host I finally moved my blog hosting from shared hosting on bluehost to Amazon Web Services EC2 for FREE. I chose a Micro Instance with an Ubuntu Linux image and got setup my server setup in 5 mins.

Read the rest of this entry »