59

Assuming your not adverse to a bit of Apex I would recommend you use the StandardSetController for most of this. It is specifically designed to be used with VF pages that extend the ListView and selection functionality. Here is an example I created for you, called Bump Case Priority. It presents a page to confirm the changes and then a Confirm button. I ...


20

You have a few options, you could use an apex:enhancedList on your Visualforce page, which is covered in the documentation here. <apex:page> <apex:enhancedList type="Case" height="300" rowsPerPage="10" id="YourListViewId" /> </apex:page> Alternatively you can use a Standard List Controller (with an apex:repeat, apex:dataTable or apex:...


17

Read about GETRECORDIDS, there's a nice example associated. You might come to conclusion you don't even need VF page for that :)


11

JavaScript Custom Buttons. I have not been using JavaScript Custom Buttons for a while now, not only are they slower to respond in some cases, for reasons I've never really got to the bottom of. But they force us to expose global / web service classes for code that would otherwise be internal to our solutions. Visualforce / Apex Custom Buttons. As you've ...


11

Yes you can create list view from Apex. You can run the below code in the developer console to see a list view being created on a custom object. This is a little crude way of doing it. You can consume the Metadata API WSDL and then use that to create the list views, which is more cleaner way of doing it. :) HTTP h = new HTTP(); HTTPRequest req = new ...


7

I'm assuming that you have a Visualforce page that uses the <apex:listViews> tag with the type of Case. For example: <apex:page> <apex:listViews type="Case"/> </apex:page> You need to remove the buttons from the Search Layout for the Cases List View. Doing that will remove them from your Visualforce page if you used the <...


7

Not quite sure I've understood you correctly, but for your first requirement you can actually retrieve a list view ID in Apex by using a StandardSetController for the object in question: Database.QueryLocator ql = Database.getQueryLocator('select id from Custom__c'); ApexPages.StandardSetController setController = new ApexPages.StandardSetController(ql); ...


7

Kudos to @SFDCGOD for suggesting this. I was so intrigued by his suggestion, I gave it a try. First, I created resources for each of the Javascript files (FileSaver.js and jszip.js) and then created a simple Visualforce page referencing them so I could use it as a listview button: <apex:page standardController="c2g__codaInvoice__c" recordSetVar="...


6

I believe the documentation is just not updated for the REST API. I took a cue from Daniel's answer and tried to see what would happen if we pass the properties in the parameters of the rest query.. VOILA!!It worked and surprisingly it returned huge volume (max I have tried is 5k) of records too. https://cs80.salesforce.com/services/data/v34.0/sobjects/...


6

You can do following to achieve this: Add following javascript in your page FileSaver.min.js Blob.js jszip.min.js Pass All Id's to controller and just get there data by getContetnAsPdf one by one (Just create then Attachment object,don't insert them) Save them to a javascript array Convert them to zip file in javascript Download them using FileSaver....


6

From this Salesforce help page, the answer appears to be "no": List views display and behave differently in Lightning Experience. You don’t go to a new page to create a list view. Instead, you stay on the same page and give the list view a name in a pop-up dialog box. You add filters to customize your list with a panel that slides out on the right ...


6

You can create a Visualforce page using the standard list controller, and define it as a list button. Refer this link: Adding Custom List Buttons using Standard List Controllers These display as expected in Lightning: You can create new actions for your objects, in the form of buttons and links, by defining them on an object. JavaScript buttons and ...


6

