• Manj_SFDC
  • SMARTIE
  • 888 Points
  • Member since 2014

  • Chatter
    Feed
  • 24
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 293
    Replies
Hello Everyone,

I am fairly new to Salesforce. I have encounter this issue and would like to see, is there anyone that can help me with this roadblock that I have encounter? Is there any documents, videos or anyone who can help me with pertaining to how to run a query to find email templates that contain a certain string ex: Pasta that would also include the subject line and content, and trigger if possible
How to make one checkbox field to false on the result of another checkbox field to true and vice versa. Either of two will remain checked.

How to do that with out code?
Hi All,

I have a formula filed and I am comparing the recordtype id (15 digits) with the recordtype id mentioned in custom label (18 digits) instead of changing the custom label can i handle that in the validation rule?
Can I delete an user from salesforce and what is freeze
I want to use SalesForce application in Android Mobiles.Is it possible?
Can you please let me know if Notes and Attachments be customized , out of the box ?
Hi there,
I just began to create test classes and I had a question about the good practices.

Assume we have a trigger that updates a "LastOrderDate__c" on Account, based on the field EffectiveDate in Order object.
We can have different cases :
  • We delete an order - Account had only this order => LastOrderDate__c becomes null
  • We delete an order - Account had several orders => LastOrderDate__c becomes the max(EffectiveDate) of his other orders
  • We create/update an order => LastOrderDate__c becomes the max(EffectiveDate) of all his orders
My question is :
Should I make only one test class including all the steps to cover all the cases ?
  • test class
    • create order 1
    • create order 2
    • delete order 1
    • delete order 2
Or should I make one test class for each case :
  • test class1
    • create order
  • test class2
    • create order
    • delete order
  • test class3
    • create order1
    • create order2
    • delete order1
    • delete order2
I ask this question because the real purpose of this class test is to check if the value of LastOrderDate is correct.
Should I then test with System.assertEquals the value of LastOrderDate after each action (create/delete) ?

Thanks for your help
hi all ,

need to have a code which counts the no of times the record has been accessed , please give logic or code I need to complete 

Thanks

 account acc;

acc = new account;

acc.name='suresh';
acc.industry='telecom'
acc.rating='9';
acc.phone='9246100100';

insert acc;

system.debug('account id....'+acc.id);
I've below code and while running it from Test class only the code in Bold gets covered but the italics is left uncovered. Can anyone help? It should run all the statements inside loop?

if(ppterm.size()>0){
            if( ppterm[0].PP_Term_Approval_Status__c == 'Updated in SAP'|| ppterm[0].PP_Term_Approval_Status__c == 'Closed'){
                country = ppterm[0].PP_Term_Approval_Status__c + '/' + term.PP_Country__c;
                return country;
            }else if(ppterm[0].PP_Term_Approval_Status__c != null && ppterm[0].PP_Term_Approval_Status__c != 'submitted'){
                country = 'No_Termination_Access' + '/' + term.PP_Country__c;
            return country;

            }
            ppterm[0].PP_First_Name__c = term.FirstName;
            ppterm[0].PP_Last_Name__c = term.LastName;
            ppterm[0].PP_Emp_Original_Hire_Date__c =  term.PP_Hiring_Date__c;
            ppterm[0].PP_Emp_Global_ID__c = term.PP_ABI_Global_ID__c;
            ppterm[0].PP_Emp_PersID__c = string.valueOf(term.PP_Employee_Number__c);
            ppterm[0].PP_Emp_DOB__c = term.PersonBirthdate;
}
I've made a new organization-wide e-mail address. The e-mail address is a Google Group. Unfortunately I am not able to receive the email with the verification link.
Things I've looked at alreayd: 
Created another org wide email and I receive the verification email. Deliverability is set to all. 
Ensure that the IP Addresses are whitelisted
I've tested deliverability and received all emails. 
I've downloaded the file log and it shows that the email have been delivered. 
And in google group settings posting is set to allow posting in email, allow users to post to the group on the web. 

