Posts

Showing posts from June, 2016

Action tags in VisualForce Salesforce

Action tags-This tags support for calling action and refresh the field only not visualforce page. apex:actionFunction -     Provides support for invoking controller action methods directly from JavaScript code using an AJAX request. An <apex:actionFunction> component must be a child of an <apex:form> component. apex:actionPoller      A timer that sends an AJAX update request to the server according to a time interval that you specify. Update request can then result in a full or partial page update. You should avoid using this component with enhanced lists. apex:actionRegion        This action tag is use AJAX request for particular field or component. Like we have change the value of pick list in visual force then request go to Server and come back through AJAX without Saving the VF page. apex:actionStatus           A component that displays the status of an AJAX update request. An AJAX request can either be in progress or complete apex:act

Salesforce Architecture , Metadata and API

Image
Multi tenancy  is a bit like renting ho space in an office building. You get your own dedicated space, but you share resources for things like power and water, and someone else takes care of all the building maintenance for you.  For example, if the elevator needs maintenance, the building owner handles it for you. Advantage : customers, from small businesses to enterprise companies, are on the same code-base and all get the benefits of the same features, functionality, and automatic upgrades 3 times a year. Metadata It is Data about Data. You have configuration and customization specific to your business needs like page layouts for your Accounts, Contacts, Leads, and any custom objects. It also includes processes, assignment rules, and sharing and security settings. On the programmatic side, it might also include things like Visualforce pages and Apex triggers. All of this represents what you’ve configured and customized in your org. If data has just been expor

Setup Federated Authentication (SAML) based SSO

SAML  stands for “Security Assertion Markup Language” and it is Open standard for exchanging Authentication and Authorization between Systems. SAML based authentication is supported by all editions of Salesforce. User Validation can be initiated by any one of below two types: Service Provider Initiated SSO Identity Provider (IDp) initioated SSO We are going to use Identity Provider Initiated SSO in this article. Means User will Login from Outside(IDp) and will be redirected to Salesforce (Service Provider). Identity Provider must follow Federated Authentication (SAML) standard which should be deployed to  DMZ  (URL should be publicly accessible on Internet) layer of your Organization. As a Salesforce developer you should assume that you will always get IDp URL which implements SSO and implements valid SAML response. To Quickly start with this tutorial assume that your organization already deployed SAML based Authentication endpoint and for that we will be using great Heroku

Apex CPU Limit Error : after running into an Apex CPU limit error whether anything is committed to the database

In a batch that updates an object that then activates a trigger,  would it stop at the object level or at the trigger level or does it depend on  when the apex limit is hit? Any governor limit, including Apex CPU timeouts, reverts all changes to the database for the  entire  transaction. That means no records are created, updated, deleted, undeleted, merged, converted, etc. The  only  exception to this rule is that any logs that are enabled will be preserved (in Setup > Monitoring > Debug Logs).  In the case of a batch, if it occurs in the start method, the entire batch is aborted, while ' if it occurs during an execute function, only that single batch is aborted (but prior batches are already committed, and future batches may still successfully commit), and  in the finish method, a governor limit would prevent chaining calls, sending emails, etc.

Certificate Expiration notification : getting a self-assigned certificate expiration notification

In simple terms Self Signed Certificates are like false drivers licence .It provides security to a certain level but can be easily hacked but its still better than having nothing . Check this excellent  article Now why the certificates expired message exists is a mystery and there is a good blog with some  research  but its still a mystery but no harmful effects observed due to false positive.

How to make trigger bypass validation rules?

 Add a dummy checkbox field that is not visible to anyone.  Let the Validation Rule bypass the record if that checkbox is true. Now, in your trigger before you update oppsToUpdate, first update that dummy-Checkbox to true. In this way, the validation rule will be bypassed. Also, make sure you make the checkbox false as soon as the trigger does its action. In order to do this, you can create a workflow that will do the field update of that dummy checkbox to false whenever the value is true.

SALES FORCE ORDER OF EXECUTION

Triggers and Order of Execution When a record is saved with an insert, update, or upsert statement, the following events occur in order: 1. The original record is loaded from the database (or initialized for an insert statement) 2. The new record field values are loaded from the request and overwrite the old values 3. All before triggers execute 4. System validation occurs, such as verifying that all required fields have a non-null value, and running any user-defined validation rules 5. The record is saved to the database, but not yet committed 6. All after triggers execute 7. Assignment rules execute 8. Auto-response rules execute 9. Workflow rules execute 10. If there are workflow field updates, the record is updated again 11. If the record was updated with workflow field updates, before and after triggers fire one more time (and only one more time) 12. Escalation rules execute 13. All DML operations are committed to the database 14. Post-commit logic executes, such as sending

How to work around the 100 callout limitation?

Image
down vote accepted Create a batchable class, and do as many callouts as you need.  The 100 callout limit applies only to a single transaction, but Batchable classes can create millions of transactions.  You could do this: global class Do2999Callouts implements Database . Batchable < Integer > { global Iterable < Integer > start ( Database . BatchableContext context ) { Integer [] values = new Integer [ 0 ]; while ( values . size () < 2999 ) values . add ( values . size ()); return values ; } global void execute ( Database . BatchableContext context , Integer [] values ) { // Do one callout for each integer in values } global void finish ( Database . BatchableContext context ) { } } You would call this code using: Database . executeBatch ( new Do2999Callouts (), 100 ); Of course, this is only an arbitrary example. You could use smaller batch sizes, base them