• ra1
  • NEWBIE
  • 115 Points
  • Member since 2013

  • Chatter
    Feed
  • 3
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 36
    Replies
I think Salesforce has replaced DEV501 by a new certification.
Can you please let me know what it is. I am having DEV401 and need to get a certification that is equivalent to DEV501.
Could you also send me materials to study.
Thanks a lot.
 
HI,

I have this class

public class OpportunityContactRoleController {
    
    public Id contRoleId {get; set;}
    public Id oppId;
    public Opportunity oppObj;
    public ApexPages.StandardController controller {get; set;}
    

    public List<OpportunityContactRole> oppContRoles {get; set;}
    
    public OpportunityContactRoleController(ApexPages.StandardController controller){
        this.oppObj = (Opportunity)controller.getRecord();
        oppId = this.oppObj.Id;
        
        oppContRoles = [SELECT Id,OpportunityId, Contact.Name, Contact.Email, Role, Contact.Account.Name, Contact.Phone, IsPrimary
                            FROM OpportunityContactRole WHERE OpportunityId = :((Opportunity)controller.getRecord()).Id];
        
    }
    
    public void deleteOppContRole(){
        if(contRoleId != null){
        OpportunityContactRole ocr = new OpportunityContactRole();
        ocr.Id = contRoleId;
        delete ocr;
        oppContRoles = new List<OpportunityContactRole>();
        
        oppContRoles = [SELECT Id,OpportunityId, Contact.Name, Contact.Email, Role, Contact.Account.Name, Contact.Phone, IsPrimary
                            FROM OpportunityContactRole WHERE OpportunityId = :((Opportunity)controller.getRecord()).Id];
        }
        
    }
    
   public pageReference primaryContact() {
     
       PageReference pageRef = Page.OpportunityPrimaryContact;
       pageRef.getParameters().put('Id', oppId);
       pageRef.setRedirect(true);
       
       return pageRef;
   }
    
}



Test Class :


@isTest
public class OpportunityContactRoleController_Test {
    
    private static testMethod void testData(){
        
 
        Account testAccount = new Account(Name = 'Test Account', Country__c = 'Denmark');
        insert testAccount;
        
     
        Contact testContact = new Contact(LastName = 'Test LastName', FirstName = 'Test LastName');
        insert testContact;
        

        Opportunity testOpportunity = new Opportunity(AccountId = testAccount.Id, Name = 'Test Opportunity', Country__c = 'Denmark', 
                                                      
                                                      CurrencyIsoCode = 'USD', StageName = 'Loan Current', CloseDate = date.today(), Days_In_Term__c = 2 );
        insert testOpportunity;
        

        OpportunityContactRoleController controller = new OpportunityContactRoleController(new ApexPages.StandardController(testOpportunity));
  
        controller.primaryContact();

        OpportunityContactRole ocr = new OpportunityContactRole(OpportunityId = testOpportunity.Id, ContactId = testContact.Id );
        insert ocr;
        
       
        controller.contRoleId = ocr.Id;
        controller.deleteOppContRole();
        
}
}



when I run the test class it fails and returns like this.


Class.OpportunityContactRoleController.deleteOppContRole: line 30, column 1
Class.OpportunityContactRoleController_Test.testData: line 33, column 1

System.NullPointerException: Attempt to de-reference a null object


Any Idea which returns a Null?

Apologies Still a newbiew in this
Hi, 

 Created a controler as mentioned below

Class
public with sharing class storelookup{

   public Asset GetReseller{get;set;}
  
   public void processSelected() {
     
        SUDHIR__c  TempAssetList = new  SUDHIR__c();
      
       TempAssetList.test__c = GetReseller.AccountId;
      
       Insert TempAssetList;
   
   }

}


Visual Force Page
<apex:page Controller="storelookup">

   <apex:form >
   <apex:pageBlock >
     <apex:inputField value="{!GetReseller.AccountId}"/>
     <apex:pageBlockButtons >
                <apex:commandButton value="Save Records" action="{!processSelected}"/>
            </apex:pageBlockButtons>
            </apex:pageBlock>
   </apex:form>
</apex:page>


I am getting below error message please suggest me how to fix

Visualforce Error
Help for this Page

System.NullPointerException: Attempt to de-reference a null object
Error is in expression '{!processSelected}' in component <apex:commandButton> in page storelookup

Class.storelookup.processSelected: line 9, column 1
Hi,

I am working on one integration requirement which uses XML over HTTP. Here I am using DOM writer to generate the XML. Everything works fine except I am not able to add DOCType statement within it. wondering if someone can help me on this.
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE ROOT_TAG SYSTEM 'http://<server address>/<DTD file name>.dtd'>
<ROOT_TAG attribute1='1.0'>
...
</ROOT_TAG>


As of now, I am adding this DOCType using String replace method (generate XML and then use replace to inject extra line i.e. DOCType. But I would like to go with proper/inbuild solution.
 
  • March 12, 2015
  • Like
  • 0
Hi,

I am trying to create a publisher action on Account using custom VF page as content source. This page simply creating contact associated with this account. Below is my code :
<apex:page standardController="Account" extensions="CreateNewContact_Mobile_VFCExt" showHeader="false" sidebar="false" standardStylesheets="true">
    <apex:form>
        <apex:commandButton action="{! createContact}" value="Save"/>
        <br/>
        <apex:outputLabel for="ContactFName">First Name: </apex:outputLabel>
        <apex:inputField value="{! newContact.FirstName}" id="ContactFName"/>
        <br/>
        <apex:outputLabel for="ContactLastName">Last Name: </apex:outputLabel>
        <apex:inputField value="{! newContact.LastName}" id="ContactLastName"/>
        <br/>
        <apex:outputLabel for="AccountId">Account : </apex:outputLabel>
        <apex:inputField value="{! newContact.AccountId}" id="AccountId"/>
    </apex:form>
</apex:page>

And my controller looks like :

public with sharing class CreateNewContact_Mobile_VFCExt {
    public Contact newContact {set; get;}

    public CreateNewContact_Mobile_VFCExt(ApexPages.StandardController controller) {

        String accId = ApexPages.currentPage().getParameters().get('id');
        newContact = new Contact();
        newContact.AccountId = accId;
    }

    public void createContact(){
        try {
            insert newContact;
            System.debug('@@ Successfully created new contact' + newContact.id);
        } catch(DMLException e) {
            System.debug('@@ Error while creating new contact : ' + e.getMessage());
        }
    }
}


I edited by Account Page Layout and added this publisher action.  
After this I am able to see newly added publisher action and everything works fine on Web but on mobile (i.e. Salesforce1) lookup link is not working.

Also, if I set "standardStylesheets" as FALSE then "lookup" icon is not comming too. 
Please suggest.

Thanks,
  • April 14, 2014
  • Like
  • 0
Hi All,

I am very new to Salesforce1 and currently working on one POC. Here I created one Object-Specific Action (using  custom VF Page) on "Account" object. This VF page will all list of Case RecordType name (just like regular record type selection page) with some custom filtering.

On selecting appriopriate Case' RT, I have to redirect user to Case creation page with prepost Account value, below is my sample code 

Please guide me, below is my code.

Thanks in advance!!

<script>
          function createServiceTicket() {
              var e = document.getElementById("{!$Component.form.CaseRecordTypeSelect}");
              var caseSelected = e.options[e.selectedIndex].value;
             
              var caseMainRT = '012i0000001IP0t';
              var caseSecondRT = '012i0000001IP0y';
             
              var selectedRT = null;
              if(caseSelected == 'Second RT') {
                  selectedRT = caseSecondRT;
              } else {
                  selectedRT = caseMainRT;
              }
             
              sforce.one.createRecord("case", selectedRT);
        }
      </script>

<apex:form id="form">
    <apex:outputPanel id="FormPanel">
        <apex:outputLabel >Select Service Ticket Type</apex:outputLabel>
        <apex:selectList value="{!selectType}" size="1" id="CaseRecordTypeSelect">
            <apex:selectOptions value="{!serviceTktTypeItems}"></apex:selectOptions>
        </apex:selectList>
    </apex:outputPanel>
    <section class="data-capture-buttons one-buttons">
    <div class="content">
        <section class="data-capture-buttons one-buttons">
             <a href="#" id="createServiceTicket" onClick="createServiceTicket();" style="text-transform: none;" >Proceed</a>
        </section>
    </div>
    </section>
</apex:form>
  • April 03, 2014
  • Like
  • 1

Hi,

 

In standard reports, we can export complete records in CSV / excel format (using "Export Details" button). My requirement is to limit out total number of exported records to first 2500 records (instead of all records). This limitation should work with all reports.

 

I doubt, Salesforce have any configure option for this, please correct me if I am wrong. What can be alternative options for me. Please guide.

 

Thanks in advance!! 

 

  • October 30, 2013
  • Like
  • 0

Hi All,

 

I am trying to generate PDF Attachment within Apex class by using below mention code  :

 

public class CssNotWorkingWithPdfVFC {
    
    public static void generatePdf() {
        String pdfHtml = 
        ' <HTML> '+
            ' <HEAD> '+
                ' <STYLE type="text/css"> '+
                    ' body { font-family: \'Arial Unicode MS\'; } ' + 
                    ' .companyName { font: bold 30px; color: red; }  ' +
                    ' @page { size:landscape; } ' +
                ' </STYLE> ' +
            ' </HEAD> ' + 
            ' <BODY> ' +           
                ' <CENTER> ' + 
                    ' <TABLE> ' + 
                        ' <TR> ' + 
                            ' <TD>Company Name</TD> ' + 
                            ' <TD class="companyName">Test generating PDF in SALESFORCE</TD> ' + 
                        ' </TR> ' + 
                    ' </TABLE> ' + 
                ' </CENTER> ' + 
            ' </BODY> ' + 
        ' </HTML> ';
        
        System.debug('@@ ' + pdfHtml);
        
        Id recordId = 'a099000000JyF9i';
        String pdfName = 'TestCssInPdf.pdf';
        
        try {
            System.debug('@@ Generating PDF attachment ');
            Attachment attachmentPDF = new Attachment();
            attachmentPDF.parentId = recordId;
            attachmentPDF.Name = pdfName;
            attachmentPDF.body = Blob.toPDF(pdfHtml );
            insert attachmentPDF;

            System.debug('@@ Successfully generated PDF attachment ');                
        } catch(Exception e) {
            System.debug('@@## Error : ' + e.getMessage());
        }
    }
}

 

Here PDF attachment is creating successfully but without any CSS effects. Whereas If I tried to use same HTML in VF page (by using renderAs="pdf") CSS will work perfectly. below is sample code :

<apex:page showHeader="false" applyHtmlTag="false" applyBodyTag="false" standardStylesheets="false" renderAs="pdf" >
    <HTML>
        <HEAD>
            <STYLE> 
                body { font-family: 'Arial Unicode MS'; }
                .companyName { font: bold 30px; color: red; }  
                @page { size:landscape; }
            </STYLE>
        </HEAD>
        
        <BODY>
            <CENTER>
                <TABLE>
                    <TR>
                        <TD>Company Name</TD>
                        <TD class="companyName">Test generating PDF in SALESFORCE</TD>
                    </TR>
                </TABLE>
            </CENTER>
        </BODY>
    </HTML>
</apex:page>

 

I am unable to figureout the root cause and need your expert help on same.

Thanks in advance !!

 

 

 

 

  • October 22, 2013
  • Like
  • 0
Hi All,

I am very new to Salesforce1 and currently working on one POC. Here I created one Object-Specific Action (using  custom VF Page) on "Account" object. This VF page will all list of Case RecordType name (just like regular record type selection page) with some custom filtering.

On selecting appriopriate Case' RT, I have to redirect user to Case creation page with prepost Account value, below is my sample code 

Please guide me, below is my code.

Thanks in advance!!

<script>
          function createServiceTicket() {
              var e = document.getElementById("{!$Component.form.CaseRecordTypeSelect}");
              var caseSelected = e.options[e.selectedIndex].value;
             
              var caseMainRT = '012i0000001IP0t';
              var caseSecondRT = '012i0000001IP0y';
             
              var selectedRT = null;
              if(caseSelected == 'Second RT') {
                  selectedRT = caseSecondRT;
              } else {
                  selectedRT = caseMainRT;
              }
             
              sforce.one.createRecord("case", selectedRT);
        }
      </script>

<apex:form id="form">
    <apex:outputPanel id="FormPanel">
        <apex:outputLabel >Select Service Ticket Type</apex:outputLabel>
        <apex:selectList value="{!selectType}" size="1" id="CaseRecordTypeSelect">
            <apex:selectOptions value="{!serviceTktTypeItems}"></apex:selectOptions>
        </apex:selectList>
    </apex:outputPanel>
    <section class="data-capture-buttons one-buttons">
    <div class="content">
        <section class="data-capture-buttons one-buttons">
             <a href="#" id="createServiceTicket" onClick="createServiceTicket();" style="text-transform: none;" >Proceed</a>
        </section>
    </div>
    </section>
</apex:form>
  • April 03, 2014
  • Like
  • 1
I want the users to be able to  click on the value in the column and be redirected to the opportunity product record, Any suggestions please? 

<apex:column >
             <apex:outputLink value="https://XXXXXX.salesforce.com/?id={opportunity.OpportunityLineItems}">{!item.product2.name}</apex:outputLink>
            </apex:column> 
I have a custom buttom, that is called "Create Sales Order". I want it to update to Processing unless one of the below else if statements is valid. The issue is, my error message displays but then still changes the Stage to Processing. Can you help me understand what I'm missing to prevent this from happening? 

Thanks!


{!REQUIRESCRIPT("/soap/ajax/23.0/connection.js")} 

try { 
var url = parent.location.href; 
var updateRecords = []; 
var update_Opportunity = new sforce.SObject("Opportunity"); 
update_Opportunity.Id ="{!Opportunity.Id}"; 
update_Opportunity.StageName = "Processing"; 
updateRecords.push(update_Opportunity); 

result = sforce.connection.update(updateRecords); 

if ("{!Opportunity.Sales_Order__c}" == true) { 

alert("Your request to create an ERP sales order has already been submitted."); 



else if ( !result[0].getBoolean("success") ) { 

var errors = result[0].errors; 
var errorMessages = errors.message; 
alert( errorMessages ); // display all validation errors 


else if ("{!Opportunity.Account_Order_Ready__c}" == false) { 

alert("The related account is not order ready. Your sales order request will not be processed."); 


else if ("{!Opportunity.StageName}" == 'Approved Prebook') { 

alert("This opportunity must be approved by your inside rep to proceed"); 



else { 
alert("Your request has been submitted") 

parent.location.href = url; 

} catch (e) { 
alert 
}
Hello,

I am trying to use the Report and Dashboard API to run a report from apex using the mechanism explained here https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_analytics_run_reports.htm

When I try to save this however I am getting the error Error: Compile Error: Invalid type: Reports.ReportInstance. I am unsure why this error is coming up. I have checked the documentation with no help. Is there some setting that needs to be enabled in the org?
I think Salesforce has replaced DEV501 by a new certification.
Can you please let me know what it is. I am having DEV401 and need to get a certification that is equivalent to DEV501.
Could you also send me materials to study.
Thanks a lot.
 
HI,

I have this class

public class OpportunityContactRoleController {
    
    public Id contRoleId {get; set;}
    public Id oppId;
    public Opportunity oppObj;
    public ApexPages.StandardController controller {get; set;}
    

    public List<OpportunityContactRole> oppContRoles {get; set;}
    
    public OpportunityContactRoleController(ApexPages.StandardController controller){
        this.oppObj = (Opportunity)controller.getRecord();
        oppId = this.oppObj.Id;
        
        oppContRoles = [SELECT Id,OpportunityId, Contact.Name, Contact.Email, Role, Contact.Account.Name, Contact.Phone, IsPrimary
                            FROM OpportunityContactRole WHERE OpportunityId = :((Opportunity)controller.getRecord()).Id];
        
    }
    
    public void deleteOppContRole(){
        if(contRoleId != null){
        OpportunityContactRole ocr = new OpportunityContactRole();
        ocr.Id = contRoleId;
        delete ocr;
        oppContRoles = new List<OpportunityContactRole>();
        
        oppContRoles = [SELECT Id,OpportunityId, Contact.Name, Contact.Email, Role, Contact.Account.Name, Contact.Phone, IsPrimary
                            FROM OpportunityContactRole WHERE OpportunityId = :((Opportunity)controller.getRecord()).Id];
        }
        
    }
    
   public pageReference primaryContact() {
     
       PageReference pageRef = Page.OpportunityPrimaryContact;
       pageRef.getParameters().put('Id', oppId);
       pageRef.setRedirect(true);
       
       return pageRef;
   }
    
}



Test Class :


@isTest
public class OpportunityContactRoleController_Test {
    
    private static testMethod void testData(){
        
 
        Account testAccount = new Account(Name = 'Test Account', Country__c = 'Denmark');
        insert testAccount;
        
     
        Contact testContact = new Contact(LastName = 'Test LastName', FirstName = 'Test LastName');
        insert testContact;
        

        Opportunity testOpportunity = new Opportunity(AccountId = testAccount.Id, Name = 'Test Opportunity', Country__c = 'Denmark', 
                                                      
                                                      CurrencyIsoCode = 'USD', StageName = 'Loan Current', CloseDate = date.today(), Days_In_Term__c = 2 );
        insert testOpportunity;
        

        OpportunityContactRoleController controller = new OpportunityContactRoleController(new ApexPages.StandardController(testOpportunity));
  
        controller.primaryContact();

        OpportunityContactRole ocr = new OpportunityContactRole(OpportunityId = testOpportunity.Id, ContactId = testContact.Id );
        insert ocr;
        
       
        controller.contRoleId = ocr.Id;
        controller.deleteOppContRole();
        
}
}



when I run the test class it fails and returns like this.


Class.OpportunityContactRoleController.deleteOppContRole: line 30, column 1
Class.OpportunityContactRoleController_Test.testData: line 33, column 1

System.NullPointerException: Attempt to de-reference a null object


Any Idea which returns a Null?

Apologies Still a newbiew in this
Hi,

I am trying to implemet bubble sort, but i am getting error. Below is my  code.
public class bubbleSort {
    List<Integer> values = new List<Integer>{10,9,8,7,6,5,4,3,2,1};
    
        integer i = 0;
        integer iterationsize = values.size();
    
                for(i=0; i < iterationsize; i++)
                {
                   boolean swapped = false;
                   for(integer j = 0;j < iterationsize; j++)
                   {
                       if( i + 1 == values.size()) break;
                       if(values.get(i) > values.get(i + 1))
                       {
                             integer swapVal = values.get(j);
                            swapped = true;
                               values.set(j, values.get(j+1));
                            values.set(j+1,swapVal);
                           }
                        System.debug('Iterations List=='JSON.serialize(values));
                   }
                   iterationSize--;
              System.debug('SWAPPED =='+swapped);
              System.debug(JSON.serialize(values));
              if(!swapped) {i=values.size();}
           }
 System.debug('Final List of values=='+ JSON.serialize(values));
}


Error: @ line 7: expecting right curly bracket, found 'for'

Thanks in advance
As I can see the view hierarchy option beside Account Name field. Can I create something similar of that kind besides my OwnerAccount field. As my OwnerAccount will be having multiple records. If I can establish view hierarchy option it will easy to see the hierarchy. Any insights would be appreciated.

User-added image
Hi, 

Can anyone tell me the query to get the same results from “View All Notes & Attachments” page?
The idea is to find the object that saves the attached files in a comment chatter.
Nowadays if you put one attach on a comment you cannot find them by query.
 
Best regards,
Hugo Costa
Hi,
I'd like to set up the email notification for the task update. Once the Comments or Status field in the existing task has been updated by someone else, it can trigger the email notification to send to the task owner. Can it be done by the Apex Coding? 
I have a custom object that has an email field. I would like to either, show the email matches the email field in the lead record or if it's possible not show the field at all if it does match. Sometimes people use a different email to join a webinar than whats in the record

Thanks!
I've got 70% coverage and don't understand how to write a test that will check the Event created when the Asset is updated.
Lines that are NOT covered by my current test will be appended with /* not covered */
 
/*  
/* 
/* Create an Event when Asset is Migrated
/* 
/* */

public class CreateEvent{
    public static void newCompanyEvent(Asset[] asid){
        String strAccountSite=null;  // Account.Site field value
        Id conId=null; 
        Id assId=null; 
        Id accId=null; 
        Id recId='01270000000DtPb'; 
        Id ownId='00570000001fIep'; 
        
        Datetime dtTargetDateTime=datetime.now();  // Target date/time for Event
       // dtTargetDateTime=dtTargetDateTime.addDays(365); 
        Date dtTargetDate=dtTargetDateTime.date();  // Target date for Event
		Map<Id, String> assSiteMap = new Map<Id, String>();  
        for (Asset a:asid){
            assSiteMap.put(a.AccountId, null); /* not covered */
        }
        
        List<Account> accList = new List<Account>([SELECT Id, Site FROM Account 
                                                  WHERE Id IN: assSiteMap.keyset()]); 
        for(Account ac:accList){
            assSiteMap.put(ac.id, ac.Site);  /* not covered */
        }
        
        List<Event> ev = new List<Event>();
        
        for (Asset a:asid){
            conId=a.ContactId;  /* not covered */
            accId=a.AccountId;  /* not covered */
            strAccountSite=assSiteMap.get(accId);  /* not covered */
            
            Event newEvent= new Event(  /* not covered */
                ownerid=ownId,
                Subject='Company "Go Live"', 
                ActivityDate=dtTargetDate,
                StartDateTime=dtTargetDateTime, 
                EndDateTime=dtTargetDateTime,
                Location=strAccountSite, 
                ShowAs='Free', 
                IsAllDayEvent=TRUE, 
                Event_Status__c='Scheduled',
                Type='Non-Visit',
                Purpose__c='Sales',
                Reason__c='Conversion',
                Whoid=conId, 
                Whatid=assId, 
                RecordTypeId=recId);       
            ev.add(newEvent);            /* not covered */
        }
        insert ev; 
    }
}
and here is my current test class
@isTest(SeeAllData=true)
public class CreateEvent_test {
    
    static testMethod void testAll(){
      
        id idRecType=null; 
        TestObject to = new TestObject(); 
        Account acc = to.getAccount(true); 
        Contact con = to.getContact(acc.id, true); 
        Opportunity opp = to.getOpportunity(acc.id, con.Id, true); 
        opp.Product_Group__c='Company Enterprise'; 
        update opp; 
        

        Asset ass = to.getAsset(acc.id, con.id, opp.id, true); 
        ass.status='Migrated'; 
        ass.Product_Group__c='Product X'; 

        update ass; // this should fire the trigger to create the Event
        List<Event> ev = new List<Event>([SELECT id, subject FROM event WHERE whatid=:ass.Id]);
        test.startTest();           
        for(Event e:ev){    

            // validate success
            System.assertEquals(e.subject, 'Company "Go Live"'); 
            System.assertEquals(e.AccountId, acc.id); 
            System.assertEquals(e.WhoId, con.id); 
            // System.assertEquals(e.Location)
        }
        test.stopTest(); 
    }
}



 
A trigger to insert email value in custom object from lead object (lookup).

Please help.  I am not a developer or really an IT person at all.  Howevever, I keep getting the error message "API disabled for Org".  How can I enable it.  I have the enterprise edition and I am the administrator.  I am on the trial right now.

 hai everyone the following code gives an error....

I want to store a list in a cookie....


Error: prosearch Compile Error: Constructor not defined: [System.Cookie].<Constructor>(String, LIST<Product__c>, NULL, Integer, Boolean) at line 327 column 25

here is the code...

public list<Product__c> searchlist{set; get;}

 public List<Product__c> getsearchProductJava(){
 
         List<Product__c> searchlist = new List<Product__c>();
       qry ='select id, Product_Name__c,Price__c,Product_Image__c, Company__c from Product__C where (Product_Department__c =: selecteddept)';     
         
         if(selectedcat != 'none')
             {
              qry+=  'AND (Product_Category__c=: selectedcat)';
             } 
         
         if(choosegender!= 'none')
             {
               qry+= 'AND (Trending_For__c =: choosegender)';
             }
         searchlist = database.query(qry);
         return searchlist;   

 } 
 
 public void setCookie() {
    Cookie userCookie = new Cookie('CookieName', searchlist, null, 315569260, false); //Here 315569260 represents cookie expiry date = 10 years. You can set this to what ever expiry date you want. Read apex docs for more details.
    ApexPages.currentPage().setCookies(new Cookie[] {
        userCookie
    });
}

We have an existing trigger that automatically creates a Contact record when a user creates an Account record in the UI. 
It starts like this: 
trigger AddContact on Account (after insert) {
/* They wanted to add the Contact when the Account was created.  If Other Person is filled in it creates two Contacts.
One with Account name nad one with Other Person name - oth have same phone and email

We are now going to user Jitterbit to migrate Account records over from another legacy system. I'm wondering if the trigger should still fire when the accounts are imported and create a Contact or if it only runs in the UI?
Hi

When i select on gold i need to display different data.
As per my code i am getting last data only adding 5times.
i need different data in 5times.

public class TemplateTaskData {
public TemplateTaskData(ApexPages.StandardController controller) {
      lookupDataPop = new Template_Tasks__c ();
       //lookupDataPop = (Template_Tasks__c )controller.getrecord();
}
public Template_Tasks__c lookupDataPop{get;set;}
public string lkpdata {get;set;}
public  List<Template_Tasks__c> templatetask {get;set;}
 
    public pagereference currentData(){
    system.debug('lookupDataPop.Template__c****'+lookupDataPop .Template__c);
   templatetask = new list<Template_Tasks__c>();
if(lkpdata =='Gold')
{
lookupDataPop .Template__c = lookupDataPop .Template__c;
lookupDataPop.Task_name__c= 'Maestro 5 LMS Implementation Package';
lookupDataPop.Billing_function__c = 'CN';
lookupDataPop.Billing_HOURS__c= 82;
} else if(lkpdata =='Bronze')
{

lookupDataPop.Task_name__c= 'Data Migration';
lookupDataPop.Billing_function__c = 'CN';
lookupDataPop.Billing_HOURS__c= 44;
} else if(lkpdata =='Silver')
{

lookupDataPop.Task_name__c= 'Data migration - Express';
lookupDataPop.Billing_function__c = 'CN';
lookupDataPop.Billing_HOURS__c= 44;
}
templatetask.add(lookupDataPop);

if(lkpdata =='Gold')
{
lookupDataPop .Template__c = lookupDataPop .Template__c;
lookupDataPop.Task_name__c= 'Data Migration';
lookupDataPop.Billing_function__c = 'CN';
lookupDataPop.Billing_HOURS__c= 82;
} else if(lkpdata =='Bronze')
{

lookupDataPop.Task_name__c= 'Data Migration';
lookupDataPop.Billing_function__c = 'CN';
lookupDataPop.Billing_HOURS__c= 44;
} else if(lkpdata =='Silver')
{

lookupDataPop.Task_name__c= 'Data migration - Express';
lookupDataPop.Billing_function__c = 'CN';
lookupDataPop.Billing_HOURS__c= 44;
}
templatetask.add(lookupDataPop);

if(lkpdata =='Gold')
{
lookupDataPop .Template__c = lookupDataPop .Template__c;
lookupDataPop.Task_name__c= 'Data migration - Express';
lookupDataPop.Billing_function__c = 'CN';
lookupDataPop.Billing_HOURS__c= 82;
} else if(lkpdata =='Bronze')
{

lookupDataPop.Task_name__c= 'Data Migration';
lookupDataPop.Billing_function__c = 'CN';
lookupDataPop.Billing_HOURS__c= 44;
} else if(lkpdata =='Silver')
{

lookupDataPop.Task_name__c= 'Data migration - Express';
lookupDataPop.Billing_function__c = 'CN';
lookupDataPop.Billing_HOURS__c= 44;
}
templatetask.add(lookupDataPop);
if(lkpdata =='Gold')
{
lookupDataPop .Template__c = lookupDataPop .Template__c;
lookupDataPop.Task_name__c= 'Data Migration - Full';
lookupDataPop.Billing_function__c = 'CN';
lookupDataPop.Billing_HOURS__c= 82;
} else if(lkpdata =='Bronze')
{

lookupDataPop.Task_name__c= 'Data Migration';
lookupDataPop.Billing_function__c = 'CN';
lookupDataPop.Billing_HOURS__c= 44;
} else if(lkpdata =='Silver')
{

lookupDataPop.Task_name__c= 'Data migration - Express';
lookupDataPop.Billing_function__c = 'CN';
lookupDataPop.Billing_HOURS__c= 44;
}
templatetask.add(lookupDataPop);
if(lkpdata =='Gold')
{
lookupDataPop .Template__c = lookupDataPop .Template__c;
lookupDataPop.Task_name__c= 'Maestro Full data migration X3';
lookupDataPop.Billing_function__c = 'CN';
lookupDataPop.Billing_HOURS__c= 82;
} else if(lkpdata =='Bronze')
{

lookupDataPop.Task_name__c= 'Data Migration';
lookupDataPop.Billing_function__c = 'CN';
lookupDataPop.Billing_HOURS__c= 44;
} else if(lkpdata =='Silver')
{

lookupDataPop.Task_name__c= 'Data migration - Express';
lookupDataPop.Billing_function__c = 'CN';
lookupDataPop.Billing_HOURS__c= 44;
}
templatetask.add(lookupDataPop);
   return null;
   }
}