Pranay Jaiswal
  • Member for 6 years, 9 months
  • Last seen this week
Error while updating debug log trace flag
Accepted answer
89 votes

I have faced this issue, which I fixed it by deleting all debugs logs from developer console. In dev console, Select tab "Query Editor" at the bottom of the console Select check box "Use Tooling API"...

View answer
Lightning Web Components available in Community Builder
19 votes

Yes, you have to handle it differently. For LWC in the community we have to edit the configuration file named as file—<component>.js-meta.xml ** To make your component available in the ...

View answer
LWC Community recordId undefined
Accepted answer
19 votes

From docs, you have to add <target>lightning__RecordPage</target> in the lwc component meta, for it to accept recordId from the detail page. <targets> <target>...

View answer
System.TriggerOperation enum
Accepted answer
17 votes

According to Summer 18 Apex developer guide, 7 new Enum values are introduced in System.TriggerOperation class. AFTER_DELETE AFTER_INSERT AFTER_UNDELETE AFTER_UPDATE BEFORE_DELETE BEFORE_INSERT ...

View answer
Database.Stateful for a specific variable only
16 votes

For the variables in stateful class in whom you don't wanna store state, you can make those variables as transient. Use the transient keyword to declare instance variables that can't be saved, ...

View answer
How to Delete All Debug Apex logs in Apex?
16 votes

You cannot delete the debug logs natively in Apex code. But you can use Rest DELETE endpoint to delete debug logs. I have created a utility code to delete debug logs that way, you can refer it. The ...

View answer
Database Query Locator vs Simple Query
15 votes

Before we proceed about QueryLocator class and let's see the limits of it. I wrote a sample Debug statement to see the limits of the number of rows returned by query locator and Normal Square bracket ...

View answer
How to convey LWC's complex Reactive property back to markup?
Accepted answer
14 votes

Well, I was able to fix this by using the ES6 Spread operator, which basically splits the array into the individual element and then recreate array... addRow(){ this.data = [...this.data ,{...

View answer
Trigger for avoid insertion from data loader?
14 votes

To me, this does seem like a valid requirement. Few years back I too asked a similar question. Making context-aware application are sometimes needed. This is one such use case. Yes, You can get ...

View answer
How to Upload a File to a specific Library Folder using Apex?
Accepted answer
13 votes

As I can see from Your code while creating a ContentDocumentLink you are not specifying a LinkedEntityId. Linked entity ID tells in which folder it exists. So Minimum code needed to store file in a ...

View answer
Switch "when" cannot see constants?
Accepted answer
12 votes

The when clause can accept the following three types of values A) when literal {} (a when block can have multiple, comma-separated literal clauses) B) when SObjectType identifier {} C) When ...

View answer
Callout Limits for future methods and queueable apex
Accepted answer
12 votes

I quickly wrote a class with future method to test this behaviour. public class FutureClassLimitsTest { @future(callout=true) public static void docallouts(){ for(Integer i=0;i<...

View answer
REQUEST_LIMIT_EXCEEDED: AsyncApexTests Limit exceeded
Accepted answer
12 votes

There is a limit to the number of tests classes you can run in 24 hour period. Clearly you have exceeded that limit. The Test Execution limit is a rolling limit, thus you have to wait few hours to ...

View answer
List sorting by custom field
11 votes

You have to implement a Wrapper class with comparable interface for this to happen. To implement a custom sort order for sObjects in lists, create a wrapper class for the sObject and implement ...

View answer
Experimental support for decorators is a feature that is subject to change in a future release
Accepted answer
11 votes

You have to enable that in compiler options. Open jsconfig.json file and set that attribute experimentalDecorators inside compilerOptions as true. It will fix your issue.

View answer
Posting a JSON to REST resource in Salesforce
Accepted answer
11 votes

You can do that in a different way without relying on Native parser of SF to parse your string and provide input in your variable jsonStr. When you pass JSON, make your postMethod parameterless. This ...

View answer
Error on Batch Apex for sun.security.validator
11 votes

This happens when your endpoint uses a Load Balancer. So when you make calls in quick succession the Load Balancer Splits them to different servers. This is the reason why it doesn't happen every ...

View answer
Is it possible to invoke "super" with less ambiguous results?
Accepted answer
10 votes

Sounds a bug to me, the instance is still of ChildDependency I confirmed it using debug logs. public class ChildClass extends ParentClass { public ChildClass() { super(new ...

View answer
Testing BatchApexErrorEvent trigger
Accepted answer
10 votes

So as I can see from your code Divide by zero will throw an exception. Which inturn will fire BatchApexErrorEvent . The thing we need to look for is this is the test context. The events will not ...

View answer
Deserialize hits memory limit
Accepted answer
10 votes

In your wrapper class LineModel, don't use Standard Account. If you do that you will also deserialize children. Instead, create Apex Wrapper for Account with fields you need. This will be more memory ...

View answer
Authentication Failure when submitting Authorization Code in OAuth Web-Server Flow
Accepted answer
10 votes

Are you copying your authorization code from browser redirect? Its getting URL encoded and hence its saying invalid authorization code. Check if your auth code is ending with "%3D%3D" replace that ...

View answer
LWC: How to get access to proper Error message when statically calling an Apex method from LWC?
Accepted answer
9 votes

You don't have to throw AuraException, instead, you have to throw AuraHandledException (for Aura components only) AuraHandledException (for LWC components) @AuraEnabled public static string ...

View answer
eval() in Lightning Web Components
Accepted answer
9 votes

The syntax for the second eval() misses this keyword while referring object_1 connectedCallback() { this.object_1 = "test"; console.log(" 1: " + eval("this.object_" + 1) + " 2: " + ...

View answer
Reference Custom Metadata Type from Lightning Component
9 votes

Custom Settings and Custom Metadata types can't be referenced directly in Lightning Component Markup. You have to use Apex layer for it. Src: https://help.salesforce.com/articleView?id=...

View answer
Does SOQL join not respect OWD /sharing settings?
Accepted answer
9 votes

An interesting question that spiked my curiosity. I did few tests to analyse this behaviour. I created a Parent Object and Child Object. OWD is private for both. On child Object I created a lookup ...

View answer
The length of the first and last names
Accepted answer
8 votes

A quicker way to do that is to use describe call in Apex. System.debug(Contact.FirstName.getDescribe().length); //Prints 40 System.debug(Contact.LastName.getDescribe().length); //Prints 80 It also ...

View answer
Passing an Parameter to Apex from LWC
Accepted answer
8 votes

You have to make a callback function instead of binding it to a property for your @wire call where you set the value of tableLoadingState as false and that will stop the spinning wheel of death. @...

View answer
How do I Call the Salesforce API from a Lightning Component?
Accepted answer
8 votes

You have to manually replace the Session ID in your request body/header . In named credentials we have options to use the Merge fields in header/body @AuraEnabled public static String getOrgLimits()...

View answer
Documentation: Automated Process user/proxy user
Accepted answer
8 votes

Whenever you subscribe to platform events in SF via Flows, Process Builder or Trigger.. the logic/code runs in the context of Automated Process. From Docs: Platform event triggers/flows/process ...

View answer
What's the API name of system permissions?
Accepted answer
8 votes

Metadata API sometimes have different API names than the one shown on the UI. Manage Public List Views permission is called as "EditPublicFilters" and Create and Customize List Views is called as "...

View answer
1
2 3 4 5
33