Thursday, July 28, 2016

Apex inputField issue with dataTable,pageBlockTable and repeat

When working with <apex:inputField> inside dataTable,pageBlockTable with wrapper objects you have to use <apex:column> if you donot use it visualforce pahe will result inot an error saying

"<apex:inputField> can only be used with SObjects, or objects that are Visualforce field component resolvable."

To over come this you have to use <apex:inputField> inside <apex:column> or you can use <apex:repeat> instead, when you use <apex:repeat> you have to design the table structure yourself.

Monday, July 18, 2016

Using Salesforce SOAP API in Ajax

Just a small post(its a very old functionality but I just posted it now) for how to create record using /soap/ajax/ in Salesforce. The code can be written in Visualforce page as well as Custom button as javascript.

Reference: SOAP API

Usage:
  1. Can be used to create record like logs or attachments from javascript hence reducing server processing time.
  2. Can query record to check values in page layout buttons.

Friday, July 1, 2016

How to have a image crop functionality in salesforce

Many time there is a custom requirement(generally in community) that a user can upload images, and when they do so there should be a functionality to crop or rotate it. We can achive it by using "corpper.js" Link.

Note: This page will through a viewstate error, due to base64 string size, try using transient variable to solve this.