Master-Detail: Field is not writable error on Apex

I came upon this error when I assigning the custom object to the master standard object. Invoice__c inv = new Invoice__c(); inv.Account__c = accountId; insert inv; Then I get this error. Field is not writable : Invoice__c.Account__c The fix was actually easy. I just rewrote it to assign the master id on instantiating the child […]

Parsing Instagram JSON on Apex

Last week I had a challenge of making a API callout to Instagram from Salesforce and then parse the returned JSON content and the mapped the values to become a record for a custom object. Basically each media post and comments becomes a record in Salesforce.

First off you can start by reading this article

According to http://www.json.org:

JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. … JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others.

To begin, what I have here is an API request for comments for a particular media or picture I have in Instagram.

Read more about Parsing Instagram JSON on Apex

Javascript Page Redirect on a VF Page

Stumbled upon this issue and found an easy fix. You have a VF page that you want to redirect a user to a different website, say for OAuth2 authenticate. window.location.href=’https://api.instagram.com/oauth’; This will not work as the browser will complain about Iframe security or Security sandbox violation. This is because VF page are iframed, to get […]

Preparing for the Advanced Force.com Developer Exam

I just wanted to share that I took the Advanced Force.com Developer exam and passed the first part of the test which is the multiple choice 69 question exam. The exam test your knowledge on advanced topics covering triggers, execution context, visual force pages, standard and custom controllers, running unit test, development lifecycle, data migration […]