• Shubham Sengar
  • NEWBIE
  • 115 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 38
    Questions
  • 40
    Replies
how to create unique custom long text field in salesforce by trigger.?
creating a search page if entered record is found then give as mess record it exist if not then gives a New button to create New record ..

this code is works for search but when m trying to add new button its gives error......

<apex:page StandardController="Work_Order__c" extensions="Search" showheader="true" action="{!redirect}">
<apex:form >
   
            <apex:outputLabel >Enter The Work Order Number ::- </apex:outputLabel>
            
            
            <apex:inputText value="{!searchText}"/><br/>
             
            <apex:commandButton value="Search" Action="{!Search}"/><br/>
             <apex:commandButton value="New" Action="{!createNew}" rendered="{!showNew}"/>
             
             
           
           
           
            <apex:pageBlock >
            <apex:pageBlockSection >
            <apex:outputText >Message: {!msg}</apex:outputText>
             </apex:pageBlockSection> 
           
           
          </apex:pageBlock>
</apex:form>  
</apex:page>
controller............
public class Search
{   
    public String SearchText{get;set;}
    public Work_Order__c wo{get;set;}
    public string msg{get;set;}
    public boolean showNew { get; set;}
 
    public Search(ApexPages.StandardController controller)
     {
        showNew = false;
     }
 
   public void search()
    {
        List<Work_Order__c> wolist=[select id,name from Work_Order__c];
        for(Work_Order__c w:wolist)
        {
            if(w.name.containsIgnorecase(searchText))
            wo=w;                  
        }
        if(wo==null)
       {
            msg='Work Order Number Not Exist u can create New by given link below';
             showNew = true;
                         
        }
        else
        {
            msg='Work Order Number already Exist' ;
           showNew = true;
        }
    }
  
   public PageReference createRecord() {
 
        PageReference createPage=new ApexPages.StandardController(Work_Order__c);
 
        createPage.setRedirect(true);
 
      return createPage;
 
}
 }
 
1) How to send Dashboard to any User in Email to his/her Email id. 

2) how to create Dashboard which performe same thing Daly automatically.like leads Detail dashboard update day by day automatically
How to write a trigger to calculate all contact fee by particular class wise ...
like we have 5 class then first search how many student in every clsss particularly   (salesforce student =?)
 then give all fee detail 
Fee Paid Details = First Installment + Second Installment or Paid Full Fee
 ​where Fee Paid  Details is class object's field and remaning three like First Installment ,Second Installment , Paid Full Fee is Contact object's field..??

contact object connect with lookup with class object
How to connect vf with record type ..??

like ---- I have 2 record type in work order object ..
first one is -Change revision 
2nd is - Revision data 

when we select Change revision  it goes to vf and when we select 2nd  Revision data  its goes to standered page .
how to add New Button in VF search page.
like if our data is not found then a NEW Button there with the help of this button we can create new record 

my Search page works only m looking for NEW Button 


<apex:page StandardController="Work_Order__c" extensions="Search">
<apex:form >
   
            <apex:outputLabel >Enter The Work Order Number ::- </apex:outputLabel>
            
            
            <apex:inputText value="{!searchText}"/><br/>
            
            <apex:commandButton value="Search" Action="{!Search}"/><br/>
            
            <apex:pageBlock >
            <apex:pageBlockSection >
            
            <apex:outputText >Message: {!msg}</apex:outputText>
            </apex:pageBlockSection>
          </apex:pageBlock>
</apex:form>  
</apex:page>


Controller 

public class Search{
    
    public String SearchText{get;set;}
    public Work_Order__c wo{get;set;}
    public string msg{get;set;}
    

    public Search(ApexPages.StandardController controller)
     {

    }
    public void search()
    {
        List<Work_Order__c> wolist=[select id,name from Work_Order__c];
        for(Work_Order__c w:wolist)
        {
            if(w.name.containsIgnorecase(searchText))
            wo=w;                   
        }
        if(wo==null)
        {
            msg='Work Order Number Not Exist u can create New by given link below';
             
                        
        }
        else
        {
            msg='Work Order Number already Exist' ;
        }
    }
    }
 
 When u click on New Button (Account Page) its goes to A VF Page where 3 fiels like Account Name ,Account Number ,Account Phone No
 and one Save Button...............................
