The Stack Overflow podcast is back! Listen to an interview with our new CEO.
13

I ran into the same issue and here's the answer: A visualforce page can be available for either a page view (that gets passed one ID) or a list view (that gets passed a list of 0 or more records). Here's what you have, and it works for the page view, and the ID of the individual record is passed as the page's id parameter. This doesn't make sense on the ...


7

Since you're dealing with a list of IDs, you want to use 'IN' instead of '='. The SOQL statement needs to end up looking like this SELECT name FROM obj__c WHERE id IN ('a0OaxxxxxxxxMRDy2', 'a0OaxxxxxxxxMRDy2') Edit by OP: it's been a while since I had the problem, but I've put this in my original post and as per Ratan's suggestion, I should mark this as ...


6

Visualforce list buttons are not supported in Communities. https://help.salesforce.com/articleView?id=community_builder_use_visualforce.htm&type=0


4

This is true. Not every object is supported by the StandardSetController class, which is the underlying functionality you tap into when you implement the recordSetVar attribute in your page. You will need to implement this as a custom Apex controller using lists, SOQL and offsets. There is a basic example of getting this to work in the Salesforce ...


4

You have to make the Custom Button as an onclick javascript button and then open the VF Page by passing the opportunity id as a parameter to the page (say call id oppId) and then pass that parameter to the flow.. so your Custom Button properties will be Display Type - List Button Behaviour - Execute Javascript Content Source - Onclick Javascript and ...


3

To enable a List Button, first define a Visualforce Page whose <apex:page> tag uses the standardController and recordSetVar properties. The former should use the child object on your related list, the latter just gives the list of records a name for you to reference in your markup. You can loop through them using just Visualforce by referencing the ...


3

update your query : sforce.connection.query("SELECT Id, Is_Picked__c,Last_Seen_By__c FROM Lead WHERE Id =\'"+records[0]+"\' LIMIT 1");


3

The $ObjectType global variable lets you merge in the type of SobjectType. You can specify things like the API name, label, and so on. Besides that, though, you can always get the SobjectType directly from an ID in Apex Code, so you might not even need that. Simply using Id.getSObjectType will give you an SObjectType token that you can use to determine which ...


3

You are not passing prodRecordsIds correctly. in execute method : Replace prodids:"{+ prodRecorIds}" with prodids:"{"+ prodRecorIds+"}" Always check error console while working with javascript.


2

You have to set your visualforce page standard controller as "Risk__c" in order to be shown up under list button.


2

I thought you might have been able to use it for both in spite of the use of recordSetVar but I guess not. I think the solution here will be to create an 'in the middle' Visualforce page that uses the Compliance_Incident_abv__c standard controller, and as part of an init action simply redirects to the existing page passing a single Id. So the page would ...


2

