Having issues with fields/permissions in Salesforce Sites (Accounts Related) - salesforce

Hey guys I really need help with setting up sites:
I have a visualforce page that I am setting up in sites and I have gone through the profile (guest sites user) and given them all the relevant access settings for the objects, visualforce pages & the apex classes.
My page render fine when I access it internally (through SALESFORCEURL/apex/page) but when I access it through the sites URL it has an issue rendering the fields.
Basically I have an account record which I prefil using an ID in the URL Parameter (this is all working and testing via the internal visualforce page). In the internal page it appears as a prefilled editable inputText box which I can edit and submit fine. In sites the fields appear as a non-editable outputLabel that of course I can not edit, and this is the entire purpose of my visualforce page.
Does anyone have a work around for this? Or at least a solid reason as to why it works in the internal visualforce page but not from sites?
Thanks

Related

How do I find out where a Visualforce page is being used in my Salesforce org?

I am fixing soql injection errors in my Salesforce org. How do I find out where that page is being called from in Salesforce? I tried looking at the 'Where is this used?" button under setup/Visualforce page/edit/ and it just shows me the test that it is being called from. I checked the show dependencies and it shows me the controller that it is associated with. I can't seem to figure how I can access the page in Salesforce so I can do a manual test on it.
Create a sandbox and try to delete it in there. If page is "properly" used - dependency should block the delete. Can be custom VF tab, button, link, embed on page layout as iframe... Can even be in community or Site as a login page for example.
If you have the project in git or sfdx you could try searching for page's API name.
But pages can be also accessed freestyle, in classic UI you used to just /apex/vfpagename in the address bar. In lightning it's bit more complex but doable for a determined user.
If you want to block access while you fix it - remove right to use the page from profiles / permission sets.
https://salesforce.stackexchange.com/a/12672/799
https://lightning-configuration.salesforce.com used to give some info about VF pages usage (count of hits I think) and there's whole Event Monitoring module paid extra (standalone or as part of Salesforce Shield) too

Salesforce Lightning - how to set nooverride for Lightning, but retain override in Classic

We are planning to migrate our users from Classic to Lightning with a phased roll out. That means we need to retain all the behaviours of Classic and Lightning in parallel for a period of time.
That's working well, except for Button Overrides. There doesn't appear to be a way of configuring Lightning to use the standard edit behaviour, while Classic retains an edit form override. For classic the options available are No Override, Custom S-Control and Visual Force Page. However, the only options available for Lightning are Lightning Component or Use the Salesforce Classic override. There's no option for No Override.
We tried writing a custom Aura component to re-direct to the edit page with ?nooverride=1 but that doesn't work - the user is re-directed, but once the edit page is closed and saved, the user is left on a blank page, not re-directed back to the view of the edited page.
Does anyone have a workaround, or explanation as to why this seems not to be possible ?
whenever you specify a Url as a retURL parameter Salesforce will redirect to that url.
Now in Salesforce Classic view page means xxx.salesforce.com/IdOfRecordToView so You can try retURL parameter in URL with the value of Salesforce Record id which you are editing
example : xxx.salesforce.com/a010000000000qn/e?retURL=%2Fa010000000000qn&nooverride=1

Lightning experience deep link to custom Visualforce tab

Do you know if it is possible to deep link a custom tab on the left hand navigation?
In my web app I allow the user to login through SSO from Salesforce ( so I use salesforce as authentication provider ), than when the user credentials are ensured i redirect the user to the tab using an aspex url like the following:
https://{domain}/apex/{VisualforceTabsName}?sfdc.tabName={VisualforceTabsRef}
or a servlet integration link like the following:
https://na15.salesforce.com/servlet/servlet.Integration?lid={lid}&ic=1&linkToken={linkToken}
I got those links simply right clicking the tabs and copy the link, now this is not going to work on the new ligthening experience where the link is something like the following;
https://gs0.lightning.force.com/one/one.app?source=aloha#{token}
Now it seems to me that the token in this case is user specific, so it can't be used as high level reference to the Visualforce tab.
Do you know if there is a way to do the same in the Lightening Experience (Spring 16' release)? Or if there is a different way to achieve the same result?
Thanks
In Lightning Experience, you can reference custom tabs using the developer name of the tab (note that this is the API name of the tab containing the Visualforce page, not of the page itself). This URL should work:
{domain}/lightning/n/{tabName}
This assumes that you have already created a tab for your Visualforce page.

How to include Javascript on every Salesforce Page(for tracking/analytics) Home page component vs. Custom Button vs. Controller vs

To run analytics javascript on every salesforce page I want to insert Javascript in every page.
So far I read about a couple of different methods:
home page component
a HTML Home page component (need to customize UI to show the components on every page)
limitations: does not work for Chatter, Reports and Setup
possible issue: these comments indicate problems with 'winter 13'
Custom Button with Javascript
(don't know much about this yet) sound like one has to create/assign the buttons to object-types)
Custom APEX controller?
How would this work?
Visualforce page ??
How would this work?
To my understanding it would be possible to replace everything with visualforce pages, but this is obviously not very elegant/maintainable.
I'm curious to see what other methods there are, in partciular by modifying the controller?
What other things to consider (downsides, risks) with the presented methods?
Sidebar component sounds best suited for that to be honest.
Any button/link you'll add to object detail pages will both require clicking on it(!) and won't work on "tab view", "new record" or "edit" pages. You could override most of them with VF pages but that's A LOT of work and there's no way you'll be able to customize UI of these special places: Chatter, Console tab, Reports,Dashboard.
I'm not sure what do you mean by "modifying the controller", there's no such global thing you'd have access to.
There's option of embedding a small VF page into page layout of every detail page but it's equally limited in terms of maintenance and not being present on the new/edit pages.
There are better analytics options for Force.com Sites (not the least of them being the <site:googleAnalyticsTracking/> tag). You should also receive a monthly newsletter (typically with 2-3 month's delay) summarizing usage of your Salesforce instance, user adoption, areas to explore etc. If you don't - check your User's "receive salesforce newsletter" etc settings.

add new section to lead to call api depending on the lead url

I want to add new section to the leads to call api request depending on the lead website url
It's something like creating the web-based tab, but I want to ad inside the leads to get data from a website depending on the lead website url
You can have VisualForce pages inline in a page layout, but the height is fixed and I generally don't find it to be an elegant solution, but it may work well in your case depending on what information you're bringing back and whether the length needs to be dynamic.
I'd implement this as a Visualforce page, and then use a formula field on the link to create a link to the page based on the Lead's URL. Users could then click this link to popup a new window with your page and information.

Resources