Does anyone know how to verify the e-mail address? I have a feeling it has something to do with the google group. 
When am trying to execute this javascript button  am getting an error - A problem with the on click javascript for this button or link was encountered unexpected token else

Please let me know, where am doing wrong?


{!REQUIRESCRIPT('/soap/ajax/29.0/connection.js')} 
{!REQUIRESCRIPT('/soap/ajax/29.0/apex.js')} 

IF( NOT( ISPICKVAL(Opportunity.Project_Type__c, 'Under Warranty') )) 

window.parent.location.href ="/0Q0/e?retURL=%2F{!Opportunity.Id}&oppid={!Opportunity.Id}&00N90000002yzdo=<Auto fill by rule>&Name=<auto fill by Rule>&save_new_url=/a06/e?" 

else 

alert(' Sorry for the inconvenience. For Under Warranty service you can't Create a Quote'); 
}

Hello Masters,

I am writing the following Batch but not able to save it. It only ends up with the afore-stated error even though I have included the execute method perfectly to my knowledge. I am mentioning my Class code below and would appreciate any help.

Class:
Global class DisasterRapMonitor implements Database.Batchable <sObject>
{

Global Database.QueryLocator start (Database.BatchableContext BC)
{
String DisasterWithoutRap = 'Select id,name from Disaster__c where id NOT in (select DisasterId from Response_Action_Plan__c)';
return Database.getQueryLocator(DisasterWithoutRap);
}

Global void execute ( Database.BatchableContext BC,List<Disaster__c> Dis)
{
for (Disaster__c di:Dis)
    {
    Task tk = new Task ();
    tk.Subject = 'Need to be associated with a Response immediately. Please work it out.';
    tk.WhoId = di.Id;
    }
    
    Update Dis;
}

Global void finish (Database.BatchableContext BC)
{}

}

How to exclude an user from a validation rule?
Hello,

We currently have some scheduled reports which contain personal data which we need to protect. Our management team would like the reports to be scheduled still and emailed to them but we need the report to be a URL like and not to contain the report in the email.

Is this possible? Could we just set up an outlook email and paste URL in? Would URL always be the same?

Thanks
Hi everyone,

I am looking for a code and explanation to learn record sharing or locking in SF using Apex code, can someone help

Thx in advance
public class StringArrayTest {
    public Static List<String> generateStringArray(integer n){
/* i want to know that, here the integer n is  not initialized with any value, so how i<n works*/
         List<String> myArray = new List<String> ();
        for(integer i=0; i<n; i++){
            myArray.add('Test' +i);
            System.debug(myArray[i]);
        }
            return myArray;
    }
}
// And also my above program is failing .
//help me please.
What are the ways I can use to lock the record in salesforce , please help
Hello,
I have created a workflow that sends out an outbound message based of some fields not being equal to null and for some odd reason we have a profile that cannot send the outbound message and I have checked the box on the profile settings that allows for outbound messages to be sent. The endpoint URL is not the issue given that my profile(System Administrator) and other profiles(Executives) that we have can send the outbound message without an issue. I have checked all the permissions on the profile compared to mine and they have more things checked than I do. Any assistance would be greatly appreciated.
Hi, we have a number of tasks that are automatically added to opportunities using Process Builder and Flow to pass different assigned too and due dates etc.  What I need to do is if an opportunity is marked as Stage = "Archived" i need a flow to check if there are any open tasks on the opportunity and then delete them,

We need to delete rather than close as these tasks are asociated to steps in the closing process and if the opportunity is archived the closing process stops so I dont want these tasks to show up for my users.

How do i use a flow to check and list all tasks that are open and then conduct a delete action?
 
Hello everyone, 

I have a requirement as follows,

when the Account in updated need to send the email to all the contacts,

custom object - stores the attachments related to contacts
contact has field -Assigned To  which can store either user or group data

when the account is updated , I need to query all the contacts related to that account, all the attachments related to the contact and Assigned To field from contact 
send an email to the contacts with attachments and to the user/group in the Assigned To field

