• Anant Kamat
  • NEWBIE
  • 217 Points
  • Member since 2013
  • PSPL


  • Chatter
    Feed
  • 6
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 96
    Replies
Hi all,

I've dived more into the Flows in order to create much needed processes for our Service Cloud - case management with clicks instead of code - just because I can't code :-) 

I've created 2 flows that should run, when the case is created.
1) if no contact is associated with the case, create the new contact plus potentially account. Here's I've tried setting up a similar setup like we have in Desk.com, where email domains can be linked to specific accounts and then the new contact gets created into that. It then also checks any old cases with that email address and updates the contact & account. 

2) When any new case is created, check if the email address or the email domain is contained in a custom object that contains spam emails/domains. If so, assign the case to the Spam queue (with potential to delete later). 

Both flows work fine in our sandbox environment. I'm now a bit scared to move it to our Production. We will currently have something around 2000 cases per day with a potential to further increase.The first rule will luckily not apply all the time, but the second will. 

Can any of you please let me know, if flows is the ok-way to approach this? I've read, that there is a limit on "Executed elements at runtime per flow", just not sure, what this actually means.

We also already have over a million cases and 380,000 contacts, so for the first flow I'm worried, that the time limit is exceeded quickly (even though I'll only search through cases not having a contact associated - currently ~45k).

Anyone else who has created something similarly using flows and can share their experiences?

Thanks. 
Much appreciated
Kathleen
I have a service inserting records and accepting EST values.
"publishedAtEt": "2019-06-13T15:00:33",
"submittedAtEt": "2019-05-01T00:03:34",
Then I have a formula field to figure out the month for "submitted at" value.
INTEGER SUB_MONTH = MONTH(DATEVALUE( Submitted_At__c ))
But upon debugging , I am finding that the SUB_MONTH value is not 5, but 4.
USER_DEBUG |DEBUG|Sub_Month 4
Has anyone ever experienced something like that?
If yes, how did you resolve.
Any help is appreciated.
Thanks!

 
Hi All,

I am trying to create a new contact. Once the record is saved in Salesforce, an email need to be sent along with the unique id.

I have created a formula field for the Unique ID and associated record ID to this field.

Now, when I try to send an email with Unique ID, it shows null value.

<apex:page controller="SubmitNewContactController" docType="html-5.0">
   
    <apex:form>
        <apex:slds/>
    <apex:pageMessages></apex:pageMessages>
        <div class="slds-scope slds-box">
         <apex:outputPanel >
            <div class="slds-text-align_center slds-text-heading_medium"><p>Submit New Contact </p></div>
             <div class="slds-form-element">
                    <label class="slds-form-element__label"><abbr class="slds-required"></abbr> FirstName</label>
                <div class=" slds-scope slds-form-element__control">
                    <apex:input value="{!FirstName}" styleClass="slds-input" id="FirstName" />
                </div>
                 <label class="slds-form-element__label"><abbr class="slds-required"></abbr> LastName</label>
                 <div class=" slds-scope slds-form-element__control">
                    <apex:input value="{!LastName}" styleClass="slds-input" id="LastName" />
                </div>
                 <label class="slds-form-element__label"><abbr class="slds-required"></abbr> Phone</label>
                 <div class=" slds-scope slds-form-element__control">
                    <apex:input value="{!Phone}" styleClass="slds-input" id="Phone" />
                </div>
                 <label class="slds-form-element__label"><abbr class="slds-required"></abbr> Email</label>
                 <div class=" slds-scope slds-form-element__control">
                    <apex:input value="{!Email}" styleClass="slds-input" id="Email" />
                </div>
                 <label class="slds-form-element__label"><abbr class="slds-required"></abbr> Zipcode</label>
                 <div class=" slds-scope slds-form-element__control">
                    <apex:input value="{!Zipcode}" styleClass="slds-input" id="Zipcode" />
                </div>
                 <div class=" slds-scope slds-form-element__control">
                    <apex:commandButton action="{!SubmitContact}" value="Submit"/> 
                </div>
            </div>
         </apex:outputPanel>   
        </div>
        
    
    </apex:form>