<apex:page standardController="Account">
  
     <apex:form >  
     <apex:pageBlock >    
     <apex:pageBlockButtons >
       <apex:commandButton value="Save" action="{!save}"/>
  <apex:commandButton action="{!cancel}" value="Cancel"/>
     </apex:pageBlockButtons>
   
   <apex:pageBlockSection title="Enter Account Details">        
          <apex:inputField value="{!Account.Name}"/>            
          <apex:inputField value="{!Account.accountNumber}"/> 
          <apex:inputField value="{!account.Phone}"/>
    </apex:pageBlockSection>
    </apex:pageBlock>
    </apex:form>
</apex:page>.........
 When u click on Save Button (VF Page) ​​it will goes to another new VF page Where Account Name Auto Populated With a ("Go To Contact") Button .......................
<apex:page standardController="Account" extensions="Contact">
<apex:form >
 <apex:pageBlock >
 <apex:pageBlockButtons >
 <apex:commandButton value="GoToContact" action="{!Contact1}"/>
 </apex:pageBlockButtons>
    <apex:pageBlockSection title="Account Details">
         <apex:outputField value="{!Account.Name}"/>
         <apex:outputField value="{!Account.accountNumber}"/> 
          <apex:outputField value="{!account.Phone}"/>
     </apex:pageBlockSection>
   </apex:pageBlock>
   </apex:form>
  </apex:page>

and class code is ..

public with sharing class Contact {
   public Account a{get; set;}
    public Contact(ApexPages.StandardController controller) {
       }
      string id =  Apexpages.currentpage().getParameters().get('id');
    public pagereference contact1()
    {
    PageReference requestPage = new pagereference('https://ap2.salesforce.com/003/o'+a);
        return page.contactpage.setredirect(true);
    }
 }

 When u click on "​Go To Contact" Button it will goes to contact detail page(custome vf page) where  Account Name ,Account Number ,Account Phone No will populated in new contact ..

Hear i am facing problem ....

<apex:page standardController="Contact" extensions="Contact">
  <apex:form >  
     <apex:pageBlock >    
     <apex:pageBlockButtons >
       <apex:commandButton value="Save" action="{!save}"/>
       
   </apex:pageBlockButtons>
       <apex:pageBlockSection title="Enter Contact Details">   
          <apex:inputField value="{!Contact.id}"/>   
            
         <apex:outputField value="{!contact.Account.Name}"/>
          <apex:inputField value="{!Contact.Name}"/>         
          <apex:inputField value="{!Contact.Phone}"/>   
        </apex:pageBlockSection>
      </apex:pageBlock>
    </apex:form>
  </apex:page>

n class code 
public with sharing class Contact {
   public Account a{get; set;}
    public Contact(ApexPages.StandardController controller) {
   
         
      }
      string id =  Apexpages.currentpage().getParameters().get('id');
    public pagereference contact1()
    {
    PageReference requestPage = new pagereference('https://ap2.salesforce.com/003/o'+a);
        return page.contactpage.setredirect(true);
    }
 }

 
Step 1:- When u click on New Button (Account Page) its goes to A VF Page where 3 fiels like Account Name ,Account Number ,Account Phone No
              and one Save Button
Step 2:- When u click on Save Button (VF Page) ​​it will goes to another new VF page Where Account Name Auto Populated With a ("Go To Contact") Button .
Step 3:- When u click on "​Go To Contact" Button it will goes to contact detail page where  Account Name ,Account Number ,Account Phone No will populated which we gave in Step 1.

in short New  Account And Contact page Created in these 3 Step​...
Create a 'Sales Team' as a related object to 'Lead'...So lead will be parent and Sales Team will be child.
Sales Team Fields : 
Team Member (Looup to user)
Role-(Lookup to role)
*  Write a SOQL Query to get the Team member and his role for particular lead     owner
*  Using data loader extract the same data what you are getting in SOQL Query.
*Write a SOQL query to 'Team member'= XYZ and the lead id='abc'
 