JavaScript buttons don't work the way you expect, and I'm pretty sure that the code you're trying to use won't work. That said, you have an alternative you can use (tested/verified). First, create a new Apex Class: public class CaseAcceptOwnership { PageReference cancel; Case[] records; public CaseAcceptOwnership(ApexPages.StandardSetController ...


6

You need to add a formula field to the custom object Type checkbox Is_Created_by_Running_User__c formula: CreatedById = $User.Id Then your filter in the listview is Is_Created_by_Running_User__c = TRUE


5

I ran into this recently. It is not possible to do. Here is an idea to vote on: https://success.salesforce.com/ideaview?id=08730000000BpRoAAK.


5

There is 1 important thing you will need to check: Make sure your visualforce page which overrides the "New" action on the opportunity is marked as "Available for Salesforce mobile apps". To set this, in the setup menu, go to your visualforce page (Develop > Pages), open the visualforce page there and there you will be able to set this checkbox.


5

This is how the role hierarchy works. Given Alice in role A, Bob in role B, and Charlie in role C, where both B and C report to A, gives the following sharing profiles: Role A includes Alice Role B includes Alice and Bob Role C includes Alice and Charlie Roles and Subordinates A includes Alice, Bob, and Charlie Roles and Subordinates B includes Alice and ...


5

One thing you can do is define your list and filter and then call it using URL. https://na3.salesforce.com/00Q?fcf=00B90000008505L here fcf=XXXX is the id of list view. Note that the criteria is predefined and can not change dynamically. If you wan to to change filter dynamically then you will have to write your custom page with VF & APex.


5

You can, actually, change the list view criteria dynamically. Start by pulling up the list view you want to call and clicking into the Edit screen for it. Here you need to do 2 things: Copy the URL. Right click on the criteria field where you'll be passing in a value. Click on Inspect Element. (Note: I've only tried to set the filter values via parameter ...


5

Create a formula field (IsItemOwnerLoggedInUser?) with return type as checkbox and set it to true for currently logged in user. Item_Owner__c == $User.Id Create a new view and in the filter criteria, enter "IsItemOwnerLoggedInUser" equals True


5

You can also choose a view from the dropdown next to the tab in Winter 17'. Took my team a bit to notice!


5

List View Buttons Not Available in LEX To Answer the statement "All my list button aren't available in lightning experience", any onclick javascript button that you have in salesforce classic will not appear in Lightning Experience. Hence you will have to use custom visual-force buttons and standard SetControllers and recordSetVar to get the multiple ...


5

This might be helpful - https://developer.salesforce.com/blogs/developer-relations/2016/09/take-the-first-steps-ways-you-can-replace-javascript-buttons.html You can create a Lightning component to perform the mass actions and load that component in the visualforce page using Lightning out and then you can add that visualforce page on custom list view button ...


5

List view fetching for custom metadata types are bit tricky. If you retrieve a List View on a Custom Setting/Custom Metdata along with the Custom Setting/Metadata object when using Metadata API in a single transaction, the List View information is not retrieved. You have to retrieve both separately. Suppose: MetaData Object Name: MyObject__mdt ...


5

You can't redirect in Apex, because redirects require PageReference, and PageReference doesn't support having a single query string key with multiple values. However, you can do this in JavaScript by constructing a URL that passes in multiple ids values: /apex/pagename?ids=recordid1&ids=recordid2&ids=recordid3... This was mentioned in a post from ...


4

The scope of a listview looks weird both in listview documentation and in Force.com IDE (examples at the bottom of the linked page). It's not like there's a hidden filter that goes OwnerId = User.Id... You could try making a numeric formula along the lines of IF(User_Lookup__c = $User.Id, 1, 0) and then referencing it in your filters?


4

This is a per-user setting. Each user can choose the size of the list views from 5-200 per page. This setting will persist for that user (except for limited broken list views, such as the class list view). There is no setting anywhere that allows admins or even normal users to configure it. This value persists across user sessions, meaning that this setting ...


4

Generally, no. There isn't an Apex API specifically for creating list views. List views are stored as Metadata. See the ListView Metadata documentation. <?xml version="1.0" encoding="UTF-8"?> <CustomObject xmlns="http://soap.sforce.com/2006/04/metadata"> . . . <listViews> <fullName>All_Mileages</fullName> &...


4

From what Ive been able to gather the names that appear in the Metadata API for ListView columns are the backend Oracle DB names and there is no public API for translating them to the salesforce native names. Custom columns should come through with the appropriate names and if necessary the Oracle names can be manually mapped to the native names, unfortunate ...


4

Presumably you are aware that Salesforce is making this sort of code harder to add - see End of javascript sidebar hacks?. If you can detect (e.g. by the presence of an element of a certain class) when the rendering is done, then you can poll for that using JavaScript's setTimeout: function checkIfThere() { // Check for the element and do whatever you ...


Only top voted, non community-wiki answers of a minimum length are eligible