• ericmonte
  • SMARTIE
  • 680 Points
  • Member since 2012
  • Senior Manager
  • PwC


  • Chatter
    Feed
  • 16
    Best Answers
  • 5
    Likes Received
  • 0
    Likes Given
  • 30
    Questions
  • 193
    Replies
Hi all,

a few weeks back, we deployed a change set, even though our code coverage in our production org was at 66% (we ran all tests and checked).
We couldn't deploy via MavensMate (got the error that code coverage is too low), but it worked fine via frontend with change sets.
Any idea, what the reason could be??

Thanks and best regards
Toby
Hi,

I am trying to create a VF page for filteration .In that i have 3 filteration. Here is my code.
<apex:page standardcontroller="Opportunity" extensions="QuoteControll2" sidebar="false" > 
  <apex:form > 
  
  <apex:pageBlock > 
  <html>
  <body>
  <table>
  <tr>
  <apex:pageBlockSection > 
  
  <td><table border="0" bgcolor="#00BFFF" >
      <tr><apex:inputField value="{!SearchCriteria.Operating_Model__c}"/></tr>
      <tr><apex:inputText label="Quantity" value="{!Quantity}" style="width : 90%"/> </tr>
      
  <tr><apex:commandButton value="Go" action="{!filterApplicant}" /> </tr>
  </table>
  </td>
  
    </apex:pageBlockSection>   
   
       <apex:pageBlockSection >
       <apex:inputField label="Region" value="{!SearchCriteria.Region__c}" rendered="{!region}">
            <apex:actionsupport event="onchange" action="{!filterapp}" />   
          </apex:inputField>     
       
         <tr><apex:inputField value="{!SearchCriteria.partno__r.type__c}" id="degreeLevel" onchange="assignDegreeLevel(this.value)" rendered="{!typef}">      
               <apex:actionSupport event="onchange" action="{!filterapp}"/>
        </apex:inputField></tr>
 <apex:actionFunction name="assignDegreeLevel" action="{!filterapp}" 
   reRender="program" immediate="true">
      <apex:param name="degreeSelected" assignTo="{!degreeSelected}" value=""/>
 </apex:actionFunction>
 </apex:pageBlockSection>
       

      <td style="width:100%"><apex:pageBlockTable value="{!FilteredApplicants}" var="applicant" > 
          <apex:column >
            <apex:inputCheckbox value="{!selected}"/>      
          </apex:column>
          <apex:column value="{!applicant.Operating_Model__c}" />
          <apex:column value="{!applicant.MSRP__c}"/>
          <apex:column value="{!applicant.Buying_Price__c}"/> 
          <apex:column value="{!applicant.Type__c}"/>
      </apex:pageBlockTable>
      <apex:pageMessages id="error"></apex:pageMessages>
     
      </td></tr>
      </table>
      </body>
      </html>
  </apex:pageBlock> 
   </apex:form> 
</apex:page>

At 1st it consider the operating model and quantity after clicking go button that page will list the record which met the criteria. Then i have 2 picklist for filtration one Region and another is Type. For the both filteration i gave onchange action. Region is working properly but Type onchange function is not working.

Type field is formula field which takes value from another object. Please i need someone help. I am new to salesforce.
Hello,

I have created my first Standard Controller Extention for Case standard controller to include attachments on a VF Page for case submissions. 

I have not created a test class to test the controller extension before, and after looking at example after example I am even more confused now.  
Can someone please help me write a test class for the following Controller extension class so that I can move this into my production environment. 

Any help will be greatly appreciated, as I am very new to apex development and especially writing test classes.  

Controller Extension Code:

public with sharing class sfdevcaseattachment
{
public case objcase{get;set;}
public String subj {get;set;}
public String description {get;set;}
public String Initiating_Requestor {get;set;}
public Attachment myAttachment{get;set;}
public string fileName{get;set;} 
public Blob fileBody{get;set;}

    public sfdevcaseattachment(Apexpages.standardcontroller controller)
    {
        objcase = new case();
        myAttachment =new Attachment();
    }
    public pagereference save()
    {
        
        insert objcase;
        if (fileName != null && fileName.trim().length() > 0  && fileBody != null) {
        myAttachment  = new Attachment();
        Integer i=0;
        myAttachment .clear();
        myAttachment.Body = fileBody;
        myAttachment.Name = this.fileName; 
        myAttachment.ParentId = objcase.id;
        insert myAttachment;
        }
                         
        pagereference pr = new pagereference('/'+objcase.id);                           
        return pr;
        
    }
}


Thank you again in advance for your help.....I have spent 3 days now studying on how to do this and I am more of a visual learner so I am completely lost.  

Shawn
Hi there

I have two different knowledge base sites setup, one with access to all article types, the other limited to just a few.

They both have the same access to the article record types, however i thought the security also ran through data/article category group settings.

Does anyone have any ideas where to refine what the lmited user can access?

Many thanks

Mike

I have a test class that isn't improving my test coverage of controller extension. This class should pass an array of cases that has a field that holds a URL [all cases hold same URL]. Then after the Cancel method runs - it should redirect to the URL.

 

I think it isn't passing because the case records are not inserting properly - but not sure how to debug or fix.


Here is the test code:

 

@isTest
private class BulkPageCancelTest {

static testMethod void TestBulkUpdateCancelCRef(){

 

List<User> users = new List<User>{};

for(Integer i = 0; i < 10; i++){
User c = new User(lastname='Testing'+i);
users.add(c);
}
Insert users;

 

List<Case> cases = new List<Case>{};

for(Integer i = 0; i < 10; i++){
Case c = new Case(InEditUserId__c=users[0].Id,InEditViewURL__c='https://cs13.salesforce.com/500?fcf=00B30000002To4e');
cases.add(c);
}
Insert cases;

 

PageReference pageRef = Page.BulkUpdate;
Test.setCurrentPage(pageRef);
ApexPages.StandardSetController ssc = new ApexPages.StandardSetController(cases);


test.startTest();

BulkUpdate e = new BulkUpdate(ssc);
string ViewURL=cases[0].InEditViewURL__c;
string nextPage = e.CancelExit().getURL();
System.assertEquals(ViewURL,nextPage);

 

test.stopTest();
}

 

how do I add the Opportunity stage History Related Lists in my custom visual force pages. Thanks in advance

  • November 13, 2013
  • Like
  • 0

In apex controller class , how to take the value (in red color) of vf field which is edited.

 

vf code:

<apex:page controller="ProductSearchController" sidebar="false" showHeader="false">

<apex:stylesheet value="{!URLFOR($Resource.styles, 'styles.css')}"/>
    <apex:form >
        <apex:pageBlock >
 
            <apex:pageBlockButtons >
                <apex:commandButton action="{!back}" value="Back"/>
                <apex:commandButton action="{!order}" value="Place a order"/>
                
            </apex:pageBlockButtons>
            <apex:pageMessages />
 
            <apex:pageBlockSection title="You Selected following items" columns="1" collapsible="false">
                <apex:pageBlockTable value="{!selectedCategories}" var="c" title="Double click on Quantity to edit it">
                    <apex:column value="{!c.cat.Name__c}" headerValue="Name"/>
                    <apex:column value="{!c.cat.Price__c}" headerValue="Total Amount"/>
                    <apex:column value="{!c.cat.code__c}" headerValue="Code"/>
                    <apex:column value="{!c.cat.category__c}" headerValue="Category"/>
                    <apex:column headerValue="Quantity">
                    <apex:outputField value="{!c.cat.Quantity__c}">
                    <apex:inlineEditSupport event="ondblclick" showOnEdit="update"/>
                    </apex:outputField>
                    </apex:column>
                </apex:pageBlockTable>
            </apex:pageBlockSection>  
           
         <br/>
<apex:commandButton id="update" action="{!saveOrder}" value="Save Order" styleclass="updateButton"/>
        </apex:pageBlock>
    </apex:form>
</apex:page>

  • November 01, 2013
  • Like
  • 0

Hey there,

 

I have recently solved a problem that has hounded me for weeks and that was how to re-direct to a certain tab in my tabbed VF accounts page after creating a new record (a child object to accounts). Immediately I have come across another problem and that is how to override the delete record button so that it will either(whichever is easier and/or quicker/simpler on the VF page):

 

A: Re-render the pageblock list of the records with the record deleted...without redirecting away from the page.

 

B: re-direct using the code that I have just used with the new records..but re-direct to the current tab.

 

Obviously, I feel that simply re-rendering the list will be more efficient and easier...i am just not 100% sure on where to even start. please help.

 

Mikie

Hey, was wondering if I could get a hand on writing a test for my extension below V. I also had a question: This extension is for the save button and re-directs to my VF page which a tabbed account view. I will have to write several extensions for each of the custom object tabs...is it possible to write one super extension which will re-direct all of them upon saving to my VF page?

 

public class extSaveButton {
 
    public Fact_Finder__c fac {get;set;}
    public extSaveButton(ApexPages.StandardController controller) {
        this.fac = (Fact_Finder__C)controller.getRecord();

    }
    
