• phil.adams1.3928016499835732E12
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
I can't seem to find any documentation on using multiple WHERE clauses in a remoteObjects call. The following works fine;

where : {
    OwnerId : {
         eq : userid
    }
}

I am unsure how to add more. I have tried simply adding another property : object after the OwnerId but this fails. The above works absolutely fine.
For the life of me I can't seem to get this working. I've written a custom extension class and a basic visualforce page to display a chart. As a normal controller with a hardcoded Account Id it works fine and the chart displays. When I try and convert it into a controller extension and add it to an account page I keep getting 'Content cannot be displayed: Attempt to de-reference a null object' errors.

Visualforce Page
<apex:page standardController="Account" extensions="BudgetController2"> 
  <apex:pageBlock title="Budget Test"> 
 
    <apex:chart height="400" width="500" data="{!ChartData}">
          <apex:legend position="right"/>
          <apex:axis type="Numeric" position="left" fields="data1,data2"
                 title="Value" grid="true"/>
          <apex:axis type="Category" position="bottom" fields="name"
                 title="Month"/>
          <apex:barSeries orientation="vertical" axis="left"
                 xField="name" yField="data1" title="Budget"/>
          <apex:lineSeries axis="left" xField="name" yField="data2"
                 markerType="circle" markerSize="4" markerFill="#8E35EF" title="Targett"/>
    </apex:chart>

  </apex:pageBlock> 
</apex:page>

Custom Controller Extension
public with sharing class BudgetController2 {

    private Account acct;

    public BudgetController2(ApexPages.StandardController controller) {

        acct = (Account)controller.getRecord();

    }

    public list<AggregateResult> lstBud = [SELECT SUM(Jan__c)Jan, SUM(Feb__c)Feb, SUM(Mar__c)Mar FROM Account WHERE Id = :acct.id];
    public list<AggregateResult> lstTar = [SELECT SUM(Jan_target__c)Jan, SUM(Feb_target__c)Feb, SUM(Mar_target__c)Mar FROM Account WHERE Id = :acct.id];
    public list<list<AggregateResult>> lstAll = new list<list<AggregateResult>>{lstBud, lstTar};
   
    public List<Data> getChartData() {
        List<Data> data = new List<Data>();
        data.add(new Data('Jan', (decimal)lstAll[0][0].get('Jan'), (decimal)lstAll[1][0].get('Jan')));
        data.add(new Data('Feb', (decimal)lstAll[0][0].get('Feb'), (decimal)lstAll[1][0].get('Feb')));
        data.add(new Data('Mar', (decimal)lstAll[0][0].get('Mar'), (decimal)lstAll[1][0].get('Mar')));
        system.debug(data);
        return data;
    }   

    public class Data {
        public String name { get; set; }
        public Decimal data1 { get; set; }
        public Decimal data2 { get; set; }
        public Data(String name, Decimal data1, Decimal data2) {
            this.name = name;
            this.data1 = data1;
            this.data2 = data2;

        }
    }
   

}


The debug logs show that the code stops as soo as it trys to run the constructor. I've tried pretty much every code combination I can find online, although i'm pretty sure it will be a glaringly obvious error!

Any help appreciated.


For the life of me I can't seem to get this working. I've written a custom extension class and a basic visualforce page to display a chart. As a normal controller with a hardcoded Account Id it works fine and the chart displays. When I try and convert it into a controller extension and add it to an account page I keep getting 'Content cannot be displayed: Attempt to de-reference a null object' errors.

Visualforce Page
<apex:page standardController="Account" extensions="BudgetController2"> 
  <apex:pageBlock title="Budget Test"> 
 
    <apex:chart height="400" width="500" data="{!ChartData}">
          <apex:legend position="right"/>
          <apex:axis type="Numeric" position="left" fields="data1,data2"
                 title="Value" grid="true"/>
          <apex:axis type="Category" position="bottom" fields="name"
                 title="Month"/>
          <apex:barSeries orientation="vertical" axis="left"
                 xField="name" yField="data1" title="Budget"/>
          <apex:lineSeries axis="left" xField="name" yField="data2"
                 markerType="circle" markerSize="4" markerFill="#8E35EF" title="Targett"/>
    </apex:chart>

  </apex:pageBlock> 
</apex:page>

Custom Controller Extension
public with sharing class BudgetController2 {

    private Account acct;

    public BudgetController2(ApexPages.StandardController controller) {

        acct = (Account)controller.getRecord();

    }

    public list<AggregateResult> lstBud = [SELECT SUM(Jan__c)Jan, SUM(Feb__c)Feb, SUM(Mar__c)Mar FROM Account WHERE Id = :acct.id];
    public list<AggregateResult> lstTar = [SELECT SUM(Jan_target__c)Jan, SUM(Feb_target__c)Feb, SUM(Mar_target__c)Mar FROM Account WHERE Id = :acct.id];
    public list<list<AggregateResult>> lstAll = new list<list<AggregateResult>>{lstBud, lstTar};
   
    public List<Data> getChartData() {
        List<Data> data = new List<Data>();
        data.add(new Data('Jan', (decimal)lstAll[0][0].get('Jan'), (decimal)lstAll[1][0].get('Jan')));
        data.add(new Data('Feb', (decimal)lstAll[0][0].get('Feb'), (decimal)lstAll[1][0].get('Feb')));
        data.add(new Data('Mar', (decimal)lstAll[0][0].get('Mar'), (decimal)lstAll[1][0].get('Mar')));
        system.debug(data);
        return data;
    }   

    public class Data {
        public String name { get; set; }
        public Decimal data1 { get; set; }
        public Decimal data2 { get; set; }
        public Data(String name, Decimal data1, Decimal data2) {
            this.name = name;
            this.data1 = data1;
            this.data2 = data2;

        }
    }
   

}


The debug logs show that the code stops as soo as it trys to run the constructor. I've tried pretty much every code combination I can find online, although i'm pretty sure it will be a glaringly obvious error!

Any help appreciated.


Hi Friends,

 

IMAGE(
CASE(Marked_for_deletion__c,
"FALSE", "/img/samples/light_green.gif",
"TRUE", "/img/samples/light_red.gif",
"/s.gif"),
"Marked For Deletion Flag")

 

 

Here Marked_for_deletion__c is a checkbox. so i used TRUE and FALSE in the case functions.

But its showing error Like " Error: Incorrect argument type for function CASE(). "

 

Kindly help me out in this.

 

Thanks.