</apex:page>
public class SubmitNewContactController {
    public Contact c{get;set;}
    public String FirstName{get;set;}
    public String LastName{get;set;}
    public String phone{get;set;}
    public String Email{get;set;}
    public String Zipcode{get;set;}
    
    public SubmitNewContactController(){
        c = new Contact();
    }
    
    public PageReference SubmitContact(){
        c.FirstName = FirstName;
        c.LastName = LastName;
        c.phone = phone;
        c.Email = Email;
        c.MailingPostalCode = Zipcode;
        insert c;
        
        PageReference pr = new PageReference('/apex/ThankYouPage');
        Messaging.SingleEmailMessage semail = new Messaging.SingleEmailMessage();
        String[] sendingTo = new String[]{c.Email};
        semail.setToAddresses(sendingTo);
        semail.setSubject('Registration is completed');
        semail.setPlainTextBody('Hi'+ c.name+'Thank you for registering.This is your UniqueID'+ c.Unique_ID__c);
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] {semail});
        pr.setRedirect(true);
        return pr;
        
        
        
    }
    

}

I am able to send the email but cannot capture the name and uniqueId in the email. It shows null in the email.
Can anyone please help me to fix the code?

Thanks,
Sirisha
 
Hi guys,
       My code coverage is at 77% at this time and I need to increase it or try to get it 100%. Here' s the red section which is not covered. 

User-added image

and here 's the test code.
 
Account acc = new Account();
		acc.Name ='Test';
		insert acc;
		
		Contact cont = new Contact();
		cont.FirstName ='Test';
		cont.LastName ='testContact';
        cont.Last_Activity_Subject__c='Run Test Trigger';
		cont.accountid =acc.id;
        cont.Last_Activity_Date__c = Date.parse('6/15/2019');
        
		insert cont;
		
	
		Task u = new Task();
        	u.ownerId = UserInfo.getUserId();
			u.whatid = acc.id;
			u.whoid = cont.id;
			u.Subject='Run Test Trigger';
			u.Status='Not Started';
			u.Priority='Normal';
            u.ActivityDate = Date.parse('6/15/2019');
        	
        insert u;
		
	
		Test.startTest();
		
			update u;
            for (Task t : [SELECT Id, Subject, Status FROM Task WHERE Id = :cont.Id]) {
   
       		 	System.assertEquals('Run Test Trigger',t.Subject); // asserts that your test worked properly
        		System.assertEquals('Not Started', t.Status); // asserts that your test worked properly
   				 }
        
            for (Contact u1 : [SELECT Id, Last_Activity_Subject__c, Last_Activity_Date__c FROM Contact WHERE Id = :cont.Id]) {
                
       		 	System.assertEquals('Run Test Trigger', u1.Last_Activity_Subject__c); // asserts that your test worked properly
        		
   				 }
        	
		Test.stopTest();

How do I increase the code coverage from here? What am I missing the test class?
Hi All,
          I wrote a simple trigger with before delete event on contact to prevent deletion if either contact field source__c == 'SAPExternal' or its related account.source=='SAPExternal'.my code is as follows.

