• SKT CloudComputing
  • NEWBIE
  • 60 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 18
    Questions
  • 18
    Replies
I am writing a trigger which will check and prevent creation of  duplicate contatcs.
It's working fine for email but it's not checking Name .

trigger toCheckDuplicateRecord on Contact(before update,before insert) {

 List<Contact> Contactlst= new List<Contact>();
 Contactlst= [select Name,Email from Contact];
 for(Contact conobj:Contactlst)
 {
 for(Contact con:trigger.new){
    if(conobj.Email==con.Email || conobj.Name==con.Name)
    con.adderror('You can not enter this contact');
 }
 }
}

Please suggest.
 
1- Diff. between controller and Apex class?

2- any specific reason to use custome controller?


Can anyone help to understand these two concepts?

Thanks!
VF Page-

<!----------- Creating this page for dispaly Opportunity fields object in single table with check box ---------->

<apex:page controller="WrapperIntStringDisplayClass">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection >
                <apex:pageBlockTable value="{!lstwrapperIntString}" var="w">
                    <apex:column headervalue="click2Select">
                        <apex:inputcheckbox />
                    </apex:column>
                    <apex:column headervalue="Opportunity fields">
                        {!w.Id}
                        {!w.Name} 
                        {!w.Amount}                  
                    </apex:column>    
                </apex:pageBlockTable>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>


Apex Class-

public with sharing class WrapperIntStringDisplayClass {
    public List<wrapper> lstwrapperIntString {get;set;}
    
    public WrapperIntStringDisplayClass(){
        lstwrapperIntString = new List<wrapper>();
        for(opportunity opp : [select Id, Name,Amount from opportunity]){
            lstwrapperIntString.add(new wrapper(opp.Id,opp.Name,opp.Amount));
        }
    }
    //Wrapper Class Construction

    public class wrapper{
         public String Id{get;set;}
         public String Name{get;set;}
          public Double Amount{get;set;}
    // Wrapper class constructor
    public wrapper(String Id,String Name,Double Amount ){
        this.Id=Id;
        this.Name=Name;
        this.Amount=Amount;
        }  
    }
}

I am getting Below error-

[Error] Error: WrapperIntStringDisplayClass Compile Error: Constructor not defined: [WrapperIntStringDisplayClass.wrapper].<Constructor>(Id, String, Decimal) at line 7 column 37


Can anyone help in this.
I have below questions w.r.t. batch class.

1- What is batch apex class?

2- what are all  the methods defined in batch apex class?

3- what are the return types and syntaxes  of all methods of batch apex class?

4- when we need to go for batch apex class?


It would be a great help if anyone can shar one's own experience for these questions rather than sharing link of documents.

Thanks!
Hello All,

I am new to salesforce and gone through documentation. I ended with some queries as below-

1- What is default keyword?
2- If we do not write any keyword then what will happen?
3- If it run in by default mode then what is need for using 'without sharing' keyword.

Please provide some real exmaples (calling and called class format), it would be great help.


Thanks!


 
In how many ways we can achieve one-to -one relationship in salesforce.

Can anyone please explain with examples.
I want to know difference between  commandButton and pageBlockButton for interview purpose.

Please suggest some important difference not the salesforce's definition.


Thanks You!

SKT
What is Standard setcontroller?

What are the diffrences between standard controller and standard setcontroller?

I have gone through Salesfroce doc but did not get it.

Can anyone provide a general and understandable approcah.

Thanks
SKT
I am new to salesforce. I tried to use the standard list controller. I used teh belwo code but did not get any record on page.

Code-

<apex:page standardController="Account" recordSetVar="accounts" sidebar="false">
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable value="{!Accounts}" var="a">
<apex:column headerValue="Account Name"/>
<apex:outputField value="{!a.Name}"/>
</apex:pageBlockTable>
<apex:pageBlockButtons location="bottom" >
<apex:commandButton value="First" action="{!first}"/>
<apex:commandButton value="Last" action="{!last}"/>
<apex:commandButton value="Next" action="{!next}"/>
<apex:commandButton value="previous" action="{!previous}"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
I have below two queries regarding this.

Query1- How many API calls will be made in we insert 1 M records using Normal API.


Query2- How many API calls will be made in we insert 1 M records using Bulk API.

Query 3- Is there any fix formula to calculate API calls?

 
I would like to know how can I insert NULL values for a record through Data Loader in below two scenarios-

Scenario1- In case of Normal API

Scenario2- In case Bulk API


Can you please illustarte it with example. It will be a great help to understand it.

 
What is the prerequisite for creating a RD in salesforce...

 
What are differences b/w custome sales process and standard sales process.
What are the Audit Fields in Salesforce?

Why do we need these fields?

How can we create these fields?


Thanks!
I have set  Filed Tracking History for below three standard fields in Lead object.
Address
Company
Annual Revenue

After this I added "Lead History" related list to Lead(Sales) page layouts.

Whenever I am changing these 3 fields I am not able to check that "Lead History" list in Lead page.

Thanks!




 
Can someone explain the what? why? and when? about below jobs-

Scheduled Jobs
Apex Jobs
Bulk Data Load Jobs
I am new to SFDC. I have created a queue (Open Lead) in Admin User and assigned that queue to another user(XYZ).
I created a Lead Assignment rule  with criteria as below-
(Lead: Lead SourceEQUALSWeb) AND (Lead: Lead StatusEQUALSOpen - Not Contacted).

Now I created few lead records which met the above criteria. Then I log in to account of user -XYZ and open the Queue here but I am not able to see those leads in queue (in XYZ account)

Can someone help me to understand the practical approcah of Queue witha bove scenario.


 
I am writing a trigger which will check and prevent creation of  duplicate contatcs.
It's working fine for email but it's not checking Name .

trigger toCheckDuplicateRecord on Contact(before update,before insert) {

 List<Contact> Contactlst= new List<Contact>();
 Contactlst= [select Name,Email from Contact];
 for(Contact conobj:Contactlst)
 {
 for(Contact con:trigger.new){
    if(conobj.Email==con.Email || conobj.Name==con.Name)
    con.adderror('You can not enter this contact');
 }
 }
}

Please suggest.
 
1- Diff. between controller and Apex class?

2- any specific reason to use custome controller?


Can anyone help to understand these two concepts?

Thanks!
VF Page-

<!----------- Creating this page for dispaly Opportunity fields object in single table with check box ---------->

<apex:page controller="WrapperIntStringDisplayClass">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection >
                <apex:pageBlockTable value="{!lstwrapperIntString}" var="w">
                    <apex:column headervalue="click2Select">
                        <apex:inputcheckbox />
                    </apex:column>
                    <apex:column headervalue="Opportunity fields">
                        {!w.Id}
                        {!w.Name} 
                        {!w.Amount}                  
                    </apex:column>    
                </apex:pageBlockTable>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>


Apex Class-

public with sharing class WrapperIntStringDisplayClass {
    public List<wrapper> lstwrapperIntString {get;set;}
    
    public WrapperIntStringDisplayClass(){
        lstwrapperIntString = new List<wrapper>();
        for(opportunity opp : [select Id, Name,Amount from opportunity]){
            lstwrapperIntString.add(new wrapper(opp.Id,opp.Name,opp.Amount));
        }
    }
    //Wrapper Class Construction

    public class wrapper{
         public String Id{get;set;}
         public String Name{get;set;}
          public Double Amount{get;set;}
    // Wrapper class constructor
    public wrapper(String Id,String Name,Double Amount ){
        this.Id=Id;
        this.Name=Name;
        this.Amount=Amount;
        }  
    }
}

I am getting Below error-

[Error] Error: WrapperIntStringDisplayClass Compile Error: Constructor not defined: [WrapperIntStringDisplayClass.wrapper].<Constructor>(Id, String, Decimal) at line 7 column 37