can anybody help

Thanks
Hello everyone,

I have a list view on Leads and I am trying to change the owner through inline editing , but I am unable to do so, it displays that the field is locked,can you please try to hlep me.

Note - I am trying in the Lightning version

thanks
Hello everyone,

While developing the trigger the logic can be added in the trigger or can be included in the Handler classes and those handlers can be used in the trigger, will there be any disadvantages of using trigger handlers?
Heelo folks,

I have a custom object and Allow Reports is disabled on it, I would like to grant the permission to some of the users to create a report on that custom object , can it be done?

Thanks
Hello guys,

I need to write a SOQL with sorting on 2 columns , start date and created date, can it possible to sort on multiple columns , or by default Apex considers only the first column used in sorting , please help
Thanks !
I have this requirement Let’s say there is a manager manager1 who manages user1 and user2 and user 1 manages 10 other people and user2 manages 20 people and these 20 people may in turn manage n number of people (recursive way)
i need to get the list of people managed by manager 1 directly or indirectly 
can you guys try to help here.  

Thanks
Hello everyone,

can anybody help/guide me on learning the vlocity cpq?

Thanks
Hello I have navigated to http://certification.salesforce.com/# and logged in a case and I have received an acknowledgement email with the case number, however I am not receivng a response from the salesforce team, I even tried by replying to the same email (it says 
no-reply@salesforce.com),  but no response

can someone help here

Thanks
How to use & symbol in validation rule error message, please help, trie with %26 its not working 
Thanks
Hi everyone,

I am completed the Multiple choice questions for Platform Developer 2 as well as the  super badges, can someone help me to understand how do I get the certificate.
Thanks
I have a list of reusable Test Classes , I need to share them(only Test classes) with others so that they can use them in their orgs can I create an unmanaged package and share it.
Please suggest
I have a report and I need to schedule it run every quarter in a year, how can this be done?
Please help
Thanks
Hello , 

I need a help on Advanced Apex Specialist Step 8 , I have created the test classes and all of them successfully executed , overall coverage is 86 however I am facing this issue.

Challenge Not yet complete... here's what's wrong: 
Ensure that after you clear test data, you run your tests once and the required test coverage is achieved.

can anyone help 

Thanks
I have a Text Area field where in use enters the data, I need to split that in the flow (may be based on space) , can anyone help here , can I use formula fields to accomplish this

​Thanks
Hello everyone, I am using this in my REST class

List <Account> accountList;
        try {
            accountList = [SELECT Id, Name,(SELECT Id, Name FROM Contacts) FROM Account];
            return accountList;
        }

in the RESTHandler I am getting the response as lsit of accounts with associated contacts , I need the count of number of accounts in the response, can someone help 
Hello everyone,

I am working on step 10 of Lightning Component Framework Specialist and getting an error saying We can't find the Map component in the right column of the Friends with Boats Lightning page.when I click on check challenge, can anybody help me here.

Thank you

BoatSerachFormController.js

({
    doInit : function(component, event, helper){

        helper.loadBoatTypes(component);
    },

    handleChange : function(component, event, helper){
        console.log(component.find("boatTypes").get("v.value"));
        component.set("v.selectedType", component.find("boatTypes").get("v.value"));
    },

    search : function(component, event, helper){
        var selectedType = component.get("v.selectedType");
        console.log("Search button pressed " + selectedType)
    },

    newBoat : function(component, event, helper){
        var boatTypeId = component.get("v.selectedType");
        console.log("New button pressed " + boatTypeId);
        var requestNewBoat = component.getEvent("launchNewBoatForm");
        requestNewBoat.setParams({"boatTypeId": boatTypeId});
        requestNewBoat.fire();
    },

    handleNewBoatForm: function(component, event, helper){
        console.log("handleNewBoatForm handler called.")
        var boatTypeId = component.get("v.selectedType");

        console.log(boatTypeId);
        var createNewBoat = $A.get("e.force:createRecord");
        createNewBoat.setParams({
            "entityApiName": "Boat__c",    
        })
        if(! boatTypeId==""){
            createNewBoat.setParams({
                "defaultFieldValues": {'BoatType__c': boatTypeId}
           })
        }
        createNewBoat.fire();
    },
   
})
Hello everyone,

