Day: April 25, 2017

Apex from Custom button or Javascript : Ajax toolkit

Controller:

To call a webService method with no parameters, use {} as the third parameter for sforce.apex.execute . Favorite

Read more

lock record using SOQL so that it cannot be modified by other user

we will need “FOR UPDATE” clause of SOQL.

Favorite

Read more

SOQL statement can be used to get all records even from recycle bin

We will need “ALL Rows” clause of SOQL.

Favorite

Read more

enum in APEX

Favorite

Read more

Custom settings: How to get the data

Favorite

Read more

How to get all the required fields of sObject dynamically

There is no direct property available in Apex dynamic API to represent the required field. However there is another way to know about it. If any field have below three properties then it is mandatory field. If it is Creatable If it is not nillable and If it does not have any default value

[…]

Read more

get all the fields of sObject using dynamic Apex

Favorite

Read more

create instance of sobject dynamically

Favorite

Read more

get the list of all available sobject in salesforce database using Apex (Dynamic Apex)

Favorite

Read more

restrict any Trigger to fire only once

how we can avoid repeated or multiple execution of Trigger? Triggers can fire twice, once before workflows and once after workflows, this is documented at http://www.salesforce.com/us/developer/docs/apexcode/ Content/ apex_triggers_order_of_execution.htm: “The before and after triggers fire one more time only if something needs to be updated. If the fields have already been set to a value, the […]

Read more