    Public PageReference saveFactFinder(){
    
        insert fac;
        // Send the user to the detail page for the new account.
       PageReference pageRef= new PageReference('/apex/DestinyAccountTest?id='+fac.account__c+'&Sfdc.override=1');
        pageRef.getParameters().put('tab','FactFinder');
        return pageRef;
    
    }

}

 

 

 

i was able to display values to the picklist using this code:

VF PAGE:
<apex:column headerValue="Year/Block">
    <apex:selectList size="1" value="{!course.Year_Block__c}">
        <apex:selectOptions value="{!statusOptions}"/>
    </apex:selectList>
</apex:column>
Apex Class: public Student__c student {get;set;} public Course__c course {get;set;} public List<StudentWrapper> wrappers {get; set;} public List<CourseWrapper> wrapperc {get;set;} public List<SelectOption> statusOptions {get;set;} public NewStudentEntryCX(ApexPages.StandardController controller) { //other codes statusOptions = new List<SelectOption>(); Schema.DescribeFieldResult statusFieldDescription = Course__c.Year_Block__c.getDescribe(); Course__c var = [Select Id, Year_Block__c from Course__c where Id = : Apexpages.currentPage().getParameters().get('id')]; for(String s: var.Year_block__c.split(';')) statusOptions.add(new SelectOption(s, s)); } public PageReference save() { List<Student__c> studentList = new List<Student__c>(); for (StudentWrapper wrap : wrappers) { Student__c student = new Student__c(); student.Full_Name__c = wrap.studentwrap.Full_Name__c; student.Email__c = wrap.studentwrap.Email__c ; student.Gender__c = wrap.studentwrap.Gender__c ; student.Course__c = getCourseList().id;
student.Year_Block__c = **-should be the selectOption value-** studentList.add(student); } insert studentList; PageReference p = new PageReference('/apex/Main'); return p; }

 my problem is how can i get the value of the picklist/selectOptions to save?

help please.

 

 

  • October 16, 2013
  • Like
  • 0

Is it possible to query the Salesforce Content object?  I have a need to build a vf page that allows the user to view content records and attach content to a specific contact record.

 

I'm currently trying to query the ContentVersion object and I'm not getting an error, but no content is getting displayed.  I have added one piece of content and am simply trying to return that record in my query.

 

Thanks for any help!

Hey there,

 

I have a tabbed Account visualForce page with the related lists appearing as tabs. I Have inserted new record buttons in each tab. My question is:

 

Is it possible to make it so that after creating a new record and clicking save, the user will be redirected back to the accounts tabbed visualforce page, with the tab opened which the user just created the record for?

 

This is my code:

 

<apex:page standardController="Account" showHeader="true" 
tabStyle="account"  >

  
<style>
.activeTab {background-color: #892034; color:White;
background-image:none}
.inactiveTab { background-color: #00204E; color:white;
background-image:none}




</style>
<apex:tabPanel switchType="client" selectedTab="tabdetails"
id="AccountTabPanel" tabClass="activeTab"
inactiveTabClass="inactiveTab">
<apex:tab label="Details" name="AccDetails" id="tabdetails">
<apex:detail inlineEdit="True" relatedList="false" title="true"/>
</apex:tab>
<apex:tab label="Contacts" name="Contacts" id="tabContact">
<apex:pageBlock title="Hello {!$User.FirstName}!">
You are displaying contacts from the {!account.name} account.
Click a contact's name to view his or her details.
</apex:pageBlock>
<apex:pageBlock title="Contacts">
<apex:form >
<apex:dataTable value="{!account.Contacts}" var="contact" cellPadding="4"
border="1">
<apex:column >
<apex:commandLink rerender="detail">
{!contact.Name}
<apex:param name="cid" value="{!contact.id}"/>
</apex:commandLink>
</apex:column>
</apex:dataTable>
</apex:form>
</apex:pageBlock>
<apex:outputPanel id="detail">
<apex:detail subject="{!$CurrentPage.parameters.cid}" relatedList="True" inlineEdit="True"
title="false"/>
</apex:outputPanel>
</apex:tab>





<apex:tab label="Destiny Products" rendered="{!$ObjectType.Destiny_Products__c.Accessible}" name="Destiny Products" id="tabDestinyProducts" >
<apex:pageBlock title="Destiny Products" >
<apex:form >
<apex:outputlink value="/a0E/e?CF00N90000005dLWU={!Account.name}&CF00N90000005dLWU_lkid=                                                                                                                           {!Account.id}">Create New Fact Finder</apex:outputlink> 
<apex:pageBlockTable value="{!account.Destiny_Products_and_services__r}" var="Pro" cellPadding="4"  border="4">
<apex:column headerValue="Destiny Products" >
<apex:commandLink rerender="Prodetails"> {!Pro.Name}
<apex:param name="Pid" value="{!Pro.id}"/>
</apex:commandLink>
</apex:column>
<apex:column value="{!Pro.Product_Name__c}"/>
<apex:column value="{!Pro.Product_Stage__c}"/>
<apex:column value="{!Pro.Payment_Choice__c}"/>
<apex:column value="{!Pro.Amount_Owed__c}"/>
<apex:column value="{!Pro.CreatedDate}"/>
</apex:pageBlockTable>
</apex:form>
</apex:pageBlock>
<apex:outputPanel id="Prodetails">
<apex:detail subject="{!$CurrentPage.parameters.Pid}" relatedList="False" inlineEdit="True" title="false"/>
</apex:outputPanel>

 please help, I have no idea what to do.

