New answers tagged

0

The meta.xml file is missing the label, which is a required field. It's important to verify that meets files are in order when committing and deploying. It's pretty easy to accidentally modify one of these files without thinking about it.


0

When you enqueue a queueable, the system will generate an Apex job ID. You can use this job ID to check on the status of your queueable periodically so that your component is reacting to its status. ("Monitor Asynchronous Apex" on Trailhead is a good starting point) // ... inside some aura method that enqueues a queueable Id asyncApexJobId = ...


2

The Setters are not called when using the transient keyword and hence you may be seeing null in the body or title or any other fields. You can revert back to the non-transient version public Attachment attachmentRec { get { if(attachmentRec == null) attachmentRec = new Attachment(); return attachmentRec; } set; } ...


0

Rather than having to directly call the method through the controller like sfdcfox mentioned in his response, you could change the method from void to List<SelectOption>, rename to getVendorAccountNames, declare vendorAccountNames inside the method itself instead of outside, and return vendorAccountNames in order to take advantage of Visualforce Getter ...


0

After saving, you need to perform a "search" again to get the latest values from the database. Redirecting to "ApexPages.currentPage()" won't update the records in the page memory. public void save(){ for(Database.UpsertResult result: Database.upsert(caseList, false)) { if(!result.isSuccess()) { return; // show errors ...


1

You can use a Lightning App. Like a VFP, they are addressable via a URL: https://mydomain.lightning.force.com/my_ns/appName.app Which you write as: <aura:application extends="force:slds"> <c:myLwc /> </aura:application> You can also just add the lightning__AppPage target and and make a full page app if you prefer, though it ...


0

The issue was resolved the I removed all instances of required="true" from other fields within my VF page - I'm not sure why that caused an error with rendering, but it did!


1

It turned out to be that the page depended on some HTML files in Prod which were saved in Salesforce Classic under Documents. Documents don't get copied over, and so those dependencies were broken. Those HTML files were loading jQuery as well as some other things needed. I went into Prod, downloaded them, and had to go into Salesforce Classic to upload them. ...


0

It's possible that you need to set up permissions for your component to load the external jQuery library. Try going to Setup > CSP Trusted Sites and make sure you have an entry for https://code.jquery.com/. If there is no entry, click on New Trusted Site and add https://code.jquery.com/. Make sure you check the checkbox for Allow site for connect-src. If ...


1

Answering to your questions: What is the behavior of a formula field that is part of a SOQL query?: They behave as a normal field Does the running user/site user need to have access to all fields referenced in the formula? Or is access to the formula field enough? No, they do not need to, access to formula field is enough. You can check this What is the ...


1

You're basically trying to store the entire file in the view state, which causes this error. You need to omit the file contents from the view state using the transient keyword: public transient blob file1{get;set;}


0

When you open the VF page with lightningStylesheets = True from a classic user i.e when you are viewing salesforce in classic globally, it shows in classic feel. And when you view the VF page as Lightning User i.e., when salesforce is viewed in Lightning globally, it shows in lightning feel. I've observed the above behavior in my experience.


1

I ended up just making my own tables instead of using Related Lists.


1