How to write a trigger to sum like
Fee Paid Details = First Installment + Second Installment or Paid Full Fee
 ​where Fee Paid  Details is class object's field and remaning three like First Installment ,Second Installment , Paid Full Fee is Contact object's field..??


 

when i am going to update leads status by using data loader then its gives erroe that is 
Please log an activity for this lead in order to select the "Actively Working" status. 
i never seen this type erroe ....any idea when these type errors coming??

Retrieve the first 10 rows of a account??

Retrieve the next 10 rows, 11 through 21 ??
Show all the  opportunity IDs for all contacts whose Leadsource is not Web???
Show all the account IDs that have open opportunities if the last name of the contact associated with 

the account is like the last name “Apple”:??
Show all the Account records in alphabetical order by first name, sorted in descending order, with 

accounts that have null names appearing last:??
Get all accounts that do not have any open opportunities by soql code??
Get all contacts for accounts that have an opportunity with a particular record type.??
By SOQL
Give me a count of  the contacts for an Account Like 123??

SELECT Name,Id (SELECT count() FROM Contact) FROM Account WHERE Name like '%123%'
but its gives error..

Give me a list of all the case with status ‘new’ with their contact name and account name.??
Give me a list of all the opportunities with stage name ‘Prospecting’ with their account name??



select name(select id from Account) from Opportunity where StageName='Prospecting'

but it gives error ..
select name,(select name from Account__r) from Opportunity where
                              ^
ERROR at Row:1:Column:31
Didn't understand relationship 'Account__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.

Retrieve the first 10 rows of a account??

Retrieve the next 10 rows, 11 through 21 ??
How to connect vf with record type ..??

like ---- I have 2 record type in work order object ..
first one is -Change revision 
2nd is - Revision data 

when we select Change revision  it goes to vf and when we select 2nd  Revision data  its goes to standered page .
how to add New Button in VF search page.
like if our data is not found then a NEW Button there with the help of this button we can create new record 

my Search page works only m looking for NEW Button 


<apex:page StandardController="Work_Order__c" extensions="Search">
<apex:form >
   
            <apex:outputLabel >Enter The Work Order Number ::- </apex:outputLabel>
            
            
            <apex:inputText value="{!searchText}"/><br/>
            
            <apex:commandButton value="Search" Action="{!Search}"/><br/>
            
            <apex:pageBlock >
            <apex:pageBlockSection >
            
            <apex:outputText >Message: {!msg}</apex:outputText>
            </apex:pageBlockSection>
          </apex:pageBlock>
</apex:form>  
</apex:page>


Controller 

public class Search{
    
    public String SearchText{get;set;}
    public Work_Order__c wo{get;set;}
    public string msg{get;set;}
    

    public Search(ApexPages.StandardController controller)
     {

    }
    public void search()
    {
        List<Work_Order__c> wolist=[select id,name from Work_Order__c];
        for(Work_Order__c w:wolist)
        {
            if(w.name.containsIgnorecase(searchText))
            wo=w;                   
        }
        if(wo==null)
        {
            msg='Work Order Number Not Exist u can create New by given link below';
             
                        
        }
        else
        {
            msg='Work Order Number already Exist' ;
        }
    }
    }
 
 When u click on New Button (Account Page) its goes to A VF Page where 3 fiels like Account Name ,Account Number ,Account Phone No
 and one Save Button...............................
<apex:page standardController="Account">
  
     <apex:form >  
     <apex:pageBlock >    
     <apex:pageBlockButtons >
       <apex:commandButton value="Save" action="{!save}"/>
  <apex:commandButton action="{!cancel}" value="Cancel"/>
     </apex:pageBlockButtons>
   
   <apex:pageBlockSection title="Enter Account Details">        
          <apex:inputField value="{!Account.Name}"/>            
          <apex:inputField value="{!Account.accountNumber}"/> 
          <apex:inputField value="{!account.Phone}"/>
    </apex:pageBlockSection>
    </apex:pageBlock>
    </apex:form>
</apex:page>.........
 When u click on Save Button (VF Page) ​​it will goes to another new VF page Where Account Name Auto Populated With a ("Go To Contact") Button .......................
<apex:page standardController="Account" extensions="Contact">
<apex:form >
 <apex:pageBlock >
 <apex:pageBlockButtons >
 <apex:commandButton value="GoToContact" action="{!Contact1}"/>
 </apex:pageBlockButtons>
    <apex:pageBlockSection title="Account Details">
         <apex:outputField value="{!Account.Name}"/>
         <apex:outputField value="{!Account.accountNumber}"/> 
          <apex:outputField value="{!account.Phone}"/>
     </apex:pageBlockSection>
   </apex:pageBlock>
   </apex:form>
  </apex:page>

and class code is ..

public with sharing class Contact {
   public Account a{get; set;}
    public Contact(ApexPages.StandardController controller) {
       }
      string id =  Apexpages.currentpage().getParameters().get('id');
    public pagereference contact1()
    {
    PageReference requestPage = new pagereference('https://ap2.salesforce.com/003/o'+a);
        return page.contactpage.setredirect(true);
    }
 }

 When u click on "​Go To Contact" Button it will goes to contact detail page(custome vf page) where  Account Name ,Account Number ,Account Phone No will populated in new contact ..

Hear i am facing problem ....

<apex:page standardController="Contact" extensions="Contact">
  <apex:form >  
     <apex:pageBlock >    
     <apex:pageBlockButtons >
       <apex:commandButton value="Save" action="{!save}"/>
       
   </apex:pageBlockButtons>
       <apex:pageBlockSection title="Enter Contact Details">   
          <apex:inputField value="{!Contact.id}"/>   
            
         <apex:outputField value="{!contact.Account.Name}"/>
          <apex:inputField value="{!Contact.Name}"/>         
          <apex:inputField value="{!Contact.Phone}"/>   
        </apex:pageBlockSection>
      </apex:pageBlock>
    </apex:form>
  </apex:page>

n class code 
public with sharing class Contact {
   public Account a{get; set;}
    public Contact(ApexPages.StandardController controller) {
   
         
      }
      string id =  Apexpages.currentpage().getParameters().get('id');
    public pagereference contact1()
    {
    PageReference requestPage = new pagereference('https://ap2.salesforce.com/003/o'+a);
        return page.contactpage.setredirect(true);
    }
 }

 
Step 1:- When u click on New Button (Account Page) its goes to A VF Page where 3 fiels like Account Name ,Account Number ,Account Phone No
              and one Save Button
Step 2:- When u click on Save Button (VF Page) ​​it will goes to another new VF page Where Account Name Auto Populated With a ("Go To Contact") Button .
Step 3:- When u click on "​Go To Contact" Button it will goes to contact detail page where  Account Name ,Account Number ,Account Phone No will populated which we gave in Step 1.

in short New  Account And Contact page Created in these 3 Step​...
Create a 'Sales Team' as a related object to 'Lead'...So lead will be parent and Sales Team will be child.
Sales Team Fields : 
Team Member (Looup to user)
Role-(Lookup to role)
*  Write a SOQL Query to get the Team member and his role for particular lead     owner
*  Using data loader extract the same data what you are getting in SOQL Query.
*Write a SOQL query to 'Team member'= XYZ and the lead id='abc'
 
How to write a trigger to sum like
Fee Paid Details = First Installment + Second Installment or Paid Full Fee
 ​where Fee Paid  Details is class object's field and remaning three like First Installment ,Second Installment , Paid Full Fee is Contact object's field..??


 

Give me all the duplicate accounts for an Account 123??

Select  count(id)
from Account
Where Name = 123
Group by Name
Having Count(id) > 1


its give error..
 
before we insert a new record in the customer object calculate the tax field value based on salary field value and then insert??

How i reach the right code ..??
write a trigger will prevent user from creating a lead that already existing as a contact .?
hint:: we will use leads/contacts email address to detact duplicates
To update the owner of a case based on the values selected with in a picklist and papulate the owner field with the creaded by the field data when we have seleted any field name = status..?? 
Hi Everyone..

I have tried enabling Lightning Component by referring to lightning Quick Start guide at https://developer.salesforce.com/resource/pdfs/Lightning_QuickStart.pdf
 
I am stucked at step 3. I am unable to see Lightning Components under Develope. Can someone help me out if I am missing anything here.

 Thanks You!!