You need to sign in to do that
Don't have an account?
uHaveOptions
List View based on Activities in Contacts or any object
Question to my great developers. What route should I take on this project.
Just like every other list view in Salesforce, I know that the activity history are not shown in any field or even creating a filter for it.
SCENARIO:
Create a List View of contacts that will show and filter Activity History "Subject" and "Call Result" and "Date"
Ex.
John Doe - Subject: Call - Call Result: Reached
The reason for this is to have a call list for my Salesteam and be able to do it in any standard/custom object. Also have it sorted by the newest date on top so once a new call date has been made it goes all the way to the bottom of the list.
- Visualforce? Can you show code?
- Process Builder? Can you guide the process
- Field Creation? What formula?
Can you guys share your thoughts and codes so I can try?
Just like every other list view in Salesforce, I know that the activity history are not shown in any field or even creating a filter for it.
SCENARIO:
Create a List View of contacts that will show and filter Activity History "Subject" and "Call Result" and "Date"
Ex.
John Doe - Subject: Call - Call Result: Reached
The reason for this is to have a call list for my Salesteam and be able to do it in any standard/custom object. Also have it sorted by the newest date on top so once a new call date has been made it goes all the way to the bottom of the list.
- Visualforce? Can you show code?
- Process Builder? Can you guide the process
- Field Creation? What formula?
Can you guys share your thoughts and codes so I can try?
http://codebug.eu/?p=30
This will work for records that are being currently displayed on the VF Page and will give you dynamic results. Below is the edited code (Controller code remains the same):
Second approach is using Apex changes ie change in controller code. Using this you will be able to search the entire database and the results wont be restricted to the number of records currently being displayed. Below is the edited code for Page and Controller:
Controller: VF Page: You can of course add multiple filters here as well and change the controller and page code as desired.
Hope this helps!!
All Answers
Visualforce Page: Controller: Let me know if this helps!
@siddharth Mani
How can I filter the Subject and Call Result?
http://codebug.eu/?p=30
This will work for records that are being currently displayed on the VF Page and will give you dynamic results. Below is the edited code (Controller code remains the same):
Second approach is using Apex changes ie change in controller code. Using this you will be able to search the entire database and the results wont be restricted to the number of records currently being displayed. Below is the edited code for Page and Controller:
Controller: VF Page: You can of course add multiple filters here as well and change the controller and page code as desired.
Hope this helps!!
@siddharth
A couple of question if you can answer them.
- I added a filter but doesnt seems to search on subject as a tests.
<apex:inputText value="{!Subject}" label="Subject"/>
- I was able to put the sidebar="false" to remove the options on the side, but can I can actually put the search on the sidebar?
- I'm assuming this is only for ActivityHistory? Can I link a field from a different custom object that is searchable too?
- Finally, uploading the VF & Apex from inbound change set gave me a code error that its only 70%. How can I test this so maybe I can change the code?
Thanks again
If you are talking about the second approach though, you will have to change the controller code as well and not only add an inputtext on the vf page. Check the flow like this:
Button pressed -> fetch method called -> method executes query -> results from query go to the tskList -> pageblock gets rerendered -> updated results are displayed
So essentially when you add a new inputtext on the page for a different filter (or maybe combine both filters), you would need to change the controller code (most importantly the query being executed) so that the results contain the updated list to be displayed. Just remember that the pageblocktable is only displaying whatever is there on "tskList" varialbe in the controller. If you are able to backtrack the same, you will be able to modify the controller and page to suit your needs.
For the second part of your question, I have no idea how to test this yet. Even I am new to salesforce and apex and dont have much exposure to the testing part. Just a suggestion though -> Open developer console and check the red lines which are not getting covered by your test class -> You can then work only on those parts specifically and search around as to how to cover those lines in your code.
Hope it helps!!