I tried converting a lead with attachments in my dev org using the Salesfoce Lightning, and found out that the Attachments didn't convert into the Contacts.

Anyone ever experienced this?

Lead with attachment --> Convert to Contact --> Attachment doesn't show up in Contact or Account as per documentation below:
http://help.salesforce.com/HTViewSolution?id=000231874

I'm expecting either the attachments to be in Accounts/Contact and I don't see it either places
Hey all,

Can anyone help me write a unit test for this particular wrapper class?
https://developer.salesforce.com/page/Wrapper_Class

I'm more concerned on how to write the unite test for the following method:


public PageReference processSelected() {

                //We create a new list of Contacts that we be populated only with Contacts if they are selected
  List<Contact> selectedContacts = new List<Contact>();

  //We will cycle through our list of cContacts and will check to see if the selected property is set to true, if it is we add the Contact to the selectedContacts list
  for(cContact cCon: getContacts()) {
   if(cCon.selected == true) {
    selectedContacts.add(cCon.con);
   }
  }

  // Now we have our list of selected contacts and can perform any type of logic we want, sending emails, updating a field on the Contact, etc
  System.debug('These are the selected Contacts...');
  for(Contact con: selectedContacts) {
   system.debug(con);
  }
  contactList=null; // we need this line if we performed a write operation  because getContacts gets a fresh list now
  return null;
}


// This is our wrapper/container class. A container class is a class, a data structure, or an abstract data type whose instances are collections of other objects. In this example a wrapper class contains both the standard salesforce object Contact and a Boolean value
public class cContact {
  public Contact con {get; set;}
  public Boolean selected {get; set;}

  //This is the contructor method. When we create a new cContact object we pass a Contact that is set to the con property. We also set the selected value to false
  public cContact(Contact c) {
   con = c;
   selected = false;
  }
}

Any advice on how to approach this would be appreciated.

Thanks
Is it possiblie to retrieve the image dynamically from a record? For example, in a regular visualforce page we can use apex:image and you can set the value based on the image file that was uploaded.

Currently, in my object i have a field where it holds the URL for the uploaded image. I'm able to use apex:image in a regular Visualforce page, but I cant seem to figure out a way to dynamically display the image based on the URL from the record.

Is this even possible?
I'm drawing a blank on how to use the standard {!Save} function in my visualforce on the command button. Basically after I click Save I want to redirect the page into a new page.

Here is my VF page code

<apex:page standardController="Lead" recordSetVar="leads" id="thePage" showHeader="true" sidebar="false" extensions="extContactApprovalPage" >
 
  <apex:form >
        <apex:pageBlock >
            <apex:pageBlockTable value="{!leads}" var="l">
                <apex:column >
                    <apex:outputField value="{!l.Name}"/>
                    <apex:facet name="header">Registrant Name</apex:facet>
                </apex:column>
               
                <apex:column >
                    <apex:outputField value="{!l.Approve_Picklist__c}"/>
                    <apex:facet name="header">Approve Picklist</apex:facet>
                </apex:column>
                <apex:column >
                    <apex:outputField value="{!l.Approve_Checkbox__c}"/>
                    <apex:facet name="header">Approve Checkbox</apex:facet>
                </apex:column>
               
              <apex:inlineEditSupport event="onClick" showOnEdit="saveButton, cancelButton"/>
             
          </apex:pageBlockTable>
          <apex:pageBlockButtons >
                <!--<apex:commandButton value="Edit" action="{!save}" id="editButton" />-->
                <apex:commandButton value="Save" action="{!save}" id="saveButton" reRender="none" />
                <apex:commandButton value="Cancel" action="{!cancel}" id="cancelButton" />
            </apex:pageBlockButtons>
      </apex:pageBlock>
 
  </apex:form>
  <!-- Begin Default Content REMOVE THIS -->
  <h1>Congratulations</h1>
  This is your new Page: ContactApprovalPage
  <!-- End Default Content REMOVE THIS -->
</apex:page>

and here is my extension:

public class extContactApprovalPage {

    public extContactApprovalPage(ApexPages.StandardSetController controller) {
      
    }
   
    public PageReference save(){
       
        
        PageReference reRend = new PageReference('/003');
        return reRend;
    }

}

Any assistance would be great thanks.
I am having issue referencing a simple stylesheet in my visualforce page.

I created a CSS with simple code:
.center{
     width:976px;
  margin-left: auto;
  margin-right: auto;
  background-color: red;
}

