• jai.s
  • NEWBIE
  • 20 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 1
    Likes Given
  • 14
    Questions
  • 4
    Replies
Hi,

I have input search field in vf page, as per the search given in that field i am displaying resulted data in a table (Item and price).

now, i have to show sum of price column values in a table(Soql query resulted data as per value given in a input search filed).

Kindly help to achieve this scenario.

Item         Price 
  A            100
  B            300
  C            500
      Total:  900

Thanks in Advance!!
  • January 31, 2015
  • Like
  • 0
Hi,

I have input search field in vf page, as per the search given in that field i am displaying resulted data in a table (Item and price).

now, i have to show sum of price column values in a table(Soql query resulted data as per value given in a input search filed).

Kindly help to achieve this scenario.

Item         Price 
  A            100
  B            300
  C            500
      Total:  900

Thanks in Advance!!

 
  • January 31, 2015
  • Like
  • 0
Hi,

I am creating a vf page to dispaly grand parent, parent, child records in singletable, but iam getting below error in controller class, please help me to solve this error.

VF Page:
<apex:page sidebar="false" controller="MultipleObjectClass">
<apex:pageBlock>
<apex:pageBlockTable value="{!grandparentWraplist}" var="g">
<apex:column value="{!g.doc1.name}"/>
<apex:column value="{!g.doc1.age__c}" />
<apex:column>
<apex:pageBlockTable value="{!d.parentlist}" var="p">
<apex:column value="{!p.name}"/>
<apex:column>
<apex:pageBlockTable value="{!p.childList}" var="c">
<apex:column value="{!c.name}"/>
<apex:column value="{!c.phone__c}"/>
</apex:pageBlockTable>
</apex:column>
</apex:pageBlockTable>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>

Controller:
public class MultipleObjectClass {
public list<wrapperclass> grandparentWraplist{get;set;}
public list<grandparent__c> doclist {get;set;}
public list<parent__c> plist {get;set;}
map<ID,list<parent__c>> grandParentListMap {get; set;}
set<ID> docIDs=new set<ID>();
map<ID, list<grandparent__c>> docMap=new map<ID, list<grandparent__c>>();

public MultipleObjectClass (){
doclist=[Select id,name From grandparent__C];
grandParentListMap=new map<ID,list<parent__c>>();
 grandparentWraplist=new list<wrapperclass>();
 
if(doclist.size()>0){
for(grandparent__c doc:doclist){
docIDs.add(doc.id);
docMap.put(doc.id, new list<grandparent__c>());
}
plist =[Select id,name,grandparent__c,(select id,name,phone__c from childs__r) From parent__c where grandparent__c=:docIDs];
}
if(plist.size()>0){
for(parent__c pat:plist){
if(!grandParentListMap .containskey(pat.grandparent__c)){
grandParentListMap.put(pat.grandparent__c, new list<parent__c>());
}
grandParentListMap.get(pat.grandparent__c).add(pat);
}
for(id patid:grandParentListMap.keyset()){

grandparentWraplist.add(new wrapperclass(docMap.get(patid)),grandParentListMap.get(patid)); // in this line iam getting error
}
}

}

Public class wrapperclass{
public grandparent__c doc1{get;set;}
public list<parent__c> childlist{get; set;}

public wrapperclass(grandparent__c doc1, list<parent__c> childlist{
doc1=doc2;
childlist=childlist;
}
}
}

Thanks in Advance!!

 
  • January 29, 2015
  • Like
  • 0
Hi,

Please any one guide me the procedure to stop schedule class?

Thanks in advance,
Shaik
  • December 21, 2014
  • Like
  • 0
Hi,

Please any one guide me the procedure to stop schedule class?

Thanks in advance,
Shaik
  • December 21, 2014
  • Like
  • 0
Hi,

Please any one share sample code of schedule class to execute every 15m.

Regards,
Shaik
  • December 21, 2014
  • Like
  • 0
Hi,

Please any one share sample code of schedule class to execute every 15m.

Regards,
Shaik
  • December 21, 2014
  • Like
  • 0
Hi,
We have 1000 licenses in my org, in that few are not login regularly, I what to deactivate them automatically those are not using from last one month.

Please any one can suggest me, how can we achieve this?

Regards,
Shaik
  • December 21, 2014
  • Like
  • 0
Hi,
We have 1000 licenses in my org, in that few are not login regularly, I what to deactivate them automatically those are not using from last one month.

Please any one can suggest me, how can we achieve this?

Regards,
Shaik
  • December 21, 2014
  • Like
  • 0
Hi,

I have scenario that update a custom field(Amount__c) of parent(Account) with sum of all child records (Total_Price__c) from Child Object(Invoice Line Item).

I have to wirte a trigger for above scenario, if any one have sample code please share it.

Thanks in advance,
Shaik
  • December 21, 2014
  • Like
  • 0
Hi,

I have scenario that update a custom field(Amount__C) of parent(Account) with sum of all child records (Total_Price) from Child Object(Invoice Line Item).

I have to wirte a trigger for above scenario, if any one have sample code please share it.

Thanks in advance,
Shaik
  • December 21, 2014
  • Like
  • 1
Hi,

I am get error like: 
System.NullPointerException: Attempt to de-reference a null object
Class.SearchListController.getSObjectList: line 19, column 1     

public class SearchListController{
 
    public String objectName {get;set;}
    public List<String> objectFields {get;set;}
    public List<SObject> SObjectListToShow {get;set;}
    public SearchListController(){
        //objectName= 'MyObject__c';
        objectName= '';
        SObjectListToShow =new List<SObject>();
       // SObjectListToShow = getSObjectList();
    }
    
