• DML2020
  • NEWBIE
  • 115 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 44
    Questions
  • 13
    Replies

A custom aura component is embedded in the screen element of a screen flow with the purpose of closing and opening specific tabs on the UI. The id of the tab to open in this case is defined as 'tabIdToOpen'.

From the code below, how should the markup appear for / what is the correct way to reference the recordId for the 'tabIdToOpen' in the controller file (line 7after recordId:)?

Component code 🔻

<aura:component implements="lightning:availableForFlowScreens">
    <aura:attribute name="tabIdToOpen" type="string" />
    <lightning:workspaceAPI aura:id="workspace" />
    <aura:handler name="init" value="{!this}" action="{!c.closeCurrentTab}" />
</aura:component>
 

Controller code 🔻

({
     closeCurrentTab : function(component, event, helper) {
          var workspaceAPI = component.find("workspace");
          workspaceAPI.getFocusedTabInfo().then(function(response) {
               var focusedTabId = response.tabId;
               workspaceAPI.openTab({
                    recordId: tabIdToOpen,
                    focus: true
               }).then(function(response) {
                    workspaceAPI.closeTab({tabId: focusedTabId});
               })
               .catch(function(error) {
                    console.log(error);
               });
          });
     }
})
Design Code
<design:component >
        <design:attribute name="tabIdToOpen" label="Id of tab to open" />
</design:component>
Reference -> openTab() for Lightning Experience (https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/sforce_api_console_lightning_opentab.htm) sample code
 

While editing a custom label to include the
<a href="https://www.example.com" target="_blank">Example</a>
it displays as text within the modal and not hyperlink on LWC page.

Can a hyperlink be included in custom labels imported within LWC? If so, how?

I've included addtional metadata in the xml package using an extension and after a long retrieve, I'm getting  -- Too many changes were detected. Only the first 10000 changes will be shown below -- under source control. 

Before all the retrieved files were shown but now they are not. I wanted to sync to GitHub but now unable to do that. 

How do I resolve this issue?

We have a process set up once an order is placed that an email is sent to the account placing the order. How can I identify the process sending the email and the email template being used using the debug logs?

What is the application that would appear or event within a log that described the email send?

Within the LWC, there exists a search field which displays properties for the user to select. The html file contains the following: 

<lightning-layout multiple-rows class="slds-var-p-bottom_small">
                <lightning-layout-item size="4">
                    <lightning-input
                            type="search"
                            label="Search Properties"
                            onchange={handleSearch}
                            class="slds-var-p-right_small">
                    </lightning-input>
                </lightning-layout-item>

which is dictated by the following in the js file as follows:

handleSearch(event) {
    const searchFields = ['name', 'propertyId', 'address'];
    this.template
      .querySelector('c-datatable')
      .search(event.target.value, searchFields);
  }
 

Question: The properties that are returned have a status of either ACTIVE or INACTIVE. However, the requirement is for the properties to return ones ONLY with the status of ACTIVE (filter for only ACTIVE status on the record and exclude those of INACTIVE status). 

Where would I navigate to edit the filter to make the update to accomplish this?

 

From my debug logs for a scheduled job, I read

11:00:38.253 (4628820131)|DML_BEGIN|[56]|Op:Insert|Type:NU__SendEmailResult__c|Rows:11
 

What are the Rows referencing?

Via anonymous apex, I'm trying to schedule a job to run at 11pm on the first of every month using the following:

RenewalBatch job = new RenewalBatch();

// Scheduling string parameters
// Seconds Minutes Hours Day_of_month Month Day_of_week optional_year
String 1stOfMonthAt11pm = '0 0 23 1 * *';

System.schedule('Renewal Batch Job Monthly at 11pm', 1stOfMonthAt11pm, job);
 

However, I receive the following error:

Execute Anonymous Error
Line: 5, Column: 8
Unexpected token '1'.

and am unable to resolve this. What could be the issue here?

After capturing a debug log for a job that generates invoices and sends emails, it produced a large number of files. If I want to know how many emails were sent during the process, what keyword(s) would I search for in the debug logs?

I set up a debug log to run on a user a few days ago and do not see ANY files at the bottom of the page when you naviagte to SETUP -> DEBUG LOGS (although I can see the user trace flag set up).

In the dev console, I queried

SELECT Id, StartTime, LogUserId, LogLength, Location FROM ApexLog
 

and then 

SELECT Id, StartTime, LogUserId, LogLength, Location FROM ApexLog where LogUserId = '0051Y00000BHgss'
 

for the user ids who initiated the trace flag and the one for whom the debug log was run on, but to no avail (I see no results).

How do I get the logs?

We have a search field that will render results on two actions: clicking a 'Search' button and hitting the 'Enter' key. At present, we can only get results when the button is pressed. When the 'Enter' key is hit, nothing fires (no activity seen via console log on Inspect)

The following shows code in the controller

KeyPresssearch: function(component, event, helper) {
    if (event.which == 13) {
      this.search(component, event, helper);
    }
 

and 

search: function(component, event, helper) {
    component.set("v.pageNumber", 1);
    component.set("v.filterStartWith",'');
 
      var showMembersOnly = component.get("v.showMembersOnly");
      var AccountViewComponent;
      if (showMembersOnly){
      AccountViewComponent = component.find("memberView");
      } else {
      AccountViewComponent = component.find("allView");
      }
     
      AccountViewComponent.searchCompanies(component.get("v.searchValue"));
  }
 

What do you recommend I check to troubleshoot this?

For a scheduled chron job that processes say, 200 batches at a time, a pause of say, 20 minutes, needs to be introduced in between each batch that's processed.

How would that be accomplished?
What should the code look like?
Where should it be inserted?

In the process of validating a LWC and I receive the error, "Unable to find Apex action class referenced as 'CustomNotificationController'. What doesn't make sense is that I see that file exists in my IDE and hence in my sandbox I've uploaded the change set from (verified it exists using the dev console).

Any idea why this is showing up when I can clearly see it exists?

I have an image located at the top of a LWC displayed using the following code
<lightning-layout-item size="4">
<img
src={imageName}
class="slds-align_absolute-center"
style="max-height: 5.8125rem; cursor: pointer;"
onclick={handleClickLogo}
/>
</lightning-layout-item>
which appears to be sliced off along the left and bottom edges (see photo).

image with left side and bottom partially cut off
How do I fix this? Any suggestions are welcomed

A message needs to display for the user before continuing to the next page in the sequence for an order process. The orginal code in the .js of the LWC was as follows:

handleClickContinue() {
    this.dispatchEvent(new CustomEvent('continue'), { detail: 'propertyInfo' });
  }

and the code for the toast was inserted as follows:

handleClickContinue() {
    this.dispatchEvent(
      new ShowToastEvent({
          title: 'Test case for this &amp; that.',
          message: 'Once an order is submitted, changes cannot be made. Please review <a href="https://www.naahq.org/member-services/naa-click-lease/resources-faqs/lease-policies">these policies here</a> for further information.',
          variant: 'info',
          mode: 'sticky'
      })
    this.dispatchEvent(new CustomEvent('continue'), { detail: 'propertyInfo' });
  }

The issue is that my code will not deploy to the source org. Is there a syntax issue here or what should I check here?

To accomplish having a link embedded within text in a lightning web component to open to a new tab or window, would only the html file require modification or the html file AND the javascript file?

Any examples would be much appreciated.

Our full copy sandbox is being refreshed and the latest code and configuration updates need to be saved prior to this action. Are there guidelines to follow on copying what exists in the full sandbox to pull from?

I've validated a changeset which returned code coverage failure (even though unrelated to the code being deployed) for an event trigger after running default tests. In order to get the desired code deployed, a test class covering the event trigger needs to be created.

I'm not sure how to go about this and would like to see examples of what a test class for an event trigger would look like.

Here's the event trigger I need coverage for:

trigger MYLogEventTrigger on MYLogEvent__e (after insert) {
List<MYLogEvent__e> eventlist = (List<MYLogEvent__e>) trigger.new;
MY_Util.handleNewEvents(eventlist);
}

It was discovered that the zeroes preceding the value in the zip code field is removed during transfer through API. One solution was thought to convert the zip code formula field (which trims another zip code field to 5 digits) to a text. However, that is not possible.

Any recommendations on how to resolve the loss of the zeros in front of the zip code?

In our Salesforce org, we have a custom button that converts a certificate to a pdf file. The file generates 3 pages one of which is blank. How can I modify the file/ template using CSS to remove the extra spacing? Where might I want to start?
Our org has an email template with a visualforce attachment. How do I rename the file that is attached?User-added image

A custom aura component is embedded in the screen element of a screen flow with the purpose of closing and opening specific tabs on the UI. The id of the tab to open in this case is defined as 'tabIdToOpen'.

From the code below, how should the markup appear for / what is the correct way to reference the recordId for the 'tabIdToOpen' in the controller file (line 7after recordId:)?

Component code 🔻

<aura:component implements="lightning:availableForFlowScreens">
    <aura:attribute name="tabIdToOpen" type="string" />
    <lightning:workspaceAPI aura:id="workspace" />
    <aura:handler name="init" value="{!this}" action="{!c.closeCurrentTab}" />
</aura:component>
 

Controller code 🔻

({
     closeCurrentTab : function(component, event, helper) {
          var workspaceAPI = component.find("workspace");
          workspaceAPI.getFocusedTabInfo().then(function(response) {
               var focusedTabId = response.tabId;
               workspaceAPI.openTab({
                    recordId: tabIdToOpen,
                    focus: true
               }).then(function(response) {
                    workspaceAPI.closeTab({tabId: focusedTabId});
               })
               .catch(function(error) {
                    console.log(error);
               });
          });
     }
})
Design Code
<design:component >
        <design:attribute name="tabIdToOpen" label="Id of tab to open" />
</design:component>
Reference -> openTab() for Lightning Experience (https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/sforce_api_console_lightning_opentab.htm) sample code
 

I have an image located at the top of a LWC displayed using the following code
<lightning-layout-item size="4">
<img
src={imageName}
class="slds-align_absolute-center"
style="max-height: 5.8125rem; cursor: pointer;"
onclick={handleClickLogo}
/>
</lightning-layout-item>
which appears to be sliced off along the left and bottom edges (see photo).

image with left side and bottom partially cut off
How do I fix this? Any suggestions are welcomed

Our org has an email template with a visualforce attachment. How do I rename the file that is attached?User-added image
In our org, there's a webpage (which I believe is a visualforce page) that's linked from an application and needs to be edited. What steps do I take to find that page in the org?

Hi. 

I created an API for an events platform to pull data of attendees. I have a SOQL query which points to the specific event but now realize that hardcoding the event ID is not *best practice*.
 

@RestResource(urlMapping='/eventplatformList/*')

global with sharing class eventplatformRestResource {

    @HttpGet

    global static LIST<Registration__c> doGet(){

    RestRequest req = RestContext.request;

    RestResponse res = RestContext.response;

    LIST<Registration__c> result = [Select Id, EventName__c, FullName__c, RegistrantEmail__c FROM Registration__c WHERE Event2__c = 'a0k4z00000BdNnG'];

               return result;

    }
 

How would I change the code for the platform to pull the data needed for this upcoming event AND be able to reuse this Apex class so that data for other events can be pulled?

In this org, there is a quick action on a list view called 'Execute Order Importer for Selected'. When clicked, the selected order requests are converted and during this process an email is automatically sent to the indivisual who created that order. The quest is to identify that process where an email is sent to reuse for another process.
I ran a debug log and have honed in on an EMAIL_QUEUE line which I believe is involved in the email automation using a template. I've also identified in the log the email that the message was sent to.

Question: How can I use this to identify the automation that occurs so that I may replicate it elsewhere? 

Has anyone encountered this issue before? 

Some changes were made to a communities site using code in the components files in a DEV sandbox. Another change to the same site also included deleting the Headline component which I did in the DEV sandbox as well.

After validation and successful deploy to the FULL sandbox however, the change did not take and the headline component still showed up in my FULL sandbox. All the code changes look satisfactory to change the user interface look satisfactory except but the component I delete came over/ is still there.

What did I not do while in DEV sandbox to completely delete the headline component for this change to not reflect in FULL sandbox?

On the main page of a communities site, I have three sections two of which gives me the option to open in developer console to edit the cmp file or delete and one(the headline) which simply only allows me to delete. How do I find the lightning component detail of this section in my org (unable to find any aura component bundle details in setup that have that label or contain the text)? I'd like to view the code and edit.

Does one exist for this? Or is it only that I can edit it from the Experience Builder page only? 

 

Thinking this may be fundamental:

When a change is made to a .cmp, .js, or .css file by adding aura components, LWC, or adjusting the positioning of them, should an Apex test class be created for those changes as well?

If so, how to go about this? Is this the same as a controller?

Any links to resources to explain this?

Thank you.

Changes were made to a communities site by adding/ modifying code in .cmp, .js, and .css files in a dev sandbox to replace two components which each point to URL links and adjust their positioning on the page. Now, inbound change sets are to be validated before deployment to FULL sandbox.

Which test option should be selected from Default, Run ALL, LOCAL or SPECIFIED tests based on what was done? 

i Have an issue with my trigger, it is very simple one, basically it takes credit card type and expiry date from payment and put it up one level on Invoice, for reporting purposes. it works fine when a single payment is inserted however when i do bulk upload of new payments i get this error

System.LimitException: Too many DML statements: 151

 

here is my code below any help wpuld be greatly apreciated

trigger CC_Exp on Payment__c (after insert, after update) {
Set<id> objSet = new Set<id>();  

for(Payment__c objOpp:trigger.new)

{

objSet.add(objOpp.Invoice__c);

}

List<Invoice__c> myInvoice = [select Id,Status__c from Invoice__c where Id in: objSet];

for(Payment__c objOpp:Trigger.new)

{

for(Invoice__c objAcc: myInvoice)

{

if (objOpp.Payment_Method__c == 'Credit Card') {

{

objAcc.CC_Expiry_Date__c = objOpp.Expiry_Date__c;//
objAcc.Creditcard_Type__c = objOpp.Credit_card_Type__c;//
update objAcc;
}}}
}}

 

  • July 21, 2011
  • Like
  • 0
Hi All 

I would like to backup the following : 
1. Saleforce data
2. Attachements 
3. Apex codes and Visualforce page 

Currently, I do Salesforce data backup and attachment in monthly, I use Schedule Data Export and some time I do it manually by using data load for each object. But the storage that I have now it keeps increasing. So, is there a way to make automated backup in monthly for this kind of back up and we can keep it in the cloud? 

And a part from this I would like to do versioning for Apex and Visualforce page, currently I use Eclipse for my version control but I can use on my pc only. I want the team to access this version control too. I am not sure if Eclipse can do something like sharing with team. So, it would be great if you guys can share me some ideas regarding this.

Thanks 
Nutthawan P