public class ContactTriggerExamples {
 public static void beforeDelete(List<Contact> cns){
    for(Contact c:cns){
                 if( c.Source__c=='SAPExternal' || c.Account.Source=='SAPExternal'){
                     c.addError('You cant Delete Contact with Source as SAPExternal'); 
                 } 
           } 
}
trigger:
trigger ContactTriggerExamples on Contact (before Delete){
 if(Trigger.isDelete && Trigger.isBefore){
        ContactTriggerExamples.beforeDelete(Trigger.old);
    }
}
  It is perfectly working for first condtition i.e c.source == 'SAPExternal' and it is not working for c.account.source=='SAPExternal',whats wrong with my code.
Thank you all.
Hello,

I have made a managed packaged that I installed on a custom sandbox as a beta for tests. Then I tried to uninstall it for installing a new version and the uninstall process said on an automated e-mail that a certain picklist value set of the managed package can't be uninstall because :

"null: This global picklist is used by 1 or more custom fields. Remove the usage and try again."

So I checked directly on the value set where it is used and here is the problem : The only use is on a custom field of a custom object that belongs the managed packaged I'm trying to uninstall.

I obviously can't change this field before uninstall because it comes from the managed package so I don't have any idea for this issue.

Any idea ?
Hello All,
We are not using Opportunity Product object in our org. But whenever an opportunity is created a popup comes up in lightning view to Add Products. Is it possible to disable this popup without overriding the standard opportunity page. Please help me in this regard. Below is the popup I am talking about.

Opportunity Product Popup

Thanks,
Anant

Hi All,
I have created a Process Builder which should fire an email alert for the approver after 1 hr of getting created based on the Criticality of Case.
However it does not seem to work as expected though the criteria is met. Not sure what is missing from my end.
Approval Process

The criteria formula is evaluating to true with the data I have created.
Scheduled Action

Can somebody help me in this regards.

Thanks,

Anant

Hello All,
We are not using Opportunity Product object in our org. But whenever an opportunity is created a popup comes up in lightning view to Add Products. Is it possible to disable this popup without overriding the standard opportunity page. Please help me in this regard. Below is the popup I am talking about.

Opportunity Product Popup

Thanks,
Anant
Stuck on Security Specialist Superbadge step 1
Hi All,

I am attempting the Security Specialist Superbadge and have the following error: -

Challenge Not yet complete... here's what's wrong: 
The Account object level permissions are not configured correctly for the Field Sales User profile.
In the Field Sales User Profile / Object Settings I have Read/Create/Edit ticked for the Account Object but there are no check boxes to be selected. I am not sure if i am updating it correctly or not. Attached the screen shot for reference. Any help is appreciated. 

Thanks. 
User-added image
 
Hi All,

I am having issue with mini page layout in Lightning, the mini page layouts were not displayed as shown in Classic. In Chatter tab, for standard object User the mini page layout is showing options as shown below
User-added image

But in Lightning, we are not seeing the same, I only see "Follow", as shown below
User-added image

Whereas I am not seeing "Send Message" which is shown in Classic. How can I add the "Send Message" option in order to display it in Lightning?
How to display the mobile number and progress bar which are shown in Classic mini page layout?

Thanks in Advance.

 

Hi there,

Any body know about, how to integrate salesforce CTI with Avaya

Any help apriciated!

Thanks
Laxmi

Here is a link to the trailhead that i am doing https://trailhead.salesforce.com/content/learn/superbadges/superbadge_lex

Here is a link to the package that doesnt work
https://na114.lightning.force.com/packagingSetupUI/ipLanding.app?apvId=04t36000000g5yC

 
Hi Team,

I am calling batch apex using trigger after deleting the record, but Start method returns null.
How to query deleted records in batch apex start method.
Trigger :
----------

if(Trigger.isDelete){
                
   Database.executeBatch(new BatchUpdateAcct(Trigger.OldMap),1);
               
}

Batch Class
-------------

global class BatchUpdateAcct implements Database.Batchable<sObject> {
    
    Map<Id,Object__c> mapRecs = new Map<Id,Object__c>();
    
    global BatchUpdateAcct(Map<Id,Object__c> oldValue){
        mapRecs = oldValue;
       
    }
    
    global Database.QueryLocator start (Database.BatchableContext BC){
        System.debug('----Start Method-----'+mapRecs.keySet());
        return Database.getQueryLocator([Select id,Name from Object__c where id in :mapRecs.KeySet()]);
    }
    
    global void execute (Database.BatchableContext BC, List<Object__c> objList){
        
    }
    
    global void finish(Database.BatchableContext BC){
        
    }

}

Please advise any one how to resolve this issue ?
Is it possible to call the batch apex after deleting the records ?


Thanks,
Lakshmi S
 
Hi all
I need some advise on the following error "Cannot modify a collection while it is being iterated" 

what can be the issue.

we have checked if the code does any update on loop however we did not find any 

please advise ASAP

regards
Johny
Hi friends, 
In the existing page layout, I already have a Contact related list. Now i have a requirement to create shareholders which can also be accomodated in Contacts and display the same below the contacts related list. 
How can I add another Contacts related list in pagelayout and show only Shareholders type in that. 

Thanks in advance, kindly suggest. 

Thanks
 there are four objects accounts , policy(custom object) , opportunity , application(custom object). account and policy have masterdetail relationship , account and opportunity also have MD relation. and opportunity have lookup relation with application . every application must have one opportunity assigned.
there is one  field on application called 'status'. 
requiremet :when application status is 'approved by CMS' .  check if related account with opportunity have assigned active  policy?if yes , update application status to "Enrolled" .


code i have written
trigger UpdateApplicationStatusToEnrolled on vlocity_ins__Application__c (before update) {
Map <string,List<vlocity_ins__Application__c>> strMap = new Map <string,List<vlocity_ins__Application__c>>();
set<id> oppid = new set<id>();

for(vlocity_ins__Application__c app :trigger.new)
{
if(app.vlocity_ins__Status__c=='Approved by CMS')
{
oppid.add(app.id);}}




List<opportunity> oppDetails=[SELECT id, AccountId, Account.name ,Account.vlocity_ins__ActivePolicyNumber__c  
 FROM Opportunity where Account.vlocity_ins__ActivePolicyNumber__c >=1 and id IN: oppid];
 
 for(vlocity_ins__Application__c app : Trigger.new)

{
 List<vlocity_ins__Application__c> appList = strMap.containsKey(app.opportunityid) ? strMap.get(app.opportunityId) : new List<vlocity_ins__Application__c>();

                        appList.add(app);

                        strMap.put(app.opportunityId, appList);




 
}

getting error , please help 
  • June 28, 2019
  • Like
  • 0
I have created an Aura component which is a table.
I wish to visualize it in the page of each contact, for example in the Details tab.
How can I do that?

Thanks
Hi,

It may sound trivial but I wanted to confirm if a Bulk load api job does not processes the update/upsert unless the job is closed by the process submitting the job.

Reason I ask is because we have jobs that are run by scheduler and they have a timeout of one hour so if data is more than expected the process does not get to the point of submitting close request and they show up as Open in Bulk Data load portal.

Thanks
Zulfiqar Syed
Hello All,

I'm trying to get EST current time oninit whenever my lightning component is opened. I have concerns about pulling the time in the user's timezone as they are not necessarily in eastern. I also have concerns about pulling the general time of GMT which is used in SFDC development because of daylight savings.

Basically, I want to always dynamically hide a component if it is before 8:30 in the morning. 

Please help! Thanks.

Hi All,
I have created a Process Builder which should fire an email alert for the approver after 1 hr of getting created based on the Criticality of Case.
However it does not seem to work as expected though the criteria is met. Not sure what is missing from my end.
Approval Process

The criteria formula is evaluating to true with the data I have created.
Scheduled Action

Can somebody help me in this regards.

Thanks,

Anant

I'm working on a number of customizations to SFDC and there is at least one value that I will need virtually everywhere in my code. But I don't want to hardcode this everywhere. I would like to have a single place where this value can be updated and hopefully it will be possible to distribute it in a package when I am done.

 

What is the best way to have such a "global" setting? I was thinking about a custom object with a single record, but then I am not sure how to refer to it from everywhere since it's not related to anything per se...

 

Any suggestions will be greatly appreciated.

 

Thank you in advance.

  • March 18, 2009
  • Like
  • 0