Apex

Invoking apex class from process builder

Overview 

The Process Builder is a new workflow tool from spring release 15 that promises you to easily automate your business processes by providing a powerful and user-friendly visual representation of your process as you build it. The Process Builder’s simple and powerful design which not only creates, updates records, send emails, Call a Flow, Post to Chatter and Submit for approval but also calls apex class in order to achieve requirements which cant be done by any of the above.

Pie Chart in salesforce

Use Case: 

Representing the value in pie chart format.

Solution:

To display the values in pie chart you want to first construct the data in the format of string and Integer in a Wrapper class then pass that list of the wrapper class to the apex:chart . Height , Width and data are required parameters in apex:chart.

Where am I ? Salesforce

It’s an age old question: “Where the hell am I?”  I don’t like to stop and ask for directions and neither does my code.  I’m surprised it took me this long to require some way for my code to be able to detect the environment in which it was running.

I needed to answer these two questions:

Understanding Trigger Context Variable

When I started my carrier as Salesforce developer.when I wrote my first trigger code, I always use to hear "first understand Trigger.new and Trigger.old"(Trigger context variable) from senior colleague in my team. Then I started searching for what trigger.new, trigger.old and other context variable will return in trigger, whether there is any practical experiment for this, but I didn't get any. 

This is only one Salesforce site helped me to understand theoretically.

Dynamically querying fields by passing object name dynamically

 First you need to know why this topic, as a developer I got tension when I developing an application.In controller mostly we use fields API while querying the fields from

objects till now I used the SOQl query [select Name, CreatedDate, pincode__c from Object] like this it will work fine.

But the problem here it is, if I want to change the properties of the custom fields or delete the custom fields Salesforce will through the custom field validation error like the field is reference this apex class and page etc mostly classes.