Hot answers tagged

20

There seems to be some confusion around this question. The question asks specifically how to increase modal width when the modal is opened by a lightning action button. Some answers will work when the custom component creates the modal, like adding .THIS.slds-modal__container{ max-width: 70px !important; width:70px !important; } to the component style ...


14

This should be doable by passing an argument of type ApexPages.Action to the component <apex:page standardController="Account"> <apex:form> <apex:pageBlock title="My Content" mode="edit"> <apex:pageBlockButtons> <apex:commandButton action="{!save}" value="Save"/> </apex:pageBlockButtons> <apex:...


12

I resolved the issue with adding an attribute to the component and, set the account Id to the new attribute as follows and referred it back in the doInitit() helper method. New Attribute in component <aura:attribute name="accountId" type="String" /> Changes to the script inside the .VFP (setting the value to the accountId component attribute ) var ...


11

As it turns out the overflow properties had to be set to visible not just on the slds-scrollable_y class but also on the slds-scrollable_x class. Problem solved.


10

You can also create an @InvocableMethod that takes in a List of a custom class. By doing this, you can pass in parameters in the Process Builder public with sharing class ActionForProcessBuilder { @InvocableMethod(label='Do Action') public static void doAction(Request[] requests) { // Process requests // Example: Query parents in ...


10

Okay, So I had the same requirement where I needed to increase the pop-up size. So I have gone through various link also this. But none of them seems working for me. I tried to put the css suggested by @Amulyaranjan in style class but that also didn't work for me. it seems like component css load first and than the component css override that css. Other ...


10

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/...


8

Every property returned should be annotated as @AuraEnabled. public class Data { @AuraEnabled public List<Opportunity> Opportunities { get; set; } @AuraEnabled public String Text { get; set; } @AuraEnabled public String Text2 = 'text2'; public Data() { this.Opportunities = new List<Opportunity>(); ...


8

You can pass the standard controller to the component, allowing you to invoke its functions normally: public class ComponentControllerClass { public ApexPages.StandardController pageStandardController { get; set; } // Needed only because we are providing a second constructor public ComponentControllerClass() { } public ...


8

I've eventually found a solution. The following script has to be included: <script type='text/javascript' src='/canvas/sdk/js/publisher.js'></script> Then use this line to close the Quick Action window: Sfdc.canvas.publisher.publish({ name: "publisher.close", payload:{ refresh: "true" }});


7

Analysis Conclusion You do not need to return a PageReference for rerender to understand when the action has completed. So if you have a method that will never cause a redirect, you can make it void after all. Still looking for documentation one way or the other. At the bottom I have included my code used to support this conclusion. All four buttons in the ...


7

The behaviour is mentioned in the docs here Use $A.getCallback() to wrap any code that modifies a component outside the normal rerendering lifecycle, such as in a setTimeout() call. The $A.getCallback() call ensures that the framework rerenders the modified component and processes any enqueued actions. Hence use that in your code like below var delay = ...


7

You can refer to the documentation here basically, you have implement the force:hasRecordId attribute: <aura:component controller="yourControllerifany" implements="force:hasRecordId"> declare it in your component: <aura:attribute name="recordId" type="Id" /> and in your client side controller, you should be able to fetch the record ID: "...


6

This is an alternative strategy that should achieve the same goal. Define an interface with one method Implement the interface in the controller Make the component parameter be type [the interface you defined] Pass the controller into the component Call the method on the passed in controller Some minimal bits of code: public interface ActionInterface { ...


6

try action="{!quickSave}" Standard Controller action


6

Yes, you can. You can use the onclick attribute like below. <apex:commandButton value="Search" action="{!objectCollection}" onclick="callJSFunc()" style="margin-left:10px" reRender="source_search"> <apex:param name="source" value="true"/> <apex:param name="target" value="false"/> </apex:commandButton> UPDATE Based on ...


5

While lookup and master-detail fields are supported, this is only in terms of being able to reference a value from another field. So I have a scenario where an account can only have opportunities with a specific pricebook, so I have populated a lookup to the pricebook on the account object. I can then predefine the pricebook on a "new opportunity" ...


5

The answer for #3 (about parameters as a singleton) is a straight up no: There can be at most one input parameter and its data type must be one of the following: A list of a primitive data type or a list of lists of a primitive data type – the generic Object type is not supported. A list of a user-defined type, containing variables of the supported types ...


5

Put the below code in the controller action method that is being called on click of command button PageReference pr = new PageReference('/apex/yourVFPageName'); pr.getParameters().put('key','value'); pr.setRedirect(true); // If you want a redirect. Do not set anything if you want a forward. return pr; Edit: In the constructor of the 'yourVFPageName' page ...


5

Here's what I would do... Locate the Apex Class in the offending org Go to Develop | Apex Classes | the class See if the Status says it is active. If not, step 4 Use Developer Console or Setup | Develop | Apex Test Execution and run the tests for that class. This should make the class active and available for use in Process Builder (adapted from a similar ...


5

To make sure you have access to class variables, bind this to the function: { type: 'action', typeAttributes: { rowActions: this.getRowActions.bind(this) } },


4

I found a way to rerender the rows while only processing the row you're on. I will try to outline the concept here but a a full description of my solution can be found here: Visualforce: Dynamically ReRender a row within <apex:repeat> by passing $Component through controller Clarify Action Region: As you probably already realize, the actionRegion ...


4

I found 3 strange reasons why the addMethod wasn't being called. I'd love to hear from anyone that has any ideas on the why, or where I might be wrong. OnClick attribute For some reason the onClick attribute on the apex:commandButton was preventing it being called. This includes if I left it empty, or just had a 'return true;' or 'return false;' in there....


4

I'm using a storable action (to get some metadata) that is called from multiple components. I see the behaviour mentioned in the Storable Actions documentation that when multiple requests are made for the same key: The responses to idempotent actions can be cached and quickly reused for subsequent identical actions. For storable actions, the key for ...


4

When viewing the Activity composer related list, you may notice that some activity actions within the lightning experience do not appear on records even though those actions have been added to the Salesforce1 and Lightning Experience Actions section. Example: -New Event -New Task -Log a Call If any of the actions above are missing and you have checked ...


4

You need to make sure that any actions you're calling are called within the framework lifecycle. This typically means that you need to use $A.getCallback in situations where you're not responding to a Lightning Event or a Lightning Callback in order to let the framework know that you're modifying the component or trying to invoke an action. You can read more ...


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

No, it's not possible. What you can is:- Customize the buttons on the list view i.e in your case, you can add a button near the new program button. Add or remove Custom buttons In Aloha For standard objects i. From Setup, click Customize | then click the object you want to modify | click Search Layouts. For custom objects i. From Setup, click ...


4

You should actually need to use JSON syntax to pass params using action.setParams() method. So in your case you need to pass it either like this: action.setParams({str:sear}); Or like this: action.setParams({"str":sear});


4

Oh man... of course, it was a case issue. here is the proper casing for the post payload: payload = { 'inputs': [{ 'SObjectId': '0034F000005RUTOQG5' }] } SObjectId vs sObjectId (╯°□°)╯︵ ┻━┻


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