• 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 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!!