You need to sign in to do that
Don't have an account?
Iridious Jones
How to create a history of cases created by a user
Hello Everyone,
I'm attempting to create a VF page/component that will give me a case history so to speak. When a user creates a case I'd like a history of cases created by that user for any record type to appear in a case history list. Any ideas on how I can acheive this. I'm completely new to SF and Apex.
I'm attempting to create a VF page/component that will give me a case history so to speak. When a user creates a case I'd like a history of cases created by that user for any record type to appear in a case history list. Any ideas on how I can acheive this. I'm completely new to SF and Apex.
Step #1:
Create a new formula field "Created User Id" like below
Step #2:
Create a report with filter value of Created User Id and make sure you save the report
Report filter values can be passed via URL like below
https://na14.salesforce.com/<report_id>?pv0=<paramter_value>
pass your report id for <report_id>
pass created user id for <paramter_value>
https://na14.salesforce.com/00Od0000005eesE?pv0=005d00000013aZC
Step #3:
Create formula field in Case object like below
Step #4:
Add newly created field onto Case Page layout
Now: whenever user clicks on the link system automatically runs the report where it shows the history or cases created by that specific user
Hope this helps.
Thanks,
Rangesh
All Answers
Step #1:
Create a new formula field "Created User Id" like below
Step #2:
Create a report with filter value of Created User Id and make sure you save the report
Report filter values can be passed via URL like below
https://na14.salesforce.com/<report_id>?pv0=<paramter_value>
pass your report id for <report_id>
pass created user id for <paramter_value>
https://na14.salesforce.com/00Od0000005eesE?pv0=005d00000013aZC
Step #3:
Create formula field in Case object like below
Step #4:
Add newly created field onto Case Page layout
Now: whenever user clicks on the link system automatically runs the report where it shows the history or cases created by that specific user
Hope this helps.
Thanks,
Rangesh
Solution I provided is using declartive power of salesforce. If you want to display user case creation history in Case page layout then you should take inline VF Page approach.
Step #1: Create Apex Controller
Step #2: Create VF Page using standard controller as case and extension controller as the one you created in Step #1
Step #3: Edit Case Page Layout a) create new section b) go to Visualforce Pages and select VF Page you created in Step #2 to add it to section
Step #1 Code
Step #2 Code :
Step #3
Final Look:
Can we make the FROM clause a report and the condition an record type.
UserCaseList = [select CaseNumber, Subject, Description, CreatedById, Status, CreatedDate from Case where CreatedById = :UserCaseId[0].CreatedById AND CaseRecordType = :IT Order by CreatedDate desc];
above query should help