then i uploaded this in my static resource and now im trying to refrence this particular CSS in my div tag but it is not working.

here is what i have in my VF page:

<apex:page showHeader="false" sidebar="false" >
 
  <apex:stylesheet value="{!$Resource.center}"/>
 
 
  <apex:form >
      <div class="center" >
          CENTER THIS
          {!$Resource.center}
      </div>
  </apex:form>
</apex:page>

I am not sure what else to do. I can hard code the CSS in the VF Page but I have  a lot of div tags with different CSS. Can anyone help me on this?
So in knowledge article, I created a field with file attachment and user's will be uploading images. So, I'm creating a Visualforce to display Article information and would like to pull the image URL of the attached file.  Is it possible to pull the URL of the file attachment in the Article?
I would like to pull the URL for the File Attachment in my Knowledge Article, is this possible? In my article type i created a data Type for File Attachment called TestImage, but unfortunately I'm unable to figure out to retrieve this URL.

I am implemententing a custom Visualforce page for Knowledge. Any assistance would be appreciated. Thanks

can someone tell me if standard DML and trigger counts as part of the SFDC API Request limit? I'm just confused what's counts as an API Request.

 

I am reading this doc:

https://help.salesforce.com/apex/HTViewHelpDoc?id=integrate_api_rate_limiting.htm&language=en#rate_limits_title

 

and it doesnt help much. Hopefully anyone can give me some insight on this.

 

Thanks

So previously, I was able to associate an externalId to a Lookup Field in my Contacts. I've used this in the past in Dev501 course and now it is not working and getting error.

 

Here is the code:

Account refAcc = new Account(ClientExternalId__c = 'test1234');
Contact c = new Contact (AccountId = refAcc, FirstName = 'test', LastName = 'testMe');
upsert c;

system.debug('what is my new contact id +++++++' +c.id);

 and here is the error i am receiving:

Invalid initial expression type for field Contact.AccountId, expecting: Id

 

I am so lost on what happen and curious if anyone else see this issue?

hey all, is it possible to append an extra page in pdf to an existing pdf that is attached already in a record?

 

So here is my scenario, a User upload a template with Contract and Agreement. Then a SFDC goes to an approval process. At the final step when the approver approves the contract, I will create a PDF page with User information and other minimum data set.

 

The easy part is creating a simple page and saving it to the record, but the difficult part is able to add it to an existing PDF. 

 

Is this even possible? Anyone know other solutions? I seen a blog that use GAE, but since this a contract with vital information we don't want it publish anywhere besides SFDC.

 

Anyone has thoughts on this?

Is it possible to group Chatter Groups? For example I want to specify a region for a group? Is that even possible?

Is there a version control process for Site.com Pages? One of my developers updated a site.com page in the studio, but he did not yet publish it to the environment. Is it possible to revert back to a specific version? Or even pull down the published version back to the site.com studio?

So i have two main questions in regards to creating a Vf page for Articles:

1. Is it possible to get the View Count for the articles in VF Page?

2. Is it possible to add Chatter Feeds into a Article?

Anyone know how to put a content Previewer on Visualforce page?

So i created a custom visualforce page on Chatter Feeds, but it does not come with the trending topics. Is it possible to retrieve the trending topics? I don't mind creating a SOQL for it, but just need some direction on how to retrieve the topics.

 

Thanks

 Can anyone point me to the right direction on how I can add Content to Sites.com? I'm practically new to using Sites.com and I am trying to leverage some of the content I have in SFDC and allows guest to view these contents.

Is there a way to remove the email button in the Document List View and the send email button in the document button?

 

 

If not what is the best approach to customize this using VF page?

Thanks

hey all i need help on getting one of my javascript button to work properly, can someone help me out?? All i am trying to do is redirect a button to new Contact Record page and setting the Record Type Id. I figured out how to query the recordType, but I can't seem to figure it out how to add it to the URL without hardcoding the RecordTypeId. Any input?

 

 

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

var leadRec = sforce.connection.query("select id, Name from RecordType where SObjectType = 'Contact' and Name = 'Standard Contact'");
 
parent.window.location = "003/e?{!$Label.LeadContactField}={!Lead.Name}&{!$Label.LeadContactField}_lkid={!Lead.Id}&retURL={!Lead.Id}&RecordType="+leadRec.id +"&ent=Contact"

So is it possible to create a mail merge document and save it into the Attachment Object for the Lead Record?

 

I was thinking of creating a button and mail merge using the mail merge template, then save the document into the attachment. In my head I know it is possible, but wanted to see if anyone have done this before? I am open to creating APEX as long as i limit the amount of hard code values.

 

Let me know if anyone has an idea.

 

Thanks