can anybody help/guide me on learning the vlocity cpq?

Thanks
Hi, 
 I,m unable to get code coverage for sending emailnotification. can anyone help me. Thanks in advance

public class NotificationEmail {
    
     public static void sendNotificationEmail(List<Account> newList2){
          
        map<id,set<string>> AccRecp = new map<id,set<string>>();
       
         for(Account acc2 : newList2)
        {
            if(acc2.Activity_Email__c != null && acc2.Activity_Email__c != '' && acc2.Status__c == true )
            {
                set<string> emailids = new set<string>();
             
                list<string> templist = acc2.Activity_Email__c.split(',');
               
                emailids.addALL(templist);
              
                AccRecp.put(acc2.id,emailids);
               
            }
             
        }
         if(!AccRecp.isEmpty())
        {
            EmailTemplate et = [ Select Body, HtmlValue, Id, Name, Subject from EmailTemplate  where Name='Post Suspension' Limit 1];
            List<Messaging.SingleEmailMessage> theEmails = new list<Messaging.SingleEmailMessage>();
             for(Account ac: newList2)
            {
                if(AccRecp.containsKey(ac.id))
                {
                    set<string> temp = AccRecp.get(ac.Id);
                   
                    list<string> emaillist= new list<string>();
                     emaillist.add(label.Account_team);
                    emaillist.addAll(temp);
                    string body = et.Body;
                    
                    OrgWideEmailAddress[] ar = [select Id,Address from OrgWideEmailAddress where Address = 'abc@company.com' ];
                    Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
                    mail.setToAddresses(emaillist);
                    mail.setSubject(' Notice of Suspension-' +' '+ ac.Name);
                    mail.setOrgWideEmailAddressId(ar.get(0).id);
                    mail.setPlainTextBody(body);
                    theEmails.add(mail);
                    
                }
            }
        
              if(!theEmails.isEmpty())
            {
                list<Messaging.Email> allMails = new list<Messaging.Email>();
                for( Integer j = 0; j < theEmails.size(); j++ ){
                    allMails.add(theEmails.get(j));
                }
                if(!allMails.isempty())
                    
                {
                    Messaging.SendEmailResult[] results = Messaging.sendEmail( allMails,false );
                    
                    if (results[0].isSuccess()) {
                        
                        
                        system.debug('The email was sent successfully.');
                     } else {
                         system.debug('The email failed to send: '+results[0].getErrors());
                     }
                }
            }
        }
    }
  • February 19, 2019
  • Like
  • 0
I have wrapper class which I want to pass to batch class as want to send 1000's of email and also want to update records
Hi All,

I wanted to roll up the 2 text fields of a child object into parent object how to that 
Example :   Value 1 + '  ' +  Quality 1;
                   Value 2  + '  ' + Quality 2
                  Value  3 + '  ' +   Quality 3
I wnated to rollup this  vlaues to the parent obejct 
I'm trying to create an Apex Class that checks all Account records on a daily basis and sends an email to the email field on ones that have a review due on that date.

For example:
Vendor ABC Pty Ltd has opted in for reviews (Vendor Review: Reminders = true), has an annual review date set in their record (Vendor Review: Date = 17/02/2019), and an email address set in their record (Vendor Review: Email = abc@test.com).

Here is my code:
global class VendorReviewCronJob implements Schedulable{ 
    
        global void execute(SchedulableContext SC) {
            sendmail();
        }

        public List<Id> getVendorReviewEmailAddresses(Integer Month, Integer Day) 
        { 
            List<Id> mailToIds = new List<Id>();
             
            Account[] a = [SELECT Id, Vendor_Review_Email__c, Vendor_Review_Date__c, Vendor_Review_Reminders__c
                            FROM Account 
                            WHERE DAY_IN_MONTH(Vendor_Review_Date__c) = : Day 
                            AND CALENDAR_MONTH(Vendor_Review_Date__c) = : Month   
                            ];
        
            for(Account recipient : a) {
                    
                    System.Debug('\n*******Found VendorReview Recipient');
                                        
                    if (recipient.Vendor_Review_Reminders__c == true)
                    {
                        mailToIds.add(recipient.Id);
                        System.Debug('\n*******Recipient: '+ recipient.Vendor_Review_Email__c);
                         
                    } else {
                        System.Debug('\n*******NO Recipient');
                    }
                
            }

            return mailToIds;
        }




        public void sendMail() 
        {
      
            String debugAddress = 'eyewell@salesforce.com';
            String VendorReviewEmailTemplateName = 'User_Vendor_Review_Required';       
            String debugMessage;
            String[] toAddresses;

            Integer DayOfEvent   = date.today().day();
            Integer MonthOfEvent = date.today().month();

            List<Id> VendorReviewIdsList = getVendorReviewEmailAddresses(MonthOfEvent,DayOfEvent);

            EmailTemplate VendorReviewTemplate = [select Id,Name,Subject,body from EmailTemplate where DeveloperName = :VendorReviewEmailTemplateName];
 
            if(VendorReviewTemplate != null && VendorReviewIdsList.isEmpty() == false)
            {

                Messaging.MassEmailMessage VendorReviewMail = new Messaging.MassEmailMessage();
    
                VendorReviewMail.setTargetObjectIds(VendorReviewIdsList);
                VendorReviewMail.setTemplateId(VendorReviewTemplate.Id);
                VendorReviewMail.setUseSignature(false);
                VendorReviewMail.setSaveAsActivity(true);

                try {
                    Messaging.sendEmail(new Messaging.MassEmailMessage[] { VendorReviewMail });
                }catch(Exception e)
                {
                    System.Debug(e);
                }
           
            }
            else
            {
                System.Debug('VendorReviewCronJob:sendMail(): Either an email template could not be found, or no Account has a Vendor Review today');
            }

                
        }

    
}
I've scheduled the apex class to run daily, but although it's showing that it has run, the emails for the reviews due that day haven't sent, and I also haven't received the confirmation email of how many were sent.

Admittedly, I got the base of the code from a mailer that was checking for birthdays on a Contact object, but I felt the same principles still applied.

Can anybody see where I've gone wrong?
I am currently working as a SF tester but trying to move to SF development. I have attended few interviews, though theory part or direct questions are going well but every time I am getting stuck when the opposite party starts with the scenario based questions. As I have not worked as a developer so I lack that experience. Can anyone tell me or help me out, from where I can prepare myself or how can I make myself good in handling scenarios.

Anykind of suggestions will be appreciated. 

My apology if this not the correct platform to ask this question.
Can anyone tell me why we dont have before undelete trigger ?
Hello Everyone,

I am fairly new to Salesforce. I have encounter this issue and would like to see, is there anyone that can help me with this roadblock that I have encounter? Is there any documents, videos or anyone who can help me with pertaining to how to run a query to find email templates that contain a certain string ex: Pasta that would also include the subject line and content, and trigger if possible
How to make one checkbox field to false on the result of another checkbox field to true and vice versa. Either of two will remain checked.

How to do that with out code?
Hi All,
         I have custom field in account object, I put an image in that custom field.I want to send an email along with account name and that custom field using email templates how it is possible ..... 
what type of custom field I have to create & how to send an email Can you please help me.............................................................
 
Suppose we have Status field in Account object with dropdown values as 
  • Open
  • Working
  • Close
My requirement is whenever I create a Account record bydefault Status should take value as Open And if Status is Open then three more fields in the same Account object should be updated with some particular values say 30, 45 and 69.

For the above mentioned scenario what shall I choose, Workflow or Process builder.
 
Heelo folks,

I have a custom object and Allow Reports is disabled on it, I would like to grant the permission to some of the users to create a report on that custom object , can it be done?

Thanks