believe its a syntax issue in passing the parameter to the apex method you need a semicolon between the parameter name and value. its always better to declare and initialize your param value and use it wherever you need it. {!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/30.0/apex.js")} var myParam = "{!...


2

I think you should use the GETRECORDIDS function provided by Salesforce for just this sort of thing. It is used to select ids from any selected items in a list, be they a list view or a related list. Here's how you would use it: {!REQUIRESCRIPT('/soap/ajax/35.0/connection.js')} var selectedRecordIds = {!GETRECORDIDS($ObjectType.YourSObject)}; if (...


2

With the new Winter 17 release you can Launch a Lightning Component from an Action So if your modal would be this lightning component, you can launch it as an action


2

Chrome is blocking the insecure request to http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js. Either change it to https or remove that line since you aren't using jQuery in your code anyways.


2

The GetRecordIds formula literally does what it says: it gets the list of Id values the user selected. If you want the account names, you have to use sforce.connection.retrieve or sforce.connection.query to get those values. You'll want to read the Ajax Toolkit developer's guide for more details. Here's an example using your code as a base: {!REQUIRESCRIPT(...


2

They're javascript variables, so they won't work in merge fields. You need to manipulate them via javascript to get the correct value. The first step is getting a Date instance. var startDate = new Date(crtvtracker.Creative_Start_Date__c); There are a lot of niceties of date parsing in Javascript. While the above may work, it is probably unreliable and I ...


2

The issue is shorted now , To update current page URL on navigation to other page, we should use "this.parent" for constructing URL. Thus, replacing window.location.href with this.parent.location.href is the answer. window.location.href will navigate you to the correct page but the URL will persist as the older one only.


2

I think you can take this approach. From your javascript button, launch a flow and pass parameters to the flow. In the flow, place a date field where user can select the date. Finally based on passed parameters you should update the case records. I have given a code how you can pass parameters (CaseIds) to the flow. Code behind javascript button {!...


1

If you try to create a button, you'll notice a $Profile variable. This variable exposes nearly all the fields on the Profile object in Visualforce and Custom Buttons. This lets you create a Custom, On-Click Javascript button, and use a if statement or two, to redirect the page accordingly. if ({!$Profile.Name = "Local Agency"}) { window.location.href = ...


1

You will need to make this Visualforce page available for your Profile you see this error on. Follow the steps below in Salesforce Classic. Setup > Manage Users > Profiles Scroll to the Profile you see this error on and click on the Profile Name In the Enabled Visualforce Page Access section, click Edit. Find your Visualforce page within the Available ...


1

this is incorrect: window.location.href = '/apex/RecordTypeX_VF?' +'&retURL=/'+recId ; you have an & after the ? Change to window.location.href = '/apex/RecordTypeX_VF?retURL=/'+recId ; Also, you should look into URLFOR instead for constructing the url


1

As far as I know, right now there is no way to customize it on this level. I can propose only to create Custom Visualforce page with "List View" functionality for Customers.


1

Got the solution with lots of r & d :) Just need to add visualforce page url in saveURL window.location="/a0c/e?CF00N21000000jtT8={!Bundle__c.Name}&CF00N21000000jtT8_lkid={!Bundle__c.Id}&saveURL=/apex/BundlePageLayout?id={!Bundle__c.Id}&retURL=%2F{!Bundle__c.Id}" Hope this will help others if issue raised !!


1

You need to have a Visualforce Page which implements a StandardSetController for the object in question. So if it were a List Button on the Task object, you would use this markup: <apex:page standardController="Task" recordSetVar="tasks"> If you wanted to add some Apex your markup would change to: <apex:page standardController="Task" recordSetVar=...


1

Using {!GETRECORDIDS($ObjectType.Lead)} only the Lead Ids is returned as Array.You need to query Lead object using the collected ids, to get the respective leads fields: Country__c,TypeOfInterest__c. Doc to the sforce examples can be found here. {!REQUIRESCRIPT("/soap/ajax/16.0/connection.js")} var leadIds = {!GETRECORDIDS($ObjectType.Lead)}, url = ...


1

So basically you have to use VF page so when you try to create service record picklist option should populated with webservice retured values. You need to override new button of service related list so onclick of that button user should redirect to VF page. Pass your Opportunity_carset id in url and get that id in VF page controller. Based on ...


1

You can use action function. https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_actionFunction.htm Action functions can be called from javascript and can return values which you can process in javascript so you can alert user via javascipt popup of the function returns success or not.


1

If you mean buttons like "New", to insert a new record, you can just edit the user's profile permissions to not allow him to create new records of that object. If editing the profile isn't suitable for you, you can go to Setup > Create > Objects > YourObject (for Custom Object) and search for YourObject List View in the Search Layouts section. When you ...


1

I think the answer to your question is maybe. Up until a couple years ago, asking support to disable validation of CSRF token on GET requests did the trick for allowing save=1 as a parameter in URL hacks. It's no longer possible. If you don't need to automatically save, then you can still do URL hacks. Is there a particular use case you're trying to solve ...


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