Can anyone help in this.
I have below questions w.r.t. batch class.

1- What is batch apex class?

2- what are all  the methods defined in batch apex class?

3- what are the return types and syntaxes  of all methods of batch apex class?

4- when we need to go for batch apex class?


It would be a great help if anyone can shar one's own experience for these questions rather than sharing link of documents.

Thanks!
Hello All,

I am new to salesforce and gone through documentation. I ended with some queries as below-

1- What is default keyword?
2- If we do not write any keyword then what will happen?
3- If it run in by default mode then what is need for using 'without sharing' keyword.

Please provide some real exmaples (calling and called class format), it would be great help.


Thanks!


 
In how many ways we can achieve one-to -one relationship in salesforce.

Can anyone please explain with examples.
I want to know difference between  commandButton and pageBlockButton for interview purpose.

Please suggest some important difference not the salesforce's definition.


Thanks You!

SKT
I am new to salesforce. I tried to use the standard list controller. I used teh belwo code but did not get any record on page.

Code-

<apex:page standardController="Account" recordSetVar="accounts" sidebar="false">
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable value="{!Accounts}" var="a">
<apex:column headerValue="Account Name"/>
<apex:outputField value="{!a.Name}"/>
</apex:pageBlockTable>
<apex:pageBlockButtons location="bottom" >
<apex:commandButton value="First" action="{!first}"/>
<apex:commandButton value="Last" action="{!last}"/>
<apex:commandButton value="Next" action="{!next}"/>
<apex:commandButton value="previous" action="{!previous}"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
I have below two queries regarding this.

Query1- How many API calls will be made in we insert 1 M records using Normal API.


Query2- How many API calls will be made in we insert 1 M records using Bulk API.

Query 3- Is there any fix formula to calculate API calls?

 
I would like to know how can I insert NULL values for a record through Data Loader in below two scenarios-

Scenario1- In case of Normal API

Scenario2- In case Bulk API


Can you please illustarte it with example. It will be a great help to understand it.

 
I have set  Filed Tracking History for below three standard fields in Lead object.
Address
Company
Annual Revenue

After this I added "Lead History" related list to Lead(Sales) page layouts.

Whenever I am changing these 3 fields I am not able to check that "Lead History" list in Lead page.

Thanks!




 
I am new to SFDC. I have created a queue (Open Lead) in Admin User and assigned that queue to another user(XYZ).
I created a Lead Assignment rule  with criteria as below-
(Lead: Lead SourceEQUALSWeb) AND (Lead: Lead StatusEQUALSOpen - Not Contacted).

Now I created few lead records which met the above criteria. Then I log in to account of user -XYZ and open the Queue here but I am not able to see those leads in queue (in XYZ account)

Can someone help me to understand the practical approcah of Queue witha bove scenario.


 
Hello,

This is the trailhead questions which I am trying to solve :

Create an Apex class that returns an array (or list) of formatted strings ('Test 0', 'Test 1', ...). The length of the array is determined by an integer parameter.The Apex class must be called 'StringArrayTest' and be in the public scope.
The Apex class must have a public static method called 'generateStringArray'.
The 'generateStringArray' method must return an array (or list) of strings. Each string must have a value in the format 'Test n' where n is the index of the current string in the array. The number of returned strings is specified by the integer parameter to the 'generateStringArray' method.


Here is my code :

public class StringArrayTest {
    public static List <String> generateStringArray (Integer n) {
       List<String> List1 = new List<String> ();
        for(Integer i=0;i<n;i++) {
          List1.add('\'Test'+ i+'\'' );
  }
        System.debug(List1);
        return List1;
    } 

}


I am getting following error :

Challenge not yet complete... here's what's wrong: 
Executing the 'generateStringArray' method failed. Either the method does not exist, is not static, or does not return the proper number of strings.


I tried it many times but I am not able to solve this problem. Please help.