The reason for this error is you have a typo here (space between { and ! ): action="{ !saveAccount}" should be action="{!saveAccount}" This won't be detected by the VF compiler but appears as a runtime error when you click the button


1

I tried to run this snippet in dev org and I see that you are trying to loop in action attributes over the list of accounts while saving them. To fix this, you can just simply ignore the loop while performing save action in your saveAccount() method in the AddMulAccountContr controller as below: public class AddMulAccountContr { public List<Account> ...


0

In Spring'21 Salesforce release, Get More Characters for Field-Level Help Text Customers can view the field-level help text by hovering over the Info icon. And with the character limit expanded from 255 to 510, you can now provide more detailed help information. This increase applies to standard and custom fields on detail and edit pages. Where: This change ...


0

I found this as resource when you want to preview your VisualForce Page in VsCode: It works for me after following these instructions on the next link. https://medium.com/@idanblich/open-salesforce-pages-and-lex-app-directly-from-vscode-38e889e1759a In the Link you will find instructions to add a tasks.json file in your project. After taking the succesfull ...


1

Since you're already using jQuery: function disableBttn() { $("[id$='ConvertBttn']").addClass("btn btnDisabled"); $("[id$='ConvertBttn']").attr("disabled","disabled"); return false; } querySelector only brings back the first matched item. You would want to querySelectorAll, or use the jQuery ...


0

Given the VF controller has a valid contactId, then creating a Case wouuld look like public PageReference submitCase() { this.feedback = new Case( ContactId = ApexPages.currentPage().getParameters().get('contactid'), Description = '...', Subject = '..' } insert this.feeback; return this.thankyou; } assuming that the ...


1

You have a few issues with the VF page: <apex:page standardController="Campaign" extensions="CampaignMembers"> <apex:form > <apex:pageBlock > <apex:pageBlockTable value="{!CampaignMember}" var="member"> <apex:column headerValue="Date"> <apex:...


0

So, the basic pattern you're going to need is the following: getter for the selectList - note the test for null value public List<SelectOption> DExtraList { get { if (DExtraList == null) { ...construct the selectList by querying the objects } return DExtraList; } private set; } action method that is signaled when product ...


2

You're passing a single Id objOpp.Id, but your method expects a List<Id> addTeamMember(List<Id> opptyIds) So, you can create a list and pass that to the method public pagereference addTeam(){ List<Id> opportunityIds = new List<Id>(); opportunityIds.add(objOpp.Id); addTeamMember(opportunityIds); } Or, depending on whether this ...


0

The link that you provide in the ConName field is the link to the account record. Try to change this link in : '/apex/YourVFPageName?id=' + tempConRec.Id. That should be the link to your VF Page.


1

Don't do it as a style, set the disabled property. <apex:commandButton id="canceldone" value="Cancel" onclick="OpenModel();return false;" styleClass="searchClass ordervalue btn btn-primary" disabled="{!IF( Industry == 'Enterprise', True, False)}" rerender="" > </...


0

Simply the Cases S/B Cases__r <apex:relatedList list="Cases__r"/>


0

Since API v40.0 there is a ContentWorkspaceMember which looks to be exactly what is needed. https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contentworkspacemember.htm


2

You would need to enable 'Track Field History checkbox' under object settings. Select Object Manager--> Click the custom object (Teacher__c) and click Edit--->Under Optional Features, select the Track Field History checkbox. Later add Custom object History (Teacher__c) related list on the detail page or you can run above query to check 'New Value' ...


0

The parameters you're using need to match valid variables. This means that: email.setToAddresses(To); Should be: email.setToAddresses(ToMail); And: email.setCcAddresses(CC); Should be something like: email.setCcAddresses(ccMail.split(','));


-1

Please check if you have enable the same field for field history tracking 1 From Setup, click Object Manager and select Teacher__c 2 Select Fields & Relationships, and click Set History Tracking. 3 Select Enable Teacher History, then select these two fields to track: teacher_name__c 4 Click Save.


2

The apex:pageMessages element doesn't appear to want to appear inside a div (it gets "kicked out" into its own area), so some trickery is required. The only reasonable solution I've found so far is to modify the inner CSS rules: <style> .message { text-align: center; } .messageTable { width: 100%; } </style> The first aligns ...


1

I was able to fix it by changing the reference for lightning component in the Visualforce page demoAdapterPage from c:lightningComponentName to YOUR_NAMESPACE:lightningComponentName <script type="text/javascript"> sforce.interaction.cti.notifyInitializationComplete(); $Lightning.use("YOUR_NAMESPACE:demoAdapterOut", ...


0

I couldn't resolve the issue with apex:actionFunction. Instead calling the same method as an action of the visualforce page worked for me. Following is the updated code. Visualforce Page <apex:page standardController="Custom_Object__c" extensions="CustomObjectBulkApproval" recordSetVar="customObjectRecords" action="{!...


2

Let me answer my own question. All the others are right with empApi doesn't work in a Lightning-Out context with a Visualforce page. But here is how I actually solved it using an already existing CometD LWC component: LWC Markup: <template> <!-- taken from https://github.com/TheVishnuKumar/lwc-streaming-api --> <c-lwc_streaming_api ...


2

Pretty much the same way you set a variable for any other class. Dot notation. IntegrationController myController = new IntegrationController(); // If the property is public or has a public setter, you can use dot notation // like normal myController.dt = Date.today(); Test.startTest(); myController.getData(); Test.stopTest();


0

You simply need to add an action support: <apex:inputField value="{!c.AccountId}"> <apex:actionSupport onchange="{!updateAccount}" /> </apex:inputField> ... public void updateAccount() { if(c.AccountId != null) { acc = [SELECT ShippingAddress, ShippingStreet FROM Account WHERE Id = :c.AccountId]; } ...


4

The lightning/empApi module is applicable only inside the Lightning Container (You have to be in the Lightning Experience Builder). This is documented in the Targets section in the docs. One reason to avoid using lightning/empAPI or even a CometD client is that there is a 50K limit on the number of event subscriptions you can have in an org with Cometd ...


6

Not clear how to interpret "Targets" in the documentation (and where Lightning-Out would fit) but e.g. lighting-card works for these Targets: Lightning Experience Experience Builder Sites Salesforce Mobile App Standalone Lightning App but lightning-emp-api only for this Target: Lightning Experience I had to roll my own CometD (pretty annoying) ...


2

You can add a listener with JS to the iFrame ex. var iframe = document.getElementById('myIFrame'); iframe.contentDocument.body.addEventListener('mouseup', Handler); function Handler() { alert(new Date()); }


1

Don't use window.onload, instead use a modern event listener: window.addEventListener('load',approve); If you override window.onload, weird things can happen. Second, without a rerender attribute, the page will reload, potentially causing an infinite loop: <apex:actionFunction rerender="" name="approve" action="{!...


0

Add into your LWC JS Controller: var eventPayload = { action: 'openPrimaryTab', body: '/apex/accountDetail' } const actionEvent = new CustomEvent('LWCOutEvent', { detail: {eventPayload}, }); this.dispatchEvent(actionEvent); Create an encapsulating Aura Component for your LWC (new Aura component): .CMP: <aura:component> <aura:...


1

You really need to be checking the response status code - it's likely you are getting an error on that query, but since you are not checking, when you parse the response - it breaks because it's not in the JSON format you are expecting. Check something like this: if (response.getStatusCode() > 299 ) { //this is indicative only - you may want to do ...


1

You might be getting this error because of using the same controller method in a commandbutton on your VF page. This is because I am guessing commandbutton action methods cannot have parameters.


1

Try the following: AND( ISPICKVAL( StageName , "08 - Closed Won"), ISBLANK( SyncedQuote.Id ), NOT(CONTAINS(SyncedQuote.Name, 'Renewal') ), NOT(CONTAINS(SyncedQuote.Name, 'prolongation') ), NOT(CONTAINS( Name , '3rd Level Support')) )


2

Apex Page : <apex:page controller="datectrl"> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css"/> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script> <link rel=...


1

To save parent/child objects, you need some Apex (or JavaScript). Here's one possible approach: <apex:page extensions="InventoryTransferSheetController" lightningStylesheets="true" standardController="Inventory_Transfer_Sheet__c"> ... <apex:commandButton action="{!saveChildren}" value="Save&...


1

Blob data = Blob.valueOf(encryptedData); Blob key = Blob.valueof(myString); Should be the inverse of the original operation (base64Encode): Blob data = EncodingUtil.base64Decode(encryptedData); Blob key = EncodingUtil.base64Decode(myString);


0

I found the solution to this problem by using the {!filterId} that we have available when we start the flow instead of {!URLFOR($Action.Case.List, $ObjectType.Case)} Example: <apex:page standardController="Case" recordSetVar="Cases" lightningStylesheets="true"> <div style="max-width:350px;text-align:center;margin: ...


0

Per the documentation for lightning-layout-item: You can place HTML tags and text between the lightning-layout-item components, but you can't place other components or expressions between them. https://developer.salesforce.com/docs/component-library/bundle/lightning-layout/documentation You can utilize the slds-grid class and styling to replicate the layout ...


Top 50 recent answers are included