11

Your component needs to implement lightning:actionOverride. This is only available starting in Summer '17 and you can find the whole documentation here.


9

You can use the $ObjectType global variable to get the key prefix: retUrl='/' & $ObjectType.RelatedProfessionals__c.keyPrefix + '/o' You can't use it here, but with some SObjects, you can use the $Action global variable to get the tab: retUrl=URLFOR($Action.Case.Tab) Unfortunately, the only supported types are: Ad group Campaign Case ...


8

In my experience building AppExchange apps, in particular working on Skuid, which heavily relies on overriding Salesforce Buttons/Actions with Visualforce Pages, you will have to rely on your users creating some local VF Pages within their local orgs --- otherwise, as you have realized, you are in a Catch-22: you'd think you could just include UserInfo....


8

You can add the nooverride parameter to the page to get back to the normal page. Using your example URL: https://na15.salesforce.com/500/e?nooverride=1&00Ni000000BGRVE=Communications&00Ni000000BGtUJ=Survey&00Ni000000BH0li=General%20Questions&cas8=Low&cas7=Closed&retURL=%2F500%2Fo If you are using URLFOR, you can also specify TRUE as ...


8

No, users can't modify managed code, including Visualforce pages. Instead, you should offer your functionality as a component, and an unmanaged page template for the administrators to modify at their leisure. The default template might look like this: <apex:page standardController="Account" extensions="namespace.MyExtension"> <!-- put your code ...


6

URL Hacking is only going to help with populating values on the newly created record, it's not capable of updating related records. You're only real option for this is to use a trigger that updates the lookup on the opportunity whenever the contract is created. As an aside, you might take this a step back and see if you really need that extra lookup. ...


6

There is a solution that does indeed work, but it's a bit fragile because it's parsing the entire URL (assuming a structure that could change): https://developer.salesforce.com/forums/?id=9060G000000UaqdQAC (look at Pascal Le Clech's answer). However, we can build on this idea and make it more structurally sound by using https://developer.salesforce.com/...


5

You can't, because the validation rule only fires when an actual DML operation occurs. The first time, no DML operation occurs because the Close Case button just takes the user to a page where they can try to close the case (similar to if they click Edit, they are simply taken to a page where they can try to edit the case). It isn't until they actually ...


4

Visualforce Pages and Action Overrides. Currently there is no context other than that passed in the standard controller given to you by the platform. Which really just gives you the SObject and not the action invoked apone it. However this allows your controller code to be generic at least. Allowing you to reuse a controller between different pages... ...


4

Metadata API states: "You can only access ActionOverride by accessing its encompassing CustomObject." This is in the docs for the API. Check out the code example there and you'll see it looks a lot like yours, only wrapped in CustomObject, not Package.


4

No, they will not be able to edit the page. The cleanest solution for this problem would be to generate the fields displayed dynamically based on field sets. Here is an excellent article on using field sets to create VF dynamically. You would probably need to create multiple field sets for different sections of the page etc. Here is a sample of what your ...


4

First, I'd recommend not using String.equals: it is case sensitive. Just use the normal == equals comparison. Second, I'd recommend using a Custom Label to avoid hard-coding the value in your code. Third, public Id RecordId { get; set; } could also be written as Id RecordId;, unless it needs to appear on the page. All that aside, to test this, you just need ...


4

You could redirect with action attribute of apex:page tag based on contextfrom $User.UITheme and add nooverride=1 parameter when page is running in Lightning: Here is an example, tested it, seems to be working. Would be awesome to generate the URL dynamically instead of hardcoding. <apex:page standardController="Contact" action="{!(IF($User.UITheme ...


4

As of today, you cannot capture the "parent context" on a lightning component invoked from a related list. We have had a similar situation and found out that it is not possible and ended up creating this idea requesting for a feature around this. The alternative that we came up was to create a custom button on the parent record itself and then create the ...


4

There is a yet undocumented state property that helps here: this[NavigationMixin.Navigate]({ type: 'standard__objectPage', attributes: { objectApiName: this.type, actionName: 'new' }, state: { nooverride: '1' } });


3

