• Prazzie
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies

Hi,

 

I am using the following code. Yet the order of the records is not fetched according to the query. When I run the query independently it is providing right results. How to get rid of the problems?

 

class

 

public List<Utility_Object__c> getUnIdenfiedEntries() {
        
        return (List<Utility_Object__c>) setCon.getRecords();       
        
    }
    
     public ApexPages.StandardSetController setCon {
        get {
        
            if (setCon == null) {
                setCon = new ApexPages.StandardSetController(Database.getQueryLocator(
                [Select salesAmount__c,Reported_Buyer__c From Utility_Object__c where Related_Account__c = :accountId AND Report_Level__c=:DISTI_VAL
                Order by salesAmount__c desc limit 100]));
                setCon.setPageSize(this.pageSize);
                this.recordCount = setCon.getResultSize();
                
            }
            return setCon;
        }
        set;
            
    }

 

 

page

 

<apex:pageBlockTable value="{!unIdenfiedEntries}" var="entry" id="entryList">
                <apex:column headerValue="Reported Buyer" value="{!entry.Reported_Buyer__c}"/>
                <apex:column headerValue="Sales" value="${!entry.salesAmount__c}"/>
            </apex:pageBlockTable>

 

Help will be appreciated

 

Hi I have wrote the following trigger and the exception is throwing in the assignment of values:

 

 

CampaignProductPopulationTrigger on Campaign (after delete, after insert, after update) {
if(Trigger.isAfter){

if(Trigger.isUpdate){
Set<Id> campaignIds = new Set<Id>();
Set<Id> productIds = new Set<Id>();
Set<String> productSet = new Set<String>();
String productNames =

null;
for(Campaign campaign:Trigger.new){
campaignIds.add(campaign.id);

}

for(Campaign_Product__c campro:[Select Product__r.id from Campaign_Product__c where Campaign__r.id IN:campaignIds])
productIds.add(campro.Product__r.id);

for(Product2 proVal:[Select Name from Product2 where id IN:productIds])
productSet.add(proVal.

Name);
for(String setVal:productSet)
productNames+=setVal+

', ';
productNames=productNames.substring(0,productNames.length()-2);

for(Campaign campaign:Trigger.new)
campaign.Campaign_Products__c = productNames;//ERROR LINE

}


}

}

 Please tell me how to get rid of this error

 

Hi,

 

I am using the following code. Yet the order of the records is not fetched according to the query. When I run the query independently it is providing right results. How to get rid of the problems?

 

class

 

public List<Utility_Object__c> getUnIdenfiedEntries() {
        
        return (List<Utility_Object__c>) setCon.getRecords();       
        
    }
    
     public ApexPages.StandardSetController setCon {
        get {
        
            if (setCon == null) {
                setCon = new ApexPages.StandardSetController(Database.getQueryLocator(
                [Select salesAmount__c,Reported_Buyer__c From Utility_Object__c where Related_Account__c = :accountId AND Report_Level__c=:DISTI_VAL
                Order by salesAmount__c desc limit 100]));
                setCon.setPageSize(this.pageSize);
                this.recordCount = setCon.getResultSize();
                
            }
            return setCon;
        }
        set;
            
    }

 

 

page

 

<apex:pageBlockTable value="{!unIdenfiedEntries}" var="entry" id="entryList">
                <apex:column headerValue="Reported Buyer" value="{!entry.Reported_Buyer__c}"/>
                <apex:column headerValue="Sales" value="${!entry.salesAmount__c}"/>
            </apex:pageBlockTable>

 

Help will be appreciated