Skip to main content

Posts

Add/Remove Functionality in a VF page for Creating Multiple Records For a Particular Object.

Hi Guys This is a very simple post. I had come across a scenario where I was asked to develop some functionality where user can create list of records at a time(clicking on save button on one time) and can remove row. Here I have created a pageblock table and there I am displaying 5 rows to enter data and there column, Name , Phone and Action. In Action column Delete link is present.When that link(Delete) is clicked then particular row will be removed. Two button is there Add Row and Save. Add Row-->  When that button is clicked one more row will be created in the pagablock table Save--> It will save the record. Here is the page <apex:page controller="creatingListOfRecordsController">     <apex:form >              <apex:pageBlock title="Creating List Of Account Records">         <apex:pageMessages></apex:pageMessages>             ...

Encryption and Decryption In Salesforce.

Encryption , is the process of changing information in such a way as to make it unreadable by anyone except those possessing special knowledge (usually referred to as a "key") that allows them to change the information back to its original, readable form. To encrypt some value we have to use some key value that can be hard coded or we can generate key also by using this  Blob cryptoKey = Crypto.generateAesKey(256); We have to use same key to decrypt that value. Here I am going to share some code.Hope it will help you. I have created one visualforce page and one controller. In the page only one field(Name) is there and two button(Save & Update). When some value is entered in the name field and clicked on save button that value will be stored in the object encrypted format. Now record id in the url and click on update button encrypted value will be converted in to original format. Here is my page <apex:page standardController="EnCrypt_Decrypt__c" ...

Extend Feature Of Salesforce to Salesforce

Salesforce to Salesforce is a Force.com feature that lets you configure two Force.com environments (orgs) so that they share data records in real time. It is useful for those salesforce org who does business with partnership. While doing business It might required to share business data. if both org use salesforce then Salesforce to salesforce feature is easy to use for sharing data.  As name suggest only this feature(S2S) only  used by Salesforce Org.   How to use Salesforce to Salesforce ? Enable salesforce to salesforce features in both the Org.(Source Org and Target org) Create one Account and Contact in Source Org and provide email address(which is  associated with target salesforce org. ) Now Create a Connection record from tab list. Choose Contact Name(which you have just created ) Send invitation  Check mail, Activate connection Choose object whose record you want to send and Save it  Click on Edit link next to Object name in...

Navigating to Standard Layout(Tab, Edit layout,List Layout) Using Action Global Variable

$Action is a global variable.  A global merge field type to use when referencing standard  Salesforce  actions such as displaying the Accounts tab home page, creating new accounts, editing accounts, and deleting accounts. Here I am sharing some visualforce code for the same. <apex:page standardController="Account">        //Navigating to new record page of Account        <apex:outputLink value="{!URLFOR($Action.Account.New)}">                Creating New Account        </apex:outputLink>       //Navigating to Account list View        <apex:outputLink value="{!URLFOR($Action.Account.List, $ObjectType.Account)}">               Go to the Account List View       </apex:outputLink>       //Navigating to Account tab page   ...

Inline Editing is not available for a specific object

Inline editing is a handy bit of user friendliness,less time consuming and an efficient way of editing a value of a field from the detail page of a record OR from List View of records . Enabling inline editing is simple. We can enable from User Interface settings. Here an image where you can enable inline editing.  Go to the Set up-->Customize-->User Interface-- check  Enable Inline Editing check box. Now inline editing concept will not work for some object. Why is it not working for some object ? To  use inline editing concept then edit action of specific object should not overridden with any visual-force page. If the Edit action has been overridden for an object, Inline Editing will not be available for that object. To determine this: For standard objects : Go to Setup | Customize | <Object> | Buttons & Links, and note the "Overridden" checkbox next to the 'Edit' standard button. For custom objects: Go to Setup | Create | Objec...

How to get Picklist Value of an object Dynamically

This is very simple. I am sharing some code ,please go through this Here is My Controller  public class testclass {     public Job__c job{get;set;}     public List<SelectOption> options{get;set;}     public testclass(){         options = new List<SelectOption>();         Schema.DescribeFieldResult fieldResult = Job__c.Status__c.getDescribe();         List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();         for( Schema.PicklistEntry f : ple){                   options.add(new SelectOption(f.getLabel(), f.getValue()));         }     }         } My Page  <apex:page controller="testclass ">   <apex:form>       <apex:pageBlock>              ...

Sending Custom Object Information in a Mail

Sometimes we try to send some custom object information in mail. For sending mail Sales-force has  provided 4 types of email template. We can design the template as per our requirement. We can  use simple text template and use merge field to send custom object information. But that template  will work perfectly only If we use in the workflow.  If we send mail from apex code then that merge field value will not be displayed, except we can  display Lead ,Contact and User object information. For example  Dear {!Contact.Name} -- It will display Sub-- {!CustomObject.name}-- It will not display. This functionality is not yet activated by Sales-force, Here is an idea regarding same. https://success.salesforce.com/ideaView?id=08730000000BpYU Why not CustomObject information ? If we use the template in apex code (By using Messaging.SingleEmailmessage method) for sending mail then  setTargetObjectId(ID) method is require...