Skip to main content

#Apex토론 중인 항목 29개

Hello,

I am currently using SFDC's Developer Console (because it's on the cloud) but would like to know the opinion of Developers who have worked with (or may have tried) other IDEs for Force.com.

I have come across various alternative IDEs such as:

  1. MavensMate which is not supported any more (Dec-2017) and the owner suggest to look at "Visual Studio Code Extension";
  2. Visual Studio Code Extension;
  3. Welkin Suite (It looks like a paid option but cannot see the price on their website);
  4. Illuminated Cloud (hosted within JetBrains Intellij IDEA); price seem to be 65 USD for 1 or few licenses (and we never know if the vendor will charge new versions)
  5. The traditional Force.com IDE Eclips based (Free but a real pain to install in a Mac);
  6. Any other IDE?

Could you possible let us know your opinion and if you would advise using one or the other? Maybe you could comment on Pros/Cons for each IDE you know?

Thank you very much.
답변 21개
  1. 오늘 오전 9:36

    Hi Eduardo,  

     

    Useful comparison! I'd throw BOFC's Dev Studio into the mix too. Instead of installing and configuring a local IDE, it lets you develop directly inside Salesforce, editing and creating Apex, LWC, and Aura components without ever leaving the org. Given the pain points you mentioned around Mac installs and licensing, it's worth a look as a lighter, more integrated alternative.

0/9000
I have a lightning app which has the remote site settings dynamic.

So, is it a good practice to use metadataService.class (http://technome2.blogspot.com/2017/05/creating-remote-site-settings.html) in post-installation script to add remote site settings for the org?
답변 67개
  1. 8월 5일 오후 1:17

    Thanks for sharing this information. 

     

    I agree that Remote Site Settings require manual configuration because they are part of Salesforce setup and security controls

    .

     

     

    It would be helpful if Salesforce could provide more automation options in the future while maintaining security standards. 

     

    Thanks for the explanation!

0/9000

Hi Trailblazers,

With the secure-by-default changes introduced in API version 67.0, Apex database operations (SOQL, SOSL, and DML) now run in User Mode by default. This automatically enforces Object-Level Security (CRUD), Field-Level Security (FLS), and record sharing rules without requiring explicit keywords on every query.

Given this platform shift, do we still need to worry about using Schema classes (like Schema.sObjectType.Account.isAccessible()) for security checks?

I am trying to understand if there are edge cases where manual Schema checks are still required, or if modern alternatives like WITH USER_MODE, AccessLevel.USER_MODE, and Security.stripInaccessible() have made manual schema verification completely obsolete.

I'd love to hear how other architects and developers are adjusting their coding standards and security frameworks for API 67.0+.

Thanks in advance for your insights!

  #Salesforce Developer  #Architects

 

 

#Trailhead Challenges  #Security  #Apex

답변 3개
  1. 8월 5일 오전 9:07

    Hi @Yash Gurharikar   -  

    Not completely. User Mode removes a lot of the manual security boilerplate, but the Schema class still has valid use cases. 

    For example, it's still useful for dynamic Apex, conditional UI/business logic, metadata-driven frameworks, or when you need to check access before performing an operation. In most new Apex code, prefer User Mode and Security.stripInaccessible(), and use Schema only where those APIs don't cover your scenario. 

0/9000
I found this link https://developer.salesforce.com/blogs/engineering/2014/04/building-content-rich-visualforce-pages-with-salesforce-crm-content.html to download multiple files as .zip from ContentVersion.

Can we use /sfc/servlet.shepherd/version/download/ to download multiple files?

Since this is not documented in any of the salesforce docs.
답변 5개
0/9000

Welcome to the Salesforce Developers Trailblazer Community — We Build What's Next 

 

Updated: April 2026

 

You're part of a global community of 30,000+ Salesforce developers — from those writing their first #Apex class to those architecting multi-agent systems. Whatever brought you here, you belong here.

 

Right now, the most exciting thing happening in our ecosystem is Agentic #AI  — and developers are at the centre of it. This post is your launchpad. 

 

🚀 Get Hands-On with #Agentforce 

The best way to understand agentic AI is to build with it: 

  • Register for upcoming Agentforce NOW events — AMAs, codeLives, and workshops where you learn directly from Salesforce experts and ship real code. 
  • Check out the new AgentExchange — a unified marketplace that brings together AppExchange, Slack Marketplace, and the Agentforce partner ecosystem.
  • The Salesforce Developer Edition just got a major upgrade — every org now includes Agentforce Vibes IDE, Agentforce Vibes with Claude Sonnet 4.5, and Salesforce-hosted MCP Servers. A complete AI-assisted development environment, free.

 

📦 Post-#TDX26 Repos Every Developer Should Bookmark

Fresh from TrailblazerDX 2026, these 3 open-source repositories are where the community is building right now:

  • Agent Script — The complete Agent Script language: parsing, linting, Language Server Protocol, UI — all open source. Dig in.
  • Agentforce Vibes Skills Library — A curated skills library optimised for building Apex, LWC, Agentforce and more. If you're building agents, start here.
  • Salesforce MCP Hosted Servers — Connect AI assistants like Claude and ChatGPT securely to your Salesforce logic and assets via hosted MCP servers.
  • Salesforce Multi-Framework Recipes Sample App — Code examples for building modern web apps on Salesforce using React with Salesforce Multi-Framework. Dig in.

📚 Level Up: Learning Paths for Every Stage

Whether you're deepening your platform fundamentals or going all-in on agentic AI:

🎙️ Stay Connected & Keep Learning

🌎 Find Your People

Have suggestions for resources or content? Drop them in the comments below — this community is built by all of us.

댓글 6개
  1. 8월 3일 오전 1:22
    Mcp and skills are incredibly powerful! These are still not broadly used, but within a few years will be everywhere!
0/9000

Current Scenario

  • The logged-in user is an Experience Cloud Customer Community Plus Login user.
  • The Contact is created through an LWC that calls an Apex method 
  • The Apex controller is declared as public 
  • The Contact is populated with all the required fields, including the AccountId of the logged-in user's Account.

Behavior Observed

1. If OwnerId is not assigned

  • Salesforce automatically assigns the logged-in Experience Cloud user as the owner during the insert.
  • Since the logged-in user is an external user, the insert fails because saying "portal users cannot own Contact records."

2. If OwnerId = UserInfo.getUserId()

  • The same error occurs because the logged-in Experience Cloud user becomes the owner, which is not allowed.

3. If OwnerId is explicitly assigned to an internal Salesforce user

  • The insert fails with: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY
  • This appears to indicate that the external Experience Cloud user is not permitted to assign ownership to another user.

#Experience Site  #Apex

 

 

#Community Licenses

답변 2개
  1. 7월 31일 오전 3:50

    Hello @Tushar Jadav

     

     

    Thanks for your suggestion. 

     

    The user's license is

    Customer Community Plus Login

     

    I tried your solution, but it doesn't work for my issue, I still get the same error. 

    What could be the issue?

0/9000

🎥 I've started a YouTube channel — SalesforceDevDaily! 

 

Sharing the concepts, hacks, and lessons I've learned working as a Salesforce Developer — Apex, LWC, and real project tips. 

Channel Link:-

https://youtube.com/@salesforcedevdaily?si=33wpFFurKxhWvBEI

 

 

Subscribe and let's learn together! 🚀 

#Salesforce #Apex #LWC #Trailblazer

댓글 2개
0/9000

I spent weeks debugging an obscure Salesforce internal error that made no sense. 

System.QueryException: Aggregate query has too many rows for direct assignment, use FOR loop 

The query had 5 child records with a Long Text Area field and a few hundred records in a completely separate subquery with only Id selected. 

No LTA. No RTA. Just IDs. 

Yet the query was failing. 

After opening a case with Salesforce Support and escalating to the Product Team, I got the official answer: 

"Working as Designed." 

The Apex runtime applies a shared CLOB budget across ALL child subqueries — even ones with no LTA/RTA fields. The reasoning: heap safety across the entire query tree. 

I wasn't satisfied with that answer. So I ran dozens of tests across different field sizes and record counts and reverse-engineered the internal formula. 

Here's what the runtime actually does: 

Step 1 — sum up all declared LTA/RTA field lengths anywhere in the query (parent + every subquery) 

Step 2 — derive a total children row budget: 

 

FLOOR( 1000 / POW(2, MAX( CEILING(LOG2(totalClobLength / 32768)), 0 )) ) 

Which produces this table: 

totalClobLength | Row budget 

--------------- 

256 B - 32 KB | 1,000 

32–64 KB | 500 

64–128 KB | 250 

128–256 KB | 125 

256–512 KB | 62 

 

Both empirical thresholds I observed matched this formula exactly. 

Here's the flaw. 

The row budget is calculated from LTA/RTA field sizes — and then applied to ALL child records across ALL subqueries, including those that select only Id. 

A subquery like (SELECT Id FROM Children2__r) contributes zero bytes of CLOB content. 

But each of its records still consumes one slot from the budget. 

The budget is asking "how many rows can we safely load given the CLOB volume?" 

Then it counts rows that carry no CLOB data at all toward that answer. 

The fix is straightforward: 

Apply the CLOB row budget only to subqueries that actually select LTA/RTA fields. 

Records in (SELECT Id FROM ...) should not count against a heap limit derived from text field sizes. 

I've submitted this to IdeaExchange: 

"Fix Design Flaw in internal totalClobLength calculation" 

If you've ever hit this error in a multi-relationship query — or you work with contracts, documents, or any domain with rich-text fields on parent objects — please vote. 

https://ideas.salesforce.com/s/idea/a0BHp000017Jka1MAC/fix-design-flaw-in-internal-totalcloblength-calculation

 

#Salesforce #Apex #SalesforceArchitect #SalesforceDeveloper #GovernorLimits

댓글 4개
0/9000

Aadhar card, driving license and pan card numbers are to be masked such that only last four characters are to be displayed. It is fully  visible only to CEO and COO. How to solve this without coding ? 

답변 6개
  1. Eric Burté (DEVOTEAM) Forum Ambassador
    2024년 3월 2일 오후 5:08

    Hello @Rajadesingu J with RIGHT(field__c, 4) you could get the 4 last digit of the concerned field (field__c to replace with the concerned field api name).

    Then after, you can concatenate this with any other text you want in your formula.

    Eric

0/9000
I have getting error as System.NullPointerException: Attempt to de-reference a null object on the test class

Class:-

/*

@Class Description- Contact Trigger Helper.

Class is introduced to handle Titan Portal Status Sync between Contact and its related account.

*/ public with Sharing class ContactHelper {

//Boolean variable to prevent recursions on this Class.

public static Boolean isPortalSyncUpdateRecursion = FALSE ; public static Boolean isPortalSyncDeleteRecursion = FALSE ;

public void updateAccountPortalStatus(Map<Id,Contact> mapNewContact, Map<Id,Contact> mapOldContact) { system.debug('mapNewContact' +mapNewContact ); system.debug('mapOldContact' +mapOldContact );

Set<Id> setContactIds = new Set<Id>(); Set<Id> setAccountIds = new Set<Id>(); List<Account> lstAccountsToUpdate = new List<Account>(); if(mapNewContact != null) { for(Contact objContact : mapNewContact.values()) { system.debug('mapOldContact' +mapOldContact.get(objContact.Id).Titan_Portal_Status__c ); system.debug('objContact'+ objContact.Titan_Portal_Status__c); //if there is a change in Titan Portal Status of this contact, collect contact ids. if(mapOldContact != null && mapOldContact.containsKey(objContact.Id)) { if(objContact.Titan_Portal_Status__c != mapOldContact.get(objContact.Id).Titan_Portal_Status__c ) { setContactIds.add(objContact.Id);//collect contact ids that needs to be evaluated for all AccountContactRelation system.debug('setContactIdsinfor' + setContactIds); } } } } else if(Trigger.isDelete) { System.debug('Old Keyset'+mapOldContact.keySet()); for(AccountContactRelation objAccountContactRelation : [SELECT Id, AccountId FROM AccountContactRelation WHERE ContactID IN: mapOldContact.keySet()]) { //NOTE-use this variable only in Contact Delete context, as this is used to find accounts of deleted contact setAccountIds.add(objAccountContactRelation.AccountId); } } System.debug('Set Contact Ids:'+setContactIds); System.debug('Set Account Ids:'+setAccountIds); /* * NOTE: This blank update will execute the record-triggered flows in AccountContactRelation, which will handle * Titan Portal Status sync between Accounts and their related Contacts linked using AccountContactRelation. * */ if(setContactIds.size()>0 && Trigger.isUpdate) { system.debug('setContactIdsinupdate' + setContactIds); List<AccountContactRelation> lstToUpdate = [SELECT Id FROM AccountContactRelation WHERE ContactId IN: setContactIds]; if(lstToUpdate.size()>0) { Database.update(lstToUpdate,false); } } /* * NOTE: - For delete of contact, validate the Portal Flag in this method * */ if(setAccountIds.size()>0 && Trigger.isDelete) { Boolean portalFlag = FALSE; for(Account objAccount: [SELECT Id, Titan_Enabled__c , (SELECT Id, Contact_Titan_Portal_Status__c FROM AccountContactRelations WHERE Contact_Titan_Portal_Status__c ='Active' AND ContactId NOT IN: mapOldContact.keySet() LIMIT 1) FROM Account WHERE Id IN: setAccountIds]) { //For the deleted contact, There is atleast 1 more diff contact related to the account, which is portal active. if(objAccount.AccountContactRelations != null && objAccount.AccountContactRelations.size()>0) { portalFlag = TRUE; } else { portalFlag = FALSE; } System.debug('Portal Flag'+portalFlag); System.debug('Account Flag'+objAccount.Titan_Enabled__c); //if there is a change in Account checkbox field and the flag var calculated here, add this update for update if(objAccount.Titan_Enabled__c != portalFlag) { objAccount.Titan_Enabled__c = portalFlag; lstAccountsToUpdate.add(objAccount); } } System.debug('Accountupdate list:'+lstAccountsToUpdate); //Update the accounts' Titan Enabled checkbox if(lstAccountsToUpdate.size()>0) { Database.update(lstAccountsToUpdate, false); } }

} }

Test class:- @isTest public class ContactHelperTest { static testmethod void PortalStatus(){ Map<id,contact> oldmap = new Map<id,contact>(); Map<id,contact> newmap = new Map<id,contact>(); Account acct = new Account(); acct.Name='TEST'+ math.random(); acct.Type='Standard'; acct.BillingStreet='Test'; acct.BillingCity='test'; acct.BillingCountry='United States'; acct.Phone='123214231453'; acct.BillingPostalCode='1234567'; acct.BillingState='California'; acct.Titan_Enabled__c = True; acct.OwnerId=userinfo.getUserId(); //acct.Billing_Address__c = 'XYZ, Albama, ' insert acct;

system.debug('acct'+ acct); Contact con = new Contact(AccountId = acct.id,lastname = 'testdata' , firstname ='testdata1', Email = 'test1@honeywell.com'); insert con; system.debug('con'+ con); con.lastname = 'Test2'; con.Titan_Portal_Status__c = 'Active'; update con; system.debug('conupdate'+ con); oldmap.put(con.id,con); system.debug('oldmap'+ oldmap); contact con1 = [select id,name,lastname,firstname,email,Titan_Portal_Status__c from contact where id =:con.Id]; system.debug('con1' +con1); con1.lastname = 'Test3'; con1.Titan_Portal_Status__c = 'Inactive'; update con1; system.debug('con1update' +con1); newmap.put(con1.id,con1); system.debug('newmap' +newmap); AccountContactRelation all = [SELECT ID, AccountId, ContactId,Contact_Titan_Portal_Status__c, IsActive FROM AccountContactRelation where contactid =:con1.id]; system.debug('all' + all); contact con2 = [select id,name,lastname,firstname,email,Titan_Portal_Status__c from contact where id =:con1.Id]; delete con2; Test.startTest(); ContactHelper ts = new ContactHelper(); try{ ts.updateAccountPortalStatus(newmap,oldmap); } catch (DmlException ex) { System.assertEquals('expected text', ex.getMessage()); } Test.stopTest(); /* check for AccountContactRelation record with IsActive = false and also check for the error message */ }

System.NullPointerException: Attempt to de-reference a null object on test class

User-added image

Getting below error while running the test class

can anyone please help on this as we are getting error on the System.NullPointerException: Attempt to de-reference a null object on line 50 on the class "if(setContactIds.size()>0 && Trigger.isUpdate)"
답변 1개
  1. 2023년 8월 31일 오전 10:40
    HI Mahesh,

    I see you also posted on https://salesforce.stackexchange.com/questions/402221/system-nullpointerexception-attempt-to-de-reference-a-null-object-on-test-class according to which, 

    "This test class is incoherent and does not appear to be meaningfully testing the class ContactHelper.

    It looks like you are attempting to test behavior on Contact deletion, but the logic you've written does not do so effectively for a number of reasons. A few points that I will highlight, which may not be the specific issue causing this error and may not be all of the issues in this code, are:

    > Your code appears to invoke the trigger handler multiple times. The handler will be run, presumably, by your trigger at each DML operation you perform during test data setup, and will then explicitly be invoked again when you call it. This is almost certainly not what you want. I assume you were trying to build a DML-free test to exercise this code in isolation, but you haven't actually done that - you're still performing lots of DML.

    > You have static Booleans to try to control recursion, but you are not using them. If in your actual code these values are used, you may see unexpected behavior because of the way your test runs the code multiple times in a single transaction.

    >You are attempting to catch and validate a DmlException that your code never causes to be thrown (by calling addError()).

    >Your test will false-positive if an exception is not thrown because you do not make a System.assert(false) assertion after you call ts.updateAccountPortalStatus(newmap,oldmap) to ensure that the flow of control doesn't continue.

    >The logic in your test will cause the wrong code path to be executed in your trigger handler. Because you construct and pass an incorrect newmap value to the handler (delete events do not have a Trigger.newMap), your handler will execute what appears to be the update pathway in the first if statement, instead of the delete pathway.

    > That said, the logic in your handler is so confused that it is difficult to follow the flow of control. You need to step back and do a major refactor, breaking out logic for different trigger events into separate methods and business logic into its own testable code unit."

    Related:

    https://developer.salesforce.com/forums/?id=906F0000000AvQJIA0

    https://stackoverflow.com/questions/70463065/salesforce-test-class-system-nullpointerexception-attempt-to-de-reference-a-n

    https://www.sfdcpoint.com/salesforce/system-nullpointerexception-attempt-to-de-reference-a-null-object/

    Please mark answer as best to close the thread. Thanks

     
0/9000