    public List<SObject> getSObjectList(){
    
    //Getting field list for the sObject 
        objectFields =  new List<String>();
        Map<String , Schema.SObjectType> globalDescription = Schema.getGlobalDescribe();
        Schema.sObjectType sObjType = globalDescription.get(objectName);
        Schema.DescribeSObjectResult res = sObjType.getDescribe();                                // In this line, iam getting error
 
         Map<String , Schema.SObjectField> mapFieldList = res.fields.getMap();
        for(Schema.SObjectField field : mapFieldList.values())
        {
            Schema.DescribeFieldResult fieldResult = field.getDescribe();
            if(fieldResult.isAccessible())
            {
                objectFields.add(fieldResult.getName());
            }
        }
 
        //Building Query with the fields
        Integer i = 0;
        String fieldsToFetch = '';
        Integer len = objectFields.size();
        for(String temp:objectFields)
        {
 
            if(i==len-1)
            {
                  fieldsToFetch = fieldsToFetch + temp;
            }
            else
            {
                  fieldsToFetch = fieldsToFetch + temp + ',';
            }
            i++;
        }
            String qryStr = 'Select ' + fieldsToFetch + ' From ' + objectName  ;
            return  Database.Query(qryStr);
    }
}

VF Page:
<apex:page controller="SearchListController">
    <apex:form >
        <apex:pageBlock id="result" >
            <apex:pageBlockTable value="{!sObjectList}" var="res">
                <apex:repeat value="{!objectFields}" var="field">
                    <apex:column value="{!res[field]}"/>
                </apex:repeat>
            </apex:pageBlockTable>
        </apex:pageBlock>        
    </apex:form>
</apex:page>
Please help sove this problem.

Regards,
Shaik
  • December 11, 2014
  • Like
  • 0
Hi,

I am get error like: 
System.NullPointerException: Attempt to de-reference a null object
Class.SearchListController.getSObjectList: line 19, column 1     

public class SearchListController{
 
    public String objectName {get;set;}
    public List<String> objectFields {get;set;}
    public List<SObject> SObjectListToShow {get;set;}
    public SearchListController(){
        //objectName= 'MyObject__c';
        objectName= '';
        SObjectListToShow =new List<SObject>();
       // SObjectListToShow = getSObjectList();
    }
    
    public List<SObject> getSObjectList(){
    
    //Getting field list for the sObject 
        objectFields =  new List<String>();
        Map<String , Schema.SObjectType> globalDescription = Schema.getGlobalDescribe();
        Schema.sObjectType sObjType = globalDescription.get(objectName);
        Schema.DescribeSObjectResult res = sObjType.getDescribe();  // In this line, iam getting error
 
         Map<String , Schema.SObjectField> mapFieldList = res.fields.getMap();
        for(Schema.SObjectField field : mapFieldList.values())
        {
            Schema.DescribeFieldResult fieldResult = field.getDescribe();
            if(fieldResult.isAccessible())
            {
                objectFields.add(fieldResult.getName());
            }
        }
 
        //Building Query with the fields
        Integer i = 0;
        String fieldsToFetch = '';
        Integer len = objectFields.size();
        for(String temp:objectFields)
        {
 
            if(i==len-1)
            {
                  fieldsToFetch = fieldsToFetch + temp;
            }
            else
            {
                  fieldsToFetch = fieldsToFetch + temp + ',';
            }
            i++;
        }
            String qryStr = 'Select ' + fieldsToFetch + ' From ' + objectName  ;
            return  Database.Query(qryStr);
    }
}

Please help sove this problem.

Regards,
Shaik
  • December 11, 2014
  • Like
  • 0
Hi,

I have requirement that, i have to dislpay Count of leads modified from last 3moths in Home Page. 

Regards
Shaik
  • December 05, 2014
  • Like
  • 0
I have two objects Parent(Account) and Child(Contact). I want to update all associated child records 'Last Name' with comma separated formate in parent filed (custome field).

For suppose i have five child records for associate parent record, now i want to update this five child records last names into that parent filed with comma separated.

I know we can do this using VF and Apex. Can you please clarify is it possible through Triggers? And if u can please share sample code.

Thanks in advance!!!!
  • November 25, 2014
  • Like
  • 0
Hi,

I have scenario that update a custom field(Amount__C) of parent(Account) with sum of all child records (Total_Price) from Child Object(Invoice Line Item).

I have to wirte a trigger for above scenario, if any one have sample code please share it.

Thanks in advance,
Shaik
  • December 21, 2014
  • Like
  • 1
Hi,

Please any one share sample code of schedule class to execute every 15m.

Regards,
Shaik
  • December 21, 2014
  • Like
  • 0
Hi,
We have 1000 licenses in my org, in that few are not login regularly, I what to deactivate them automatically those are not using from last one month.

Please any one can suggest me, how can we achieve this?

Regards,
Shaik
  • December 21, 2014
  • Like
  • 0
Hi,

I have requirement that, i have to dislpay Count of leads modified from last 3moths in Home Page. 

Regards
Shaik
  • December 05, 2014
  • Like
  • 0
There is a manager 'A' and under him there are 10 users with role hierarchy. and 'user 10' must access the date of a manager. Is it possible???
 
  • December 02, 2014
  • Like
  • 0
Dear Friends,

I need to see how many contacts and Accounts in my organisation in Home tab with out use Vf.

Note:Only no of candidates only not view of all candidates.



Please tell me friends.