3

We are using the "DatePicker" visualforce page for a conga button, as described on their site here:

https://congasphere.com/FuzeExtract/how-tos/How_to_create_a_DatePicker.htm

When the compiled URL from the button that is passed into the visualforce page exceeds 2048 characters (exactly),the visualforce page cuts off all query parameters, so I'm left w/ a URL of:

//c.cs7.visual.force.com/apex/DatePicker:

vs the normal, which is a good bit longer: http://pastebin.com/NB6cY2Wc

I have tested this in chrome and firefox, which i believe should be able to handle a much longer URL length. So wondering if there is an existing limit on url length for a visualforce page (couldnt find one), and if so, any thoughts on how to design around it.

SFDC documentation indicates that the button length should be ok (cant paste the link b/c i'm a noob to stackexchange)

"A link URL can be up to 3000 bytes. When data is substituted for the tokens in the URL, the link may exceed 3000 bytes. Your browser may enforce additional limits for the maximum URL length."

The code Conga provides is javascript. Could switching from Javascript to Apex help?

Thanks

7
  • I believe its a browser restriction and char limits are not enforced by Salesforce. Take a look at stackoverflow.com/questions/417142/…
    – Rao
    Commented Jul 13, 2015 at 21:49
  • Thanks @rao, docs indicate that IE < 11 is limited to 2048, but FF and Chrome and Opera can go way above. Have tested w/ Chrome and FF.
    – gorav
    Commented Jul 13, 2015 at 21:58
  • Looks like its not a visualforce issue, even if I change the url to an external site, all query parameters are cut off when length is > 2048. Issue may be w SFDC button generation
    – gorav
    Commented Jul 13, 2015 at 22:34
  • what is your button code, can you paste it?
    – Rao
    Commented Jul 13, 2015 at 22:36
  • 1
    Finally getting to the bottom of this. Support clarified that SFDC automatically changes from a GET to a POST when string is over 2048 chars. Inspect element shows the difference. All the fields are still available, but the javascript as designed cant hit them since they are form fields, not in the URL. Support indicates that I can use $CurrentPage methods, which will work on GET or POST.
    – gorav
    Commented Jul 22, 2015 at 15:57

1 Answer 1

2

Finally getting to the bottom of this.

Support clarified that SFDC automatically changes from a GET to a POST when string length goes over 2048 chars.

All the parameters are still available, but the javascript as designed cant hit them since they are form fields, not in the URL. Support indicates that I can use $CurrentPage methods, which will work on GET or POST. Looking at building a controller for the page to do the work that was being done via javascript as we have not been able to hit the form data via javascript so far.

We ended up working w a consultant who used $currentpage.url to pull in the parameters. However Salesforce pulls this in as a map, so all parameters must be unique. So we had to append a number to each queryID, and use some regex to strip it out when generating the querystring.

Here is the final version, with a few other bells and whistles added http://pastebin.com/RRp12UWb

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .