nchursin
  • Member for 5 years, 3 months
  • Last seen this week
Regular expression to check does a string contains any special symbols not working in lightning javascript
0 votes

Here's another idea. I checked this in LWC component reference, and it works. Template <template> {has} <div class="slds-m-top_medium slds-m-bottom_x-large"> <...

View answer
Is it possible to call an SFDX Plugin or command from an SFDX plugin?
2 votes

Pretty old question, but still the answer might help someone in the future. I found 2 options to run other SFDX commands without messing around with CLI and child processes. Option 1: Inheritance ...

View answer
Update a field of same record in after update trigger
Accepted answer
2 votes

The trick is to not send to update the very same record, that went into a trigger. One way to do this is to generate a new record with the same ID and the correct field value. E.g.: new Account(Id = ...

View answer
Can someone explain me the following terms in connected app, Salesforce?
Accepted answer
0 votes

External apps External is basically anything that is off-platform - mobile app, off-platform web-app, service on AWS or Google cloud, Apple Watch app sending your pulse to Salesforce to track customer ...

View answer
SfdcSqlException: ORA-00972: identifier is too long
0 votes

As it is stated here: An ORA-00972 means you are using a database column or object identifier name that is too long In my case the problem was that the query that I try to execute has the following ...

View answer
Stubbing Logger classes with methods accepting Exceptions
Accepted answer
2 votes

The only solution I found was to make the failing methods private and expose them only as static ones. So I ended up with a class with static methods, which uses a mockable singleton under the hood. ...

View answer
Mock Callout fails when DML in ContentDocumentLink
0 votes

So basically this is a usual behaviour for callouts. They are throwing an error if you do them after a DML statement. This is done to avoid situations where you update external system and then ...

View answer
ConnectedCallback Isn't getting called the 2nd Time when New/Edit/View button is overridden with Aura Component which in turn calls LWC
1 votes

TL;DR: That is the expected behavior. Explanation: The problem is not in the connectedCallback but in Cancel behavior. It doesn't remove your elements from DOM, but just hides them. This is ok, ...

View answer
Unable to capture data on onrowselection in datatable LWC
1 votes

onrowselection is fired on every row selection passing all selected rows each time. This is why you're getting duplicates. That is I believe is something that you see and what you're trying to filter ...

View answer
How do I make a part of the code run after apex call?
Accepted answer
1 votes

You need to re-visit how Javascript Promises work. The Apex method call getPriceBookEntry({productId: this.allProductColumns[i].id}) returns a Promise. Logic in the then block is guaranteed to execute ...

View answer
How to write test class for triggers
Accepted answer
1 votes

This error means you have different type vars in expected and actual in an assertion. This line is the problem: system.assertEquals('', a.BillingAddress); In your code you are trying to assert ...

View answer
How Is Apex Singleton Different From Static Trigger Handler?
4 votes

There are several differences: Memory allocation Code reusability and OOP Testing Memory allocation For static class members (static vars and constants) memory is allocated when you first call the ...

View answer
Connected App, request with access token returns an error: "Session expired or invalid"
Accepted answer
2 votes

Thanks to @Derek F for providing translation :) The initial access token for client registration can only be used for OpenID client apps registration. That means you cannot use it to interact with ...

View answer
How to overwrite renders in javascript from LWC?
Accepted answer
0 votes

I briefly looked through the PayPal docs and see no reason why you need to re-render the button every time. I would suggest using the first render. That is easily achievable by utilizing a boolean ...

View answer
Apex class to be used for both with and without sharing
Accepted answer
4 votes

I had the same requirement once. So what we did is we had a class that executed the query to be abstract and we created instances of its successors, that determined the sharing model. This way you ...

View answer
Why I am getting error while Promoting Second Generation Package with dependent packages?
Accepted answer
0 votes

Though documentation says -p received package id, you need to use version id. So, in your case that would be -p 04t7F000005EwwvQAC

View answer
Test Suites vs Tests
1 votes

Pretty much. If we go into details they are not equivalent (one test.js can contain several suites) but to simplify things they can be treated as equivalent

View answer
How to avoid SOQL Queries Inside FOR loops
0 votes

The basic idea is to first select all envelopes, and then do the processing. Here's an example code which basically reduces the number of SOQLs to 1. Here I first collect the whole list of envelope ...

View answer
How do I test the FOR loop data for this code?
0 votes

To make this code more testable, you need to extract the loop body to a separate code unit. In your case there are 2 options: RecData constructor Just a separate method Then just write tests for ...

View answer
Salesforce have standard Open hours For Stores?
1 votes

Take a look at Business Hours. That's probably something you need. You can find them in Setup -> Business Hours.

View answer
Why the AuraEnabled method throws an internal error when a namespace is enabled
Accepted answer
3 votes

Turned out the problem is how AuraEnabled handles the namespaces. Currently, it's just impossible to use nested classes in namespaced Aura. This is true for regular (non-LWC) Aura as well, but has a ...

View answer
Is there any way to pop up softphone screen from data coming from REST API?
0 votes

Have you taken a look at the Streaming API? It let's you stream events and therefore react to the data updates.

View answer
Parse JSON with Apex
1 votes

As @sfdcfox mentioned the API returning this JSON is not well architected. But as you have no way to influence it, unfortunately, you have no other option but to write your own parser using this ...

View answer
'Script Too Large' when cloning
Accepted answer
8 votes

The problem is line endings. Windows uses CR;LF, while *nix uses LF. Obviously, Win line endings use more space. So the solution is to change all line endings to the *nix one (LF). I'd actually ...

View answer
Restrict the user to get oAuth token from custom app in salesforce
Accepted answer
2 votes

It looks like you're trying to replicate the standard Salesforce functionality. Take a look at this article: https://help.salesforce.com/articleView?id=000230821&type=1 In a few words, you can ...

View answer
How to clone unmanaged package
1 votes

I don't think you can remove that dependency automatically. Other than that you can try going like this: Using Migration Tool / SFDX / some IDE (MavensMate, Illuminated Cloud) download all metadata ...

View answer
Apex CPU time limit exceed from JS remoting salesforce
1 votes

From what I understood from your code, you're summing up Amount by Account and some picklist. Please, consider using GROUP BY with ROLLUP and SUM aggregate function. I think they'll give you what ...

View answer
how to get all the fields of a custom setting in soql?
1 votes

As mentioned in comments take a look at Custom Settings Methods. You might actually not need to perform a SOQL query. E.g. // Example for get a single List custom setting MyListCustomSetting__c ...

View answer
Trying to run a sql activity thourgh a curl SOAP request - SoapAction incorrect?
Accepted answer
1 votes

It's a tag value which should be "Start" and your have it: <Action>Start</Action>. The SOAPAction is a different one. It's a header. Try using a header like this: SOAPAction: Perform. ...

View answer
any help i want to insert my trigger class in the codes below any help?
Accepted answer
0 votes

If I understood your question right, you want to call some logic in your trigger from some other class. I suggest you using some trigger pattern for your goal. Take a look at this article, ...

View answer