You need to sign in to do that
Don't have an account?
MBarnard
Completely Confused - Unknown Property Error
Hey Guys,
So I'm trying to create a new Class and Component that will pull all cases that were closed this week and all cases that aren't yet closed.
I have a few purposes for this, one is to create an email around this that will go out every friday, but I also plan to possibly in the future place this actually within Salesforce as a page for quick visibility.
However, I am running in to an issue that I can't for the life of me figure out what i screwed up.
Yes, I am fairly certain this could be done differently with a query and then a map, but I'm still new to Apex and this makes sense, in my head.
The Error I am running in to is: "Save error: Unknown property 'Case=_List.ClosedCasesThisWeek'
Here is the Class: (yes there are more variables i plan on utilizing in the component but without fixing this error, the additional variables don't matter anyways)
I am confused as it doesn't matter if I only try to query 'ClosedCasesThisWeek' nor does the order matter, etc etc etc... help?
So I'm trying to create a new Class and Component that will pull all cases that were closed this week and all cases that aren't yet closed.
I have a few purposes for this, one is to create an email around this that will go out every friday, but I also plan to possibly in the future place this actually within Salesforce as a page for quick visibility.
However, I am running in to an issue that I can't for the life of me figure out what i screwed up.
Yes, I am fairly certain this could be done differently with a query and then a map, but I'm still new to Apex and this makes sense, in my head.
The Error I am running in to is: "Save error: Unknown property 'Case=_List.ClosedCasesThisWeek'
Here is the Class: (yes there are more variables i plan on utilizing in the component but without fixing this error, the additional variables don't matter anyways)
global class Case_List { //Get Cases Currently Open, In Progress, In Dev, Open and Closed this Week global list <Case> OpenedCases = [select id, Case.CreatedBy.Name, Case.Account.Name, Subject, Case.Owner.Name from Case where status='Open']; global list <Case> ClosedCasesThisWeek = [select id, Case.CreatedBy.Name, Case.Account.Name, Subject, Case.Owner.Name, ClosedDate from Case where ClosedDate = THIS_WEEK]; global list <Case> InDevCases = [select id, Case.CreatedBy.Name, Case.Account.Name, Subject, Case.Owner.Name from Case where status='In Dev']; global list <Case> InProgressCases = [select id, Case.CreatedBy.Name, Case.Account.Name, Subject, Case.Owner.Name from Case where status='In Progress']; global list <Case> CompletedCases = [select id, Case.CreatedBy.Name, Case.Account.Name, Subject, Case.Owner.Name from Case where Date_Time_Completed__c = THIS_WEEK]; global list <Case> CompletedbutNotClosedCases = [select id, Case.CreatedBy.Name, Case.Account.Name, Subject, Case.Owner.Name from Case where Status ='Completed']; global integer CasesOpenCount = OpenedCases.size(); global integer CasesCloseThisWeekCount = ClosedCasesThisWeek.size(); global integer CasesInDevCount = InDevCases.size(); global integer CasesInProgressCount = InProgressCases.size(); global integer CasesCompletedCount = CompletedCases.size(); global integer CasesCompletedbutNotClosedCount = CompletedbutNotClosedCases.size(); }Here is the Component
<apex:component controller="Case_List" access="global"> <apex:dataTable value="{!ClosedCasesThisWeek}" var="ClosedCases" id="ClosedCases" rowClasses="odd,even"> <apex:column > <apex:facet name="header">Subject</apex:facet> <apex:outputText value="{!ClosedCases.Subject}" /> </apex:column> <apex:column > <apex:facet name="header">Account</apex:facet> <apex:outputText value="{!ClosedCases.Account.Name}" /> </apex:column> <apex:column > <apex:facet name="header">Case Owner</apex:facet> <apex:outputText value="{!ClosedCases.Owner.Name}" /> </apex:column> <apex:column > <apex:facet name="header">CloseDate</apex:facet> <apex:outputText value="{!ClosedCases.ClosedDate}" /> </apex:column> </apex:dataTable> <apex:outputText html-font-size="17" value="Currently Open Cases" /> <apex:dataTable value="{!OpenedCases}" var="Open" id="OpenCases" rowClasses="odd,even"> <apex:column > <apex:facet name="header">Creator</apex:facet> <apex:outputText value="{!Open.CreatedBy.Name}" /> </apex:column> <apex:column > <apex:facet name="header">Subject</apex:facet> <apex:outputText value="{!Open.Subject}" /> </apex:column> <apex:column > <apex:facet name="header">Account</apex:facet> <apex:outputText value="{!Open.Account.Name}" /> </apex:column> <apex:column > <apex:facet name="header">Case Owner</apex:facet> <apex:outputText value="{!Open.Owner.Name}" /> </apex:column> <apex:column > <apex:facet name="header">Opened Date</apex:facet> <apex:outputText value="{!Open.CreatedDate}" /> </apex:column> </apex:dataTable> <br /> <br /> <apex:outputText html-font-size="17" value="Cases Currently In Dev" /> <apex:dataTable value="{!InDevCases}" var="InDevCases" id="InDevCases" rowClasses="odd,even"> <apex:column > <apex:facet name="header">Creator</apex:facet> <apex:outputText value="{!InDevCases.CreatedBy.Name}" /> </apex:column> <apex:column > <apex:facet name="header">Subject</apex:facet> <apex:outputText value="{!InDevCases.Subject}" /> </apex:column> <apex:column > <apex:facet name="header">Account</apex:facet> <apex:outputText value="{!InDevCases.Account.Name}" /> </apex:column> <apex:column > <apex:facet name="header">Case Owner</apex:facet> <apex:outputText value="{!InDevCases.Owner.Name}" /> </apex:column> <apex:column > <apex:facet name="header">Open Date</apex:facet> <apex:outputText value="{!InDevCases.CreatedDate}" /> </apex:column> </apex:dataTable> <br /> <br /> <apex:outputText html-font-size="17" value="Currently In Progress Cases" /> <apex:dataTable value="{!InProgressCases}" var="InProgressCases" id="InProgressCases" rowClasses="odd,even"> <apex:column > <apex:facet name="header">Creator</apex:facet> <apex:outputText value="{!InProgressCases.CreatedBy.Name}" /> </apex:column> <apex:column > <apex:facet name="header">Subject</apex:facet> <apex:outputText value="{!InProgressCases.Subject}" /> </apex:column> <apex:column > <apex:facet name="header">Account</apex:facet> <apex:outputText value="{!InProgressCases.Account.Name}" /> </apex:column> <apex:column > <apex:facet name="header">Case Owner</apex:facet> <apex:outputText value="{!InProgressCases.Owner.Name}" /> </apex:column> <apex:column > <apex:facet name="header">Open Date</apex:facet> <apex:outputText value="{!InProgressCases.CreatedDate}" /> </apex:column> </apex:dataTable> <br /> <br /> <apex:outputText html-font-size="17" value="Cases Completed but not yet Closed" /> <apex:dataTable value="{!CompletedbutNotClosedCases}" var="CompletedbutNotClosedCases" id="CompletedbutNotClosedCases" rowClasses="odd,even"> <apex:column > <apex:facet name="header">Creator</apex:facet> <apex:outputText value="{!CompletedbutNotClosedCases.CreatedBy.Name}" /> </apex:column> <apex:column > <apex:facet name="header">Subject</apex:facet> <apex:outputText value="{!CompletedbutNotClosedCases.Subject}" /> </apex:column> <apex:column > <apex:facet name="header">Account</apex:facet> <apex:outputText value="{!CompletedbutNotClosedCases.Account.Name}" /> </apex:column> <apex:column > <apex:facet name="header">Case Owner</apex:facet> <apex:outputText value="{!CompletedbutNotClosedCases.Owner.Name}" /> </apex:column> <apex:column > <apex:facet name="header">Open Date</apex:facet> <apex:outputText value="{!CompletedbutNotClosedCases.CreatedDate}" /> </apex:column> </apex:dataTable> </apex:component>
I am confused as it doesn't matter if I only try to query 'ClosedCasesThisWeek' nor does the order matter, etc etc etc... help?
If this helps,please mark it as best answer to help others :)
Is it possible to have multiple Select statements in one class?
- I can't find this answer on google.
Not sure how you are getting the error as this code works for me in my org.Can you post your latest so that I can take a look ??
No matter what Variable i try to pull first, I end up with an unknown property of that variable.
- In the example below it is Unkknown property 'List_Cases.OpenedCases'
My code is: