• Ezra Kenigsberg @ BC
  • NEWBIE
  • 5 Points
  • Member since 2017
  • Salesforce Architect
  • BigCommerce


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 7
    Replies
I am new to LWC and cant seem to figure out how to open the source code for LWC. Aura can be opened in the dev console but from what i understand this is not possible with LWC.

Is it possible to open a LWC source code from within the org? I have a LWC that was developed by someone else that needs editing. How can I access the source code?
I'm trying to "undelete" records following the Workbench steps in this article and am getting this error when I try to "undelete" with a csv file:

"Application Error: An error occurred in the application and your page could not be served. Please try again in a few moments. If you are the application owner, check your logs for details."

However, it seems to delete a few hundred records. Does anyone know how many records you can "undelete" at one time? I have 15k recoreds to recover. 
Hi,

I'm trying to group the date fields of two joined reports.  I have a campaign object and a sales object.  Both of these objects have a start date field.

When I group them across a joined report on the start date field, the date fields on the sales objects do not group correctly.

I'm trying to group them by "Month Year".

Has anybody had any luck grouping similar fields across different objects?
Hey everyone,

Let me briefly explain the trigger I wrote (my frist trigger actually). On the opportunity, we have a look-up field to other opportunities called 'Renewed Opportunity'. The idea is that when you create an opp that is a renewal, you use that field to reference the previous opportunity that is being renewed.

The trigger looks at the stage of the new renewal opp and updates a field on the referenced 'Renewed Opporunity' called 'Renewal Status'. The goal is to be able to see if an opp ended up renewing or not.

The issue here is that many of our older opportunities don't meet the validation rules we currently have in place. So if you populate that look-up field with an opp with missing data, you'll get an error message preventing you from updating the new, renewal opp you're creating.

Obviously, one solution would be to go back and update all our older opps, but that's practically impossible. So here is my question:

1) Is there something I can write in either the trigger or the validation rules to set up a bypass? For the validation rules, I tried writing in 'NOT(ISCHANGED(Renewal_Status__c))', but it seems that as long as a record is referenced, the validation rules will be required. The trigger doesn't even have to update the record.

2) If option 1 is not possible, is there a way to write an error message in the trigger that at least explains to the user in a clear manner that they have to update the referenced opp? I'd also like to list in the error the validation rules that must be met, but that would be a bonus.

In case you want to take a look at my trigger, here it is:


trigger RenewalProcess on Opportunity (after insert, after update) {
   
   Set<String> allOpps = new Set<String>();
    for(Opportunity renewalOpp : Trigger.new) {
        if (renewalOpp.Renewed_Opportunity__c != null) {
            allOpps.add(renewalOpp.Renewed_Opportunity__c);
         }
    }

    List<Opportunity> potentialOpps = [SELECT Id FROM Opportunity WHERE Id IN :allOpps];

    Map<String,Opportunity> opportunityMap = new Map<String,Opportunity>();
        for (Opportunity o : potentialOpps) {
            opportunityMap.put(o.id,o);
        }
     
     List<Opportunity> oppsToUpdate = new List<Opportunity>();
       
        for (Opportunity renewalOpp : Trigger.new) {
            if (renewalOpp.Renewed_Opportunity__c != null && renewalOpp.StageName.equals('Closed Won')) {
                Opportunity renewedOpp = opportunityMap.get(renewalOpp.Renewed_Opportunity__c);
                renewedOpp.Renewal_Status__c = 'Renewed';
                oppsToUpdate.add(renewedOpp);
            }
            else if(renewalOpp.Renewed_Opportunity__c != null && !renewalOpp.IsClosed) {
                Opportunity renewedOpp = opportunityMap.get(renewalOpp.Renewed_Opportunity__c);
                renewedOpp.Renewal_Status__c = 'In Negotiations';
                oppsToUpdate.add(renewedOpp);
            }
            else if(renewalOpp.Renewed_Opportunity__c != null && (renewalOpp.StageName.equals('Closed Lost') || renewalOpp.StageName.equals('Closed Stalled'))) {
                Opportunity renewedOpp = opportunityMap.get(renewalOpp.Renewed_Opportunity__c);
                renewedOpp.Renewal_Status__c = 'Did Not Renew';
                oppsToUpdate.add(renewedOpp);
            }
           
           
        }
   
    update oppsToUpdate;
   
}



Let me know if you need anymore info from me!
-Greg

Hi,

 

Is there a way to deactive a validation rule in APEX. I want to update a record from APEX, but do not want to fire Validation rule, if the same rule is fired from UI, validation rule should fire. 

 

I am thinking to deactive just before record.update and active again. Can this be done? Is there any other way to acheive this? 

 

thanks for the time.

Mitesh

Is there any way in the API to disable all data validation rules for the current session?
 
If not this would be a very important tool espcially in the case of Merge and LeadConvert calls when bad data is merged with bad data.  Ideally we would have the ability in the header to turn off the validation rules for the current session.
 
Glenn Wilson
Has anyone have a nice way of creating a random number using a formula field? Here's our business case.

We're creating certification records in salesforce to track who are certified on our product. A benifit of this is they can call into our Support system and type in their Certification Number to be placed in front of the queue. However we don't want people to guess what the numbers may be from a sequence.