32 votes
Accepted

Lightning App - getting URL parameter

In lightning whatever attribute you define can be passed as a query parameter . Lets take a look with sample example <aura:application> <aura:attribute name="whom" type="String" default="...
user avatar
14 votes
Accepted

String Value of ID returns more than ID

You're calling String.valueOf() on the Event Sobject itself, not the Id string. As written, your first line should be: EventIdString = String.valueOf( [select id from Event where Id=: (ApexPages....
user avatar
9 votes

String Value of ID returns more than ID

Technically, since you're passing the value as a String already, you probably don't need to query the value at all: TM.Meeting__c = ApexPages.currentPage().getParameters().get('EventId'); However, ...
user avatar
  • 438k
8 votes

Lightning App - getting URL parameter

Just adding this answer for completion of the thread with the latest release. After Summer 18 release (API version 43 and up) we can utilise lightning:isUrlAddressable interface. Implement lightning:...
user avatar
  • 1,672
7 votes

Dispensing URL hacks: proper method of pre-populating object fields?

If you use chatter, you could use actions to populate your defaults. More info can be found here. Here are some screen shots of a quick example of how it would work:
user avatar
  • 10.4k
7 votes

Requirescript change in Winter '16 release

We shouldn't have been doing those things in the first place. I would assume that by implementing these hacks, we've moved on thin ice and built features that could not be regression tested by ...
user avatar
7 votes

Requirescript change in Winter '16 release

At this point I guess the only 2 ways remaining open for a short time are Messages & Alerts and Custom Links, where you still can inject JS into standard Aloha Salesforce pages. Alternatively you ...
user avatar
  • 33.7k
7 votes

URL To A Record - Specify A Different Page Layout

You basically have three options: Change the RecordType of the record in question. Change the Profile of the running User Implement a Visualforce override Likely, only door number 3 is viable here. ...
user avatar
  • 143k
7 votes
Accepted

Replace ID with API Name

I believe the only way to to it would be to use a VF page as the Link and use an action method to navigate to the report. In the VF page controller query for the report by name: <page name="...
user avatar
  • 53.2k
7 votes
Accepted

How to deal with an optional field in Lightning URL hack?

After more googling, it looked as if URLFOR expressions were also valid for use in Lightning URL hacks. That opened up a whole new set of potential solutions. After much experimentation, I came upon ...
user avatar
6 votes
Accepted

Related Object Fields in custom button (URL Hack)

I can't actually find any hard documentation to prove it, but it seems that Merge Fields available in Custom Buttons & Links cannot access Related Object Fields, but only those fields on the ...
user avatar
5 votes
Accepted

URL hacking a report to pass a Date Literal filter value vs an actual date

You can use SOQL date literals, such as LAST_N_MONTHS:6 or LAST_N_DAYS:90.
user avatar
  • 438k
5 votes
Accepted

URL Hack working for some fields but not others. Why?

You are missing CF prefix for the user field.. hope this will work /a07/e?RecordType=012w0000000iaZ9&nooverride=1&CF00N20000003NRbz= {!Account.Name}&CF00N20000002kMy5_lkid={!Contact.Id}&...
user avatar
5 votes

Lightning URL hack issue with prepopulating fields on Page Load

First you create a lightning Application name myFirstApp which retrieve data from the url. if your URl is like this /c/ChooseCampaignApp.app?AccountId=001P000000eM5z7&ContactId=003P000000hlONG ...
user avatar
4 votes

How to access and not hardcode the field ID for a custom object? Using Apex, to construct URLs

There are these two techniques for getting the field IDs programmatically: Querying Custom Object and Field IDs via Tooling API - recently available and relatively robust Finding Visualforce fields ...
user avatar
  • 130k
4 votes
Accepted

Clear the contents of a lookup field when cloning a record

Solution: Similar to populating a custom lookup field using the URL hack, you need to set both the field label and it's value to the desired default, in this case nothing. Example: /{!Opportunity....
user avatar
  • 10.4k
4 votes
Accepted

URL Button for Salesforce1

You should be able to use the "Create Record" publisher action to define all the fields you want. You won't need to to use sforce.one.navigateToURL() to do this (and it wouldn't work as it doesn't ...
user avatar
4 votes
Accepted

URL to login and pre-populate more than one field

If you URL encode the start URL, then it will fill all fields. Note that you don't need to hard code the instance (na15.salesforce.com). A relative URL works just fine. startURL=%2F003%2Fe%3Fcon13%...
user avatar
4 votes

Lightning URL hack issue with prepopulating fields on Page Load

Option 1 If possible, you may consider reverting back to Salesforce Classic until (or if) Lightning Experience supports your needed features. It's not a complete product yet but is getting new ...
user avatar
  • 3,986
4 votes
Accepted

Error - Failed To Execute Flow - 301 Prefix - Process Builder

The URL format for going to a Flow is: https://INSTANCE.salesforce.com/designer/designer.apexp#Id=VERSIONID INSTANCE is your Org instance (na9, cs26, etc) VERSIONID is the version of the Flow ...
user avatar
  • 4,584
4 votes

Public Salesforce Site and Security Review

Will Security Review "kill me" for not having proper authentification Most likely. Aside from breaking the MSA or Sites TOU, improper authentication is a big no-no. I'm not even sure how I'd describe ...
user avatar
  • 438k
4 votes

Salesforce URL Hack not working in lightning, sf1

You can use Lightning Quick action of type create record with predefined values to replace your url hack in Lightning and mobile app. Any url hack is simply not going to work in Lightning and ...
user avatar
3 votes
Accepted

Access API/Sobject name from List Button

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 ...
user avatar
  • 438k
3 votes

Default lookup field to Account using URL hacking

The custom field ID for lookup fields comes in 2 forms, the field ID which takes in the name of the lookup record and also the field ID followed by _lkid which takes in the record ID. What happens in ...
user avatar
3 votes

Create a button on custom object that opens a new Event linked to that custom object

Yes you need to reference the html page element ids. For example tsk5 = Subject tsk3_mlktp = the related to object type (006 is opportunity, etc) tsk3 = the related to display name tsk3_lkid = the ...
user avatar
  • 2,862
3 votes
Accepted

How to create a Task with Due Date using URLFOR

What you are trying to do is referred to as URL hacking, which is not supported by Salesforce. You are correct that your solution could break should Salesforce make any backend changes. I would ...
user avatar
3 votes
Accepted

Update the Parent lookup field

If you were happy to override the page for creating a new parent record with a Visualforce page, then you when you do the url hack you could also pass the Id of the child record. The controller of ...
user avatar
3 votes
Accepted

Auto-populate lookup fields

Solution 1: URL Hacking without JS URL hacking doesn't require you to use javascript. I created a short video to explain the way URL hacking works a couple of years ago. The simplest way is to use ...
user avatar
3 votes
Accepted

Salesforce URL Hacking - Ability to remove the 'multiple items found' error

There is a nice tutorial that explains how to hack the URL here. Step 3 – Pre-populating lookup values You may have noticed that if you are following a similar example to mine, your lookup ...
user avatar
  • 10.4k
3 votes
Accepted

Logic in Custom Activity Button

What you are generating is a string, all in the context of the built in IF function. So, to evaluate this calculation correctly, you need to only have one {!} binding syntax call for the whole calc (...
user avatar

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