+ Start a Discussion
Dileep KumarDileep Kumar 

Soql Query related problem

Id caseId=ApexPages.currentPage().getParameters().get('id');

List<Ledger_Entry__c >ledgerList = [select Name,Amount__c,Bill_No__c,Cheque_No__c,Date__c,Description__c,Matter__c,Type__c,
                    sum_of_office__c,Office__c,Disbursement__c,Client_Balance__c,Sum_Of_Client_Balance__c,sumofc__c,Office1__c,Client1__c,DisbVal__c 
                    from Ledger_Entry__c  (where  Matter__c =caseId.Id) order by CreatedDate desc];

 

it is not working.I am getting error in saving this code.I need both where condition and order by CreatedDate desc .

Please help me.

 

Thanks in advance

Best Answer chosen by Dileep Kumar
Dileep KumarDileep Kumar

Hi All

ledgerList = [select Name,Amount__c,Bill_No__c,Cheque_No__c,Date__c,Description__c,Matter__c,Type__c,
                    sum_of_office__c,Office__c,Disbursement__c,Client_Balance__c,Sum_Of_Client_Balance__c,sumofc__c,Office1__c,Client1__c,DisbVal__c 
                    from Ledger_Entry__c  where  Matter__c =:caseId order by CreatedDate asc];

this is correct code.Now,I got it

Thanks 

Dileep

All Answers

Dileep KumarDileep Kumar

from Ledger_Entry__c  (where  Matter__c =caseId) order by CreatedDate desc];

this should be in above code.this is missing.

please help me

ManojjenaManojjena
Hi Dileep,
FROM Ledger_Entry__c  WHERE  Matter__c =caseId   order by CreatedDate desc];
Try with baove code
Let me know still you have issue .
Thanks
Manoj
 
Dileep KumarDileep Kumar

Hi Manoj

FROM Ledger_Entry__c  WHERE  Matter__c =caseId   order by CreatedDate desc];

This code is not working.I am getting error when i am saving my code.

Thanks

Dileep

Siddharth83JainSiddharth83Jain
Hi Dileep, 

Can send details about the error message that is being thrown. It would help in identifying the issue.

Thanks
Siddharth
OSI Consulting
Dileep KumarDileep Kumar

Hi All

ledgerList = [select Name,Amount__c,Bill_No__c,Cheque_No__c,Date__c,Description__c,Matter__c,Type__c,
                    sum_of_office__c,Office__c,Disbursement__c,Client_Balance__c,Sum_Of_Client_Balance__c,sumofc__c,Office1__c,Client1__c,DisbVal__c 
                    from Ledger_Entry__c  where  Matter__c =:caseId order by CreatedDate asc];

this is correct code.Now,I got it

Thanks 

Dileep

This was selected as the best answer