This will lead to a lot of conditionally rendered tags. You might consider having separate page for "view" and separate for "new/edit" but use same controller extension if you really want. But if you're determined... You can look at the URL that was used to navigate to your page and combine it with presence of Id in the standard controller. I've called my ...


3

In general, the approach is to add URL Parameter Conditions to your Model on the Lookup/Master-Detail field in question, as these Conditions will be applied as default values when creating new records in this Model. The specific URL Parameter(s) that you need to listen for depends on your initial entry point(s) into your overridden Skuid page. If the ...


3

You could achieve this by using the action propriety of apex:page Create a new Visualforce page with only this line <apex:page standardController="Order__c" action="{!URLFOR(CASE(Order__c.RecordType.Name, 'OrderScan', '/apex/vfp1' ,'OrderFill','/apex/vfp2', '/apex/vfp3'))}" > <apex:variable value="{!Order__c.RecordType.Name}" var="recTypeName"...


3

Why not do the redirect in the Visualforce page itself using the controller or extension for the page? Call an init method in the page's <apex:page> tag: <apex:page controller="MyController" action="{!Init}"> <!-- etc. --> Then the controller would look something like this: ApexPages.StandardController sc = null; public MyController(...


3

This is one of the limitations of overriding buttons. Currently, the button override feature only works in the Salesforce desktop browser UI. Basically, Visualforce is only surface through the Salesforce1 mobile app in the following ways: A tab (the left hand nav bar navigations) Publisher actions Mobile cards (a custom piece of UI in the related records ...


3

If you want to create a List button, you need to specify standardController and recordSetVar attributes on your <apex:page> tag. You cannot use the controller attribute in conjunction with these attributes, so you will have to modify your code to fit within the extensions attribute instead. <apex:page standardController="MyJunction__c" ...


3

Please look for the checkbox highlighted in attached image Skip record type selection page. This way, you can stop the first standard popup hidden. For record type selection, you can write another component which will query available record types. From custom record type selection component, you can pass selected record type id to new account custom ...


3

I am assuming you are trying to create a new child record on an Opportunity, using the New button on related list. Your lightning component must implement lightning:actionOverride and force:hasRecordId interface. You must also manually override the New button on the child object with the lightning component you created. Doing so, Salesforce will ...


2

You can't override that particular link unfortunately. One options is to re-create that list using a Visualforce page, and then put that page into the home layout in place of the approvals section. Querying for existing approvals is quite easy, then you'd just loop over them and provide links to the VF page you want the user to go to.


2

Thinking about it something like this should work: private Task t; public MDIController(ApexPages.StandardController stdController) { t = [SELECT Id FROM TASK WHERE Id =:ApexPages.currentPage().getParameters().get('id') ALL ROWS]; } The only issue is that now you have to manually specify all the fields you need instead of letting them be inferred from ...


2

You can't use URL hacking on a Visualforce page unless you have put some JavaScript in your page or controller code that will pull the values from the URL and use them to populate input fields or properties. I'm not sure why you'd need to use a JavaScript button to pass parameters on a URL - a URL button would be a better choice as you don't have to manage ...


2

To answer your initial question: "If I use custom VF page to override the Save functionality @ Opportunity level, what will be the impact on the Triggers, VAlidation Rules and any other codelinked with the entity?" triggers, validation and workflows happen at the platform level, and no matter how an object is saved to the database, they will fire.


2

I think it's the way that you're attempting to nest inside that URLFOR. Try restructuring it so that the Id param is outside the CASE (since it's gonna be the same no matter what), and also don't use quotes around those $Action references. maybe like this (whitespaced for readability) <apex:page standardController="Abv_Core_KAM_Engagement_Plan__c" ...


2

You need to include the appropriate URL params that tell the standard Save (saveURL) and Cancel (retURL) buttons where to go. These should go in your URLFOR function where the null currently is: URLFOR($Action.Account.Edit,Account.Id,['retURL'=cancelDestination, 'saveURL'=saveDestination],true)


2

There's no way to discern whether the View action or the Edit action was used to visit your VF page. In both cases, the ApexPages.currentPage().getParameters() will contain just an 'id' attribute -- it will not be decorated with anything else. The only solution is to create a separate redirect page for the Edit or View actions so that you can distinctly ...


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