Hey all I am having a hard time trying to figure out the count of the number of child records in my Parent Record and displaying it in my Visualforce.

 

Here is my current Query

 

public class myController{

public List <account> accList {get;set;}
public myController {

accList = [select id, Name, (Select id, Name from Addresses__r) from Account];


}

And my visualforce Page will look like this

<apex: repeat value="{!accList}" var="a">
ID: {!a.Id}
Name: {!a.Name}
Number of Child Records: {!getCountChild}
<apex:repeat value="{!a.Addresses__r}" var="add">
Address info id: {!add.Id}
Address Name: {!add.Name}

</apex:repeat>
</apex:repeat>

 Any help would be great on this, I've been stuck on this for weeks.

 

Thanks

I tried converting a lead with attachments in my dev org using the Salesfoce Lightning, and found out that the Attachments didn't convert into the Contacts.

Anyone ever experienced this?

Lead with attachment --> Convert to Contact --> Attachment doesn't show up in Contact or Account as per documentation below:
http://help.salesforce.com/HTViewSolution?id=000231874

I'm expecting either the attachments to be in Accounts/Contact and I don't see it either places

hey all, is it possible to append an extra page in pdf to an existing pdf that is attached already in a record?

 

So here is my scenario, a User upload a template with Contract and Agreement. Then a SFDC goes to an approval process. At the final step when the approver approves the contract, I will create a PDF page with User information and other minimum data set.

 

The easy part is creating a simple page and saving it to the record, but the difficult part is able to add it to an existing PDF. 

 

Is this even possible? Anyone know other solutions? I seen a blog that use GAE, but since this a contract with vital information we don't want it publish anywhere besides SFDC.

 

Anyone has thoughts on this?

Anyone know how to put a content Previewer on Visualforce page?

Hi Friends,

Far from a LWC expert here. and trying to get a Lightning Data Table that is sortable. I feel like I have followed everything in the documentation but when I click the arrow in the table header nothing happens. 

Here is my JS
import { LightningElement, track, wire, api } from 'lwc';
import getRecords from '@salesforce/apex/NewToLiftController.getRecords';
import { getRecord } from 'lightning/uiRecordApi';
import { NavigationMixin } from 'lightning/navigation';

const columns = [
    { label: 'First Name', fieldName: 'FirstName', type: "Text", sortable: true},
    { label: 'Last Name', fieldName: 'LastName', type: "Text", sortable: true },
    { label: 'Email', fieldName: 'Email', type: 'Email', sortable: true },
    { label: 'Role', fieldName: 'Role__c', type: 'Text', sortable: true },
    { label: 'Startup Leadership', fieldName: 'Startup_Leadership__c', type: 'boolean', sortable: true },
    { label: 'Company', fieldName: 'CompanyOrAccount', type: 'Text', sortable: true },
];

export default class DatatableBasic extends LightningElement {
@api recordId;
@track data = [];
@track columns = columns;
@track tableLoadingState = true;
@track rowOffset = 0;

@ wire(getRecords, {recordId: '$recordId'})
    wiredRecordsMethod({error, data}) {
        if (data) {this.data = data;
            this.error = undefined;
        } else if (error) {
            this.error = error;
            this.data = undefined;
        }
        this.tableLoadingState = false;
    }
    increaseRowOffset(){this.rowOffset += 1;
    }
    // The method onsort event handler
    updateColumnSorting(event) {
        var fieldName = event.detail.fieldName;
        var sortDirection = event.detail.sortDirection;
        // assign the latest attribute with the sorted column fieldName and sorted direction
        this.sortedBy = fieldName;
        this.sortedDirection = sortDirection;
        this.data = this.sortData(fieldName, sortDirection);        
    }
}
And here is the HTML
 
<template>
            <lightning-card title='First Time Campaign Memebers' icon-name="standard:contact">
                <lightning-datatable
                        key-field="id"
                        data={data}
                        show-row-number-column
                        row-number-offset={rowOffset}
                        hide-checkbox-column
                        columns={columns}
                        sorted-by={sortedBy}
                        sorted-direction={sortedDirection}
                        onsort={updateColumnSorting}
                        is-loading={tableLoadingState}>
                </lightning-datatable>
            </lightning-card>
</template>

 
I tried converting a lead with attachments in my dev org using the Salesfoce Lightning, and found out that the Attachments didn't convert into the Contacts.

Anyone ever experienced this?

Lead with attachment --> Convert to Contact --> Attachment doesn't show up in Contact or Account as per documentation below:
http://help.salesforce.com/HTViewSolution?id=000231874

I'm expecting either the attachments to be in Accounts/Contact and I don't see it either places
Guys, i am trying to write a test class for a simple save method.
This might be simple, but i cannot get this correct!!!

Apex Class -

public with sharing class ExtUpdated {
ApexPages.StandardController stdcontroller ;
    public ExtUpdated(ApexPages.StandardController controller) {
    stdcontroller = controller;    }
public PageReference todo(){
stdcontroller.save();
return (new pagereference('/apex/confirm').setredirect(true));}}

Test Class -

@isTest
public class TestExtUpdated {
    static testMethod void saveNewCase() {
Case co = new Case();
        insert co;
        Test.startTest();
PageReference pageRef = Page.MyVFPage; // Add your VF page Name here
Test.setCurrentPage(pageRef);
ApexPages.StandardController sc = new ApexPages.StandardController(co);
sc.save();
Test.stopTest();
}}

No errors, but the test coverage is 0%.

Thanks for your help!!!
Hello Everyone, 

I've been trying to work on code that was left to our ORG by a developer who is no longer supporting us.  Not being too familiar with Apex, this is proving to be a daunting task for us and blocking us from implementing the triggers/classes that we've been working on.  I know it's a lengthy bit of code, but if someone could offer some assistance we'd be really grateful.  Currently we're getting the SQOL 101 errors with this code:
 
trigger UpdateTruckInventoryByOpportunity_Trgr on Opportunity (before update,before insert,after update, after insert, after delete, after undelete) {
    List<Truck_Inventory__c> lstTruck2Update = new List<Truck_Inventory__c>();
    
    Set<String> rt2bypass = new Set<String>{'Used Truck Quote','Accessory Order'};     
    Map<Id,RecordType> usedTruckQuoteRT = new Map<Id,RecordType>([Select SobjectType,Name,Id From RecordType Where SobjectType ='Opportunity' and Name in :rt2bypass]);
    
    RecordType usedRT = [Select SobjectType,Name,Id From RecordType Where SobjectType ='Truck_Inventory__c' and Name = 'Used' LIMIT 1];
    Map<Id,Truck_Inventory__c> mapNotUsedTruckInv = new Map<Id,Truck_Inventory__c>([Select Id,RecordTypeId From Truck_Inventory__c Where RecordTypeId =:usedRT.Id]);
    Set<String> setTruckInventories = new Set<String>();
    
    if(Trigger.isAfter){
        if(Trigger.isUpdate){
            for(Opportunity opp:Trigger.new){
                if(usedTruckQuoteRT.get(opp.RecordTypeId)==null){
                    

                     if(opp.Truck_Inventory__c!=null){
                        if(opp.StageName == 'Lost Deal - Truck Built' || opp.StageName == 'Lost Deal - Truck Not Built'){
                            lstTruck2Update.add(new Truck_Inventory__c(Id=opp.Truck_Inventory__c,Sold__c=false, Related_Quote_SO__c=null, Customer__c = null));
                        }else if(opp.StageName == 'Sales Order - Pending' || opp.StageName == 'Sales Order - Complete'){
                            lstTruck2Update.add(new Truck_Inventory__c(Id = opp.Truck_Inventory__c,Customer__c = opp.AccountId, Sold__c=true,Related_Quote_SO__c=opp.Id));
                        }else{
                            lstTruck2Update.add(new Truck_Inventory__c(Id=opp.Truck_Inventory__c, Sold__c=true,Related_Quote_SO__c=opp.Id));
                        }
                    }
                    
                    Opportunity oldOpp = Trigger.oldmap.get(opp.Id);
                    if(oldOpp.Truck_Inventory__c!=null && oldOpp.Truck_Inventory__c != opp.Truck_Inventory__c){
                        lstTruck2Update.add(new Truck_Inventory__c(Id=oldOpp.Truck_Inventory__c,Sold__c=false, Related_Quote_SO__c=null, Customer__c = null));
                    }
                    
                }
            }
        }else if(Trigger.isInsert || Trigger.isUndelete){
            for(Opportunity opp:Trigger.new){
                if(usedTruckQuoteRT.get(opp.RecordTypeId)==null) {
                    if(opp.Truck_Inventory__c!=null){         
                        lstTruck2Update.add(new Truck_Inventory__c(Id=opp.Truck_Inventory__c, Sold__c=true,Related_Quote_SO__c=opp.Id));
                    }
                }
            }
        }else if(Trigger.isDelete){
            for(Opportunity opp:Trigger.old){
                if(usedTruckQuoteRT.get(opp.RecordTypeId)==null){
                    if(opp.Truck_Inventory__c!=null){
                        lstTruck2Update.add(new Truck_Inventory__c(id=opp.Truck_Inventory__c,Sold__c=false, Related_Quote_SO__c=null));
                    }
                }
            }
        }
        if(!lstTruck2Update.isEmpty()){
            update lstTruck2Update;
        }
    
    }
    else{
        
        for(Opportunity opp:Trigger.new){
            if(usedTruckQuoteRT.get(opp.RecordTypeId)==null) {
                if(opp.Truck_Inventory__c!=null){
                    if(!mapNotUsedTruckInv.containsKey(opp.Truck_Inventory__c)){    
                        setTruckInventories.add(opp.Truck_Inventory__c);
                    }          
                }
            }
        }
        
        if(!setTruckInventories.isEmpty()){
            Map<String,String> mTruckInParent = new Map<String,String>();
            for(Truck_Inventory__c ti :[Select Truck__c, Id From Truck_Inventory__c where Id in :setTruckInventories]){
                mTruckInParent.put(ti.Id, ti.Truck__c);
            }
         
            for(Opportunity opp:Trigger.new){
                if(usedTruckQuoteRT.get(opp.RecordTypeId)==null) {
                    opp.Truck__c = mTruckInParent.get(opp.Truck_Inventory__c);
                }
            }
        }
    }
}

 
I need help for the following. I need to create a visualforce page (data input form ) using 
one standard object(Contact) and one custom object(Testresults). They have a lookup relationship. I know 
I need to write an extension but I am new to coding. Is there any way I can do this without any coding?
Thank you.
Hi all,

a few weeks back, we deployed a change set, even though our code coverage in our production org was at 66% (we ran all tests and checked).
We couldn't deploy via MavensMate (got the error that code coverage is too low), but it worked fine via frontend with change sets.
Any idea, what the reason could be??

Thanks and best regards
Toby
I am trying to ensure a Standard Log a Call functionality for a particular profile under the accounts activities related list "Log a Call" button. But I am not able to get paramters in the URLFOR. I am using the following parameters in the VF Page.

<apex:page standardController="Task"
    action="{!if(contains($Profile.Name,'Exclude Profile'), null, URLFOR($Action.Task.NewTask ,Task.Id, null , true))}" tabstyle="Task" extensions="taskExtension"> 
  • November 23, 2015
  • Like
  • 0
Hello
I am new to salesforce and I am starting development in Salesforce and found that DE have limitations of 5mb for storage.

So which can edition can increase my limit?
Do i need to pay any fee for limitless edition? What is its cost?
Do i need to be a partner to buy increased limit?
What are different types of partner?

I have gone through most links but i guess they are scattered and no linkages with development edition
So can i get details in this thread instead of providing links to portals which i already have.

Thanks in Advance.

Hemant
I have two objects one is custom object (i.e.., bookingrequest__c)and another one is Account object.In Account object i have 6 customfields.How to access that 6fields in custom object using soql query.
In the session last night, there was a live demo of customizing the hoem page components.  But in TrailHead there's this disclaimer...  "You can’t customize the layout of the Home page, add custom components, or move related lists.", with no follow up about when it will be available like I've seen for other disclaimers.

So what's the real story with customizing the home page?
I'm drawing a blank on how to use the standard {!Save} function in my visualforce on the command button. Basically after I click Save I want to redirect the page into a new page.

Here is my VF page code

<apex:page standardController="Lead" recordSetVar="leads" id="thePage" showHeader="true" sidebar="false" extensions="extContactApprovalPage" >
 
  <apex:form >
        <apex:pageBlock >
            <apex:pageBlockTable value="{!leads}" var="l">
                <apex:column >
                    <apex:outputField value="{!l.Name}"/>
                    <apex:facet name="header">Registrant Name</apex:facet>
                </apex:column>
               
                <apex:column >
                    <apex:outputField value="{!l.Approve_Picklist__c}"/>
                    <apex:facet name="header">Approve Picklist</apex:facet>
                </apex:column>
                <apex:column >
                    <apex:outputField value="{!l.Approve_Checkbox__c}"/>
                    <apex:facet name="header">Approve Checkbox</apex:facet>
                </apex:column>
               
              <apex:inlineEditSupport event="onClick" showOnEdit="saveButton, cancelButton"/>
             
          </apex:pageBlockTable>
          <apex:pageBlockButtons >
                <!--<apex:commandButton value="Edit" action="{!save}" id="editButton" />-->
                <apex:commandButton value="Save" action="{!save}" id="saveButton" reRender="none" />
                <apex:commandButton value="Cancel" action="{!cancel}" id="cancelButton" />
            </apex:pageBlockButtons>
      </apex:pageBlock>
 
  </apex:form>
  <!-- Begin Default Content REMOVE THIS -->
  <h1>Congratulations</h1>
  This is your new Page: ContactApprovalPage
  <!-- End Default Content REMOVE THIS -->
</apex:page>

and here is my extension:

public class extContactApprovalPage {

    public extContactApprovalPage(ApexPages.StandardSetController controller) {
      
    }
   
    public PageReference save(){
       
        
        PageReference reRend = new PageReference('/003');
        return reRend;
    }

}

Any assistance would be great thanks.