saloni gupta
IndividualForum Replies Created
-
saloni gupta
MemberAugust 29, 2017 at 1:07 pm in reply to: how to set Button enable and disable modeHi Uday,
Use the folllowing code.
VF page:
<apex:page controller="buttonEnableCont">
<apex:form >
<apex:pageBlock id="fid">
<apex:selectList value="{!selectop}" multiselect="false" size="1" >
<apex:selectOptions value="{!select}" id="sid" >
</apex:selectOptions>
<apex:actionSupport event="onchange" action="{!checkValue}" />
</apex:selectList>
<apex:commandButton value="submit" disabled="{!if(sub!=false,false,true)}" onclick="alert({!sub})" action ="{!save}" immediate="true" />
</apex:pageBlock>
</apex:form>
</apex:page>apex class;
public class buttonEnableCont {
public string selectop{get;set;}
public boolean sub{get;set;}public buttonEnableCont(){
if(selectop=='hyd'||selectop=='che'||selectop=='bng'){
sub= true;
}else
sub=false;}
public List<SelectOption> getselect(){
List<SelectOption> so = new List<SelectOption>();
so.add(new SelectOption('-','none'));
so.add(new SelectOption('hyd','hyd'));
so.add(new SelectOption('che','che'));
so.add(new SelectOption('bng','bng'));return so;
}
public void save(){
system.debug('#########');
}
public void checkValue(){
if(selectop=='hyd'||selectop=='che'||selectop=='bng'){
sub= true;
}else
sub=false;
}}
-
saloni gupta
MemberAugust 23, 2017 at 6:01 am in reply to: what is the difference between external lookups and indirect lookups in Salesforce?External lookup relationship
External lookup relationship links a child standard, custom, or external object to a parent external object. The values of the standard External ID field on the parent external object are matched against the values of the external lookup relationship field. For a child external object, the values of the external lookup relationship field come from the specified External Column Name.
In External lookup relationship, External Object will be the parent.
Indirect lookup relationship
Indirect lookup relationship links a child external object to a parent standard or custom object. You select a custom unique, external ID field on the parent object to match against the child’s indirect lookup relationship field, whose values are determined by the specified External Column Name.
In Indirect lookup relationship, Salesforce standard or custom object will be the parent and External Object will be the child.
-
saloni gupta
MemberAugust 22, 2017 at 6:28 am in reply to: What is difference between Queues and Public Group and when do we use public group or Queues in Salesforce?Queue and groups are both are same ,which will hold group of users, But in working environment we can functionality we need to decide which will use in proper way,
Suppose in the case of Lead Assignment,
1 . Scenario like Each user should assigned to at least one lead and same number of leads.
That means user need to handle assigned lead individually and all users in organization should assigned with same number of leads, in this case we can define users in organization as Queue and assign them one by one and in same number using round robin lead assignment.In this case we can achieve above scenario.
2 . Suppose you need to Share some of the information in your organization among some users, in this we can define Group ,then we can share information or we assign some work to group.Here this is Group effort.
-
saloni gupta
MemberAugust 21, 2017 at 2:02 pm in reply to: State differences between Bearer and OAuth 2 tokens in Salesforce?Hi aman,
OAuth 2.0 Bearer Token profile brings a simplified scheme for authentication. This specification describes how to use bearer tokens in HTTP requests to access OAuth 2.0 protected resources. Any party in possession of a bearer token (a "bearer") can use it to get access to the associated resources (without demonstrating possession of a cryptographic key). To prevent misuse, bearer tokens need to be protected from disclosure in storage and in transport.
token_type is a parameter in Access Token generate call to Authorization server which essentially represents how an access_token will be generated and presented for resource access calls. You provide token_type in the access token generation call to an authorization server.
The access token type provides the client with the information required to successfully utilize the access token to make a protected resource request (along with type-specific attributes). The client must not use an access token if it does not understand the token type.
-
saloni gupta
MemberAugust 14, 2017 at 1:34 pm in reply to: How can I get all the Fields of an sObject in Salesforce apex class without hardcoding?Hi Mohit,
You can try this :-
string fields = '';
Map<String,Schema.SObjectField> fieldMap = Schema.SObjectType.Opportunity.fields.getMap();
for(String field : fieldMap.keySet())
{
fields += field + ', ';
}
System.debug('fiedsOpportunity=='+fields); -
saloni gupta
MemberAugust 9, 2017 at 2:28 pm in reply to: what is the difference between pageBlockTable and PanelGrid in Salesforce?hi aman,
apex:pageBlockTable represents a table formatted and styled to look like a related list table.
apex:panelGrid is placed into a corresponding cell in the first row until the number of columns is reached. At that point, the next component wraps to the next row and is placed in the first cell.
<apex:page>
<apex:panelGrid columns="3" id="theGrid">
<apex:outputText value="First" id="theFirst"/>
<apex:outputText value="Second" id="theSecond"/>
<apex:outputText value="Third" id="theThird"/>
<apex:outputText value="Fourth" id="theFourth"/>
</apex:panelGrid>
</apex:page>
-
saloni gupta
MemberAugust 9, 2017 at 2:15 pm in reply to: What is Text(Encrypted) Data type in Salesforce sobject?hi shariq,
Encrypted Custom Fields are a new field type (released after winter 08) that allows users to store sensitive data in encrypted form and apply a mask when the data is displayed.
Some important points :
User profiles who have the “View Encrypted Data” configuration enabled will be able to view the field normally.
Users who do not have the “View Encrypted Data” profile will see the mask.
User profiles that have the “Modify All Data” permission will not be able to see the value of encrypted data fields. -
saloni gupta
MemberAugust 4, 2017 at 6:55 am in reply to: How we get List of sibling Contact in a Salesforce Trigger?Hi Shubham,
You can refer this code for getting all the siblings of any contact.
Set<id> accid = new Set<id>();
for(Contact c : Trigger.old){
accid.add(c.AccountId);
}
List<contact> con = [select id, accountid, Start_Date__c, End_Date__c from contact where Account.Id in : accid AND Id not IN : Trigger.old];Map<id,List<Contact>> mapAccIdCont = new Map<id,List<Contact>>();
for(Contact c :con){
if(mapAccIdCont.containsKey(c.Accountid)){
List<Contact> conList = mapAccIdCont.get(c.AccountId);
conList.add(c);
mapAccIdCont.put(c.AccountId, conList);}
else{
List<Contact> conList = new List<Contact>();
conList.add(c);
mapAccIdCont.put(c.AccountId, conList);}
} -
hi shariq,
Setup objects are those which interacts with metadata like User, Profile, Layout etc. All other object (Standard and Custom) are non setup object.
One important note is that we cannot perform DMLs on setup and non setup objects in same transaction. Workaround is that you need to use asynchronous requests (@future) or use batch as it runs in its own system context.
In test class you can use Sytem.RunAs with two different users to separate out transactions for setup and non setup objects.
-
hi aman,
Streaming API is useful when you want notifications to be pushed from the server to the client based on criteria that you define. Consider the following applications for Streaming API:
Applications that poll frequently
Applications that have constant polling action against the Salesforce infrastructure, consuming unnecessary API calls and processing time, would benefit from Streaming API which reduces the number of requests that return no data.
General notification
Use Streaming API for applications that require general notification of data changes in an organization. This enables you to reduce the number of API calls and improve performance.- This reply was modified 7 years, 4 months ago by saloni gupta.
-
hi shubham,
If a test class contains a test setup method, the testing framework executes the test setup method first, before any test method in the class.
Records that are created in a test setup method are available to all test methods in the test class and are rolled back at the end of test class execution.
If a test method changes those records, such as record field updates or record deletions, those changes are rolled back after each test method finishes execution. The next executing test method gets access to the original unmodified state of those records.
Syntax;
@testSetup static void methodName() {
}
-
saloni gupta
MemberJuly 25, 2017 at 6:44 am in reply to: What must the Controller for a Salesforce VF page utilize to override the Standard Opportunity view button?Hi Adarsh,
You can refer this link
"When overriding buttons with a Visualforce page, you must use the standard controller for the object on which the button appears. For example, if you want to use a page to override the Edit button on accounts, the page markup must include the standardController="Opportunity" attribute on the <apex:page> tag"
-
Hi shiva,
try the plural name of child object in sub query.
-
saloni gupta
MemberJuly 24, 2017 at 4:53 am in reply to: What is Content version ??? How we get id of content version ???Hi shubham,
Content Version represents a specific version of a document in Salesforce CRM Content or Salesforce Files.
Query:-
select id, title from ContentVersion;
-
Junction Object in Salesforce is an Object it helps to maintain many-to-many relationship between two objects.
-
saloni gupta
MemberJuly 20, 2017 at 1:39 pm in reply to: What is the difference between object-specific actions and global actions in Salesforce?object specific actions:
Like global actions, object-specific actions let users create records or log details about calls or other interactions. The key difference is that you can only add these actions to record detail pages, since they are automatically associated with a specific object.
When a user creates a record by using an object-specific create action, a feed item for that record appears:
- In the feed for the record on which the new record was created
- As the first entry in the feed for the new record
- In the Chatter feed of the user who created the record
- In the user profile feed for the user who created the record
- In the Chatter feed of any users who follow the record on which the record was created
- In the Chatter feed of any users who, through custom triggers or auto-follow rules for new records, automatically follow the new record
Global actions:
Global actions let users create records, but the new record has no relationship with other records. And they’re called global actions because they can be put anywhere actions are supported—on record detail pages, but also places like the feed or Chatter groups.
-
saloni gupta
MemberJuly 19, 2017 at 1:43 pm in reply to: How to create custom clone button with product for Salesforce opportunity sobject?VF Page:
<apex:page standardController="Opportunity" extensions="oppExtension" tabStyle="opportunity">
<apex:form>
<apex:pageBlock title="Opportunity Edit">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
<apex:commandButton action="{!cancel}" value="Cancel" immediate="true"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Opportunity Information"><apex:inputField value="{!OpportunityCloned.owner.name}" label = "Opportunity Owner"/>
<apex:inputField value="{!OpportunityCloned.amount}"/>
<apex:inputField value="{!OpportunityCloned.isPrivate}"/>
<apex:inputField value="{!OpportunityCloned.CloseDate}"/>
<apex:inputField value="{!OpportunityCloned.name}"/>
<apex:inputField value="{!OpportunityCloned.NextStep}"/>
<apex:inputField value="{!OpportunityCloned.Accountid}"/>
<apex:inputField value="{!OpportunityCloned.StageName}"/>
<apex:inputField value="{!OpportunityCloned.Type}"/>
<apex:inputField value="{!OpportunityCloned.Probability}"/>
<apex:inputField value="{!OpportunityCloned.LeadSource}"/>
<apex:inputField value="{!OpportunityCloned.Campaignid}"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="Additional Information">
<apex:inputField value="{!OpportunityCloned.OrderNumber__c}"/>
<apex:inputField value="{!OpportunityCloned.MainCompetitors__c}"/>
<apex:inputField value="{!OpportunityCloned.CurrentGenerators__c}"/>
<apex:inputField value="{!OpportunityCloned.TrackingNumber__c}"/>
<apex:inputField value="{!OpportunityCloned.DeliveryInstallationStatus__c}"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="Description Information">
<apex:inputField value="{!OpportunityCloned.Description}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
<apex:relatedList list="OpportunityLineItems" />
<apex:relatedList list="OpenActivities" />
<apex:relatedList list="ActivityHistories" />
<apex:relatedList list="CombinedAttachments" />
<apex:relatedList list="OpportunityContactRoles" />
<apex:relatedList list="OpportunityPartnersFrom" />
<apex:relatedList list="OpportunityCompetitors" />
<apex:relatedList list="OpportunityHistories" />
</apex:page>Apex class:
public class oppExtension {
private ApexPages.StandardController controller {get;set;}
private opportunity opp{get;set;}
public Opportunity OpportunityCloned {get;set;}public oppExtension(ApexPages.StandardController controller){
this.controller = controller;
opp = (Opportunity)controller.getRecord();
opp = [select Id,owner.name,Accountid,Amount,CloseDate,Contractid,Description,OrderNumber__c,MainCompetitors__c,
CurrentGenerators__c,LeadSource,NextStep,Name,stageName,Ownerid,Campaignid,IsPrivate,Probability,
Type,DeliveryInstallationStatus__c,TrackingNumber__c from Opportunity where id =: opp.Id];
OpportunityCloned = opp.clone(false,true);}
public PageReference save() {
try {
insert(OpportunityCloned);
} catch(System.DMLException e) {
ApexPages.addMessages(e);
return null;
}
// After successful Save, navigate to the default view page
return new PageReference('/'+OpportunityCloned.id);}
}
-
saloni gupta
MemberJuly 19, 2017 at 1:24 pm in reply to: What is the difference between feed item and attachment in Salesforce?Feeditem : FeedItem represents an entry in the feed, such as changes in a record feed, including text posts, link posts, and content posts.
Attachment : Represents a file that a User has uploaded and attached to a parent object.
-
saloni gupta
MemberJuly 19, 2017 at 1:19 pm in reply to: What is the difference between apex command link and apex output link in Salesforce?Apex:outputLink – The <h:outputLink> renders a fullworthy HTML <a> element with the proper URL in the href attribute which fires a bookmarkable GET request. It cannot directly invoke a managed bean action method.
<apex:outputlink value="https://www.google.co.in"> Google </apex:outputlink>
<apex:outputlink value="/{!r.Id}"> {!r.Name} </apex:outputlink>
apex:commandLink – The <h:commandLink> renders a HTML <a> element with an onclick script which submits a (hidden) POST form and can invoke a managed bean action method. It's also required to be placed inside a <h:form>.
<apex:commandLink value="Google" action="https://www.google.co.in"/>
<apex:commandLink value="Delete" action="{!dodelete}">
<apex:param name="eid" value="{!E.Id}" assignTo="{!rId}"/>
</apex:commandLink> -
saloni gupta
MemberJuly 18, 2017 at 1:24 pm in reply to: Why do we use interface in Salesforce Apex Class?hi parv,
An interface is like a class in which none of the methods have been implemented, the method signatures are there, but the body of each method is empty. To use an interface, another class must implement it by providing a body for all of the methods contained in the interface.
public class InterfaceClass { //Lets consider a Bank trnasaction interface which indeed used by 3 banks BankA, BankB and BankC public Interface bankTransactionInterface { double deposit(); double withdrawal(); } //We have to implement the two methods declared in the interface for BankA public class BankA implements bankTransactionInterface { public double deposit() { //process the deposit double depositedAmount = 250; return depositedAmount ; } public double withdrawal() { //process the withdrawal double withdrawalAmount = 350; return withdrawalAmount ; } } //We will take another class for BankB and declare it as virtual as it is parent of BankC which has different deposit porcess but same withdrawal process as BankB. //For this we have to declare the deposit method as virtual and use override keyword when overriding it for BankC like showed below public virtual class BankB implements bankTransactionInterface { public virtual double deposit() { //process the deposit double depositedAmount = 450; return depositedAmount ; } public double withdrawal() { //process the withdrawal double withdrawalAmount = 1000; return withdrawalAmount ; } } public class BankC extends BankB { public override double deposit() { //process the deposit double depositedAmount = 750; return depositedAmount ; } } }
-
saloni gupta
MemberJuly 17, 2017 at 1:46 pm in reply to: What is the difference between Salesforce Batches and Queueable Apex?Batchable Interface
Complex long running processes (thousands of records)
- Asynchronous processing - Scheduled jobsQueueable Interface
When Batch and @future need to meet in the middle - Chaining jobs
- You need @future method with support for non-primitive types
- Asynchronous monitoring -
saloni gupta
MemberJuly 14, 2017 at 5:36 am in reply to: What is CSV (comma separated values) file in salesforce?CSV is a simple file format used to store tabular data, such as a spreadsheet or database. Files in the CSV format can be imported to and exported from programs that store data in tables. In salesforce when we want to import and export data, we use the csv file.
-
saloni gupta
MemberJuly 13, 2017 at 12:31 pm in reply to: can we execute two component in single Salesforce Lightning app ?? If yes, How ??hi shubham,
yes, we can execute more than one component in single Lightning App.
<aura:application >
<c:firstComponent /><c:secondComponent />
<c:ThirdComponent />
</aura:application> -
saloni gupta
MemberJuly 13, 2017 at 12:28 pm in reply to: Is it possible that two Salesforce objects can have same Id in different orgs?hello shariq,
ID differs according to environment. so it is not possible that two objects can have same id in different and same org.
-
saloni gupta
MemberJuly 13, 2017 at 12:22 pm in reply to: Why Governor Limits are introduced in Salesforcehello uday,
In Salesforce, everything for everybody is on Cloud. That means the database is not in your personal machine but on the cloud. So to allow everybody to avail the space in cloud Salesforce.com has to enfore Governer Limits.