• snehal surti 3
  • NEWBIE
  • 80 Points
  • Member since 2015

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 20
    Replies
I have a method that is setup to make an @future call on the account and contact. However, I have a third-party tool that makes updates to the opportunity. Whenever this third-party tool makes an update or a user creates an opportunity, it calls my @future account method setup. Why would that be? Our goal is not to call my method at all when creating/updating an opportunity because now we're running into the "too many future calls:51" error because the third-party tool does batch updates to the opportunity. I know there's a lookup relationship with account and opportunity, but that can't be the case here. Any insight would be greatly appreciated!
Hello, 

I have a custom checkbox in the opportunity object named: JDA__c that is set to true when a user determines it is to be checked. 

I want to ensure that once the checkbox is set to true by the user, that they will not be able to uncheck it or if they uncheck it and try to save the opportunity record, it will prompt them with an error that the JDA__c can not be unchecked. 

Can someone help me with a validation rule that would prevent a user from saving the opportunity record if they uncheck the box from true to false? 

Thanks!

API Field Name: JDA__c
Hi there,
We have a test automation framework in place and would like to consume the enterprise or partner api to get the object at runtime and use it for testing. For e.g. get end-user account and use it for test purpose since account creation is not advisable as test user.

So, i would like to know how frequently the api changes so that i can fetch a new wsdl and replace in my test automation framework.

Thanks,
Pratap
Hi Support,

I am having an issue with process builder rule.

My process builder rule is calling the apex class on the basis of stages on opportunity and  sends email alerts and create task but it is breaking due to bounced email. 

Can you please suggest me how can I fix it so that it can neglect the bounced email and send email notifications and create task.

 @InvocableMethod
    public static void SendEmail(List<ID> opportunityId)
    {
    /* Addeed try and catch block by Zumzum khalid as per case# 00009569 */
       //try
        //{
            runningInASandbox();
            
            
            system.debug('SEnd Email'+opportunityId);
            
            for(Opportunity Opp : [Select id , createdDate,AccountId, stageName , RecordType.Name ,ownerId, Student_Email_Workflow__c 
                                    from Opportunity where Id IN: OpportunityId AND stageName IN: OppStages])
            {                        
                //if(Opp.CreatedDate >= Date.newInstance(2016, 2, 26) )
                //{
                    Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
                    String[] toAddresses = new String[]{Opp.Student_Email_Workflow__c};
                    //mail.setReplyTo('SMaster@gmail.com');
                    mail.setToAddresses(toAddresses);
                    mail.setSenderDisplayName('Qobolak Support');
                    mail.setBccSender(false);
                    //mail.setUseSignature(false);
                    Id conId = getPrimaryContact(Opp.Id , Opp.AccountId);
                    mail.setTargetObjectId(conId);
                    mail.setWhatId(Opp.Id);
                    
                    Id TemplateId = getTemplateID(Opp.StageName , Opp.RecordType.Name);
                    
                    EmailTemplate et = GetTemplate(TemplateId);
                        
                    if(conId == null)
                    {
                        Map<string,string> results = ResolveTemplate(mail,TemplateId , Opp.Student_Email_Workflow__c);
                        
                        mail.setHtmlBody(results.get('html'));
                        mail.setPlainTextBody(results.get('plain'));
                        mail.setSubject(results.get('subject'));
                    }
                    else
                    {
                        mail.setTemplateId(TemplateId );
                    }
                    mail.saveAsActivity = false;    
                    
                    //Set email file attachments
                    system.debug('Get File Name: '+getFileType(Opp.StageName));
                    List<Messaging.Emailfileattachment> fileAttachments = new List<Messaging.Emailfileattachment>();
                    
                    List<Id> ContentIds = new List<Id>();
                
                    for(OpportunityFeed  opfd : [Select RelatedRecordId From OpportunityFeed where ParentId =: opportunityId])
                    {
                        ContentIds.add(opfd.RelatedRecordId);
                    }
                    
                    for(ContentVersion  cv: [Select VersionNumber, Title, VersionData ,Attachment_Type__c , Id, FileType, Description, 
                                            ContentDocumentId ,  ContentDocument.ParentId
                                            From ContentVersion
                                            where Id IN: ContentIds  AND 
                                            Attachment_Type__c IN:getFileType(Opp.StageName) ])
                    {
                        Messaging.Emailfileattachment efa = new Messaging.Emailfileattachment();
                                
                        //efa.setContentType(a.ContentType);
                        efa.setFileName(cv.Title);
                        efa.setBody(cv.VersionData);
                        efa.setinline(false);
                        
                        fileAttachments.add(efa);
                    } 
                    
                    
                    /*for (Attachment a : [select Id, Name, Body, BodyLength , ContentType
                                        from Attachment 
                                        where ParentId IN: opportunityId ])//AND Name IN: getFileName(Opp.StageName)])
                    {
                        system.debug('in attachment: ');
                        
                        // Add to attachment file list
                        
                        for(string s: getFileType(Opp.StageName))
                        {
                            if(a.Name.startsWithIgnoreCase(s))
                            {
                                Messaging.Emailfileattachment efa = new Messaging.Emailfileattachment();
                                
                                efa.setContentType(a.ContentType);
                                efa.setFileName(a.Name);
                                efa.setBody(a.Body);
                                efa.setinline(false);
                                
                                fileAttachments.add(efa);
                            }
                        }
                    }*/
                    if(fileAttachments.size() >0)
                    {
                        mail.setFileAttachments(fileAttachments);
                        //Send email
                        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
                        
                        //create Task
                        Task t = new Task (Status = 'Completed', Subject = 'Email Alert: '+et.Name, Priority = 'Normal',ActivityDate = system.today(),
                                            OwnerId = Opp.OwnerId , WhatId = Opp.Id );
                        insert t;
                    }
                    
                }
            //}//end date condition  
       // }
        
       /* catch (exception e)
        {
            e.getMessage();
        }*/
        
        
    }


Regards,
Khalid
 
Hi All
        I have a date field in account its updated by process builder when i create a formula field in activity and refer the account date field am not getting value in activity any idea for the reason? In activity I selected to display in all page layput and selected visible too 
I want to know situations where I should use Masterdetail or lookup relationship
We recently inactivated the previous system admin but am now noticing some APEX Jobs that are failing. They are all related to managed packages for the NPSP. How can I replace his name with mine so the jobs continue to run as would rather not keep is ID active. 
I have a method that is setup to make an @future call on the account and contact. However, I have a third-party tool that makes updates to the opportunity. Whenever this third-party tool makes an update or a user creates an opportunity, it calls my @future account method setup. Why would that be? Our goal is not to call my method at all when creating/updating an opportunity because now we're running into the "too many future calls:51" error because the third-party tool does batch updates to the opportunity. I know there's a lookup relationship with account and opportunity, but that can't be the case here. Any insight would be greatly appreciated!
Hello Experts,I am neew to the coding part..I am salesforce admin but recently need to learn coding...
So can someone please explain me that if one page is already existing ,Like account obj page layout..and i do want to extend the features ,and i want to do that by coding ..how can i synchronize this both by showing one single page having all the functionality?
Do I have to create 2 differant page for it like classic and VF page seperately..



What i understood my self is i can use the Page layout code in Eclipse IDe. and i can do all the extra coding needed and test it out nd then i can be done with my needs?
Is that the way ..
Or there is any other way i can add some link or some button or some other navicational controller i can add and i can do..Please tell me what is good solution.
Thank you.
Tejal.
When single sign on users are trying to reset their password, they are not getting an email or a message displayed like below. This is making the user confused as they are waiting for an email.

"Passwords cannot be reset for Single Sign-On Users. Please contact your System Administrator to reset your password."

How can I display the above message when a user request reset password?
I have the next code:

--------------------------------------------------------
 for (User U: newUsersData)
      {

            .............

      
              List <employee__c> LEmp =  [select   ID, 
                                  Email__c,
                                First_Name__c,
                                Last_Name__c,
                                User_Record__c,
                                Title__c,
                                MSC__c,
                                Global_Department__c
                             
                                          from employee__c 
                                          where User_Record__c = :U.Id                                                        
                                   ];
                   ....

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

User_Record__c is a lookup over User. The object  employee__c   has User_Record__c  as a field. Whenever I run the previous Select query LEmp becomes empty. But, if I write at the query console:

select   ID, Email__c, First_Name__c,
         Last_Name__c,  User_Record__c,
         Title__c,  MSC__c, Global_Department__c
 from employee__c 
 where User_Record__c = :'SOMEUSERID'

where SOMEUSERID  represents the ID of the user I am looking for then I get the row I need. 
Is there something wrong with my syntax?
Thanks

I created a custom object titled "Interview Results".

By default there is a required standard field that is either a text (80) or an auto-number. I want this field to auto-fill with whatever the user chooses for a picklist. Is this possible?

The picklist is titled "Interview Type".

Essentially I want the standard field "Interview Results" to equal whatever the user picks from the custom field "Interview Type".

Hello, 

I have a custom checkbox in the opportunity object named: JDA__c that is set to true when a user determines it is to be checked. 

I want to ensure that once the checkbox is set to true by the user, that they will not be able to uncheck it or if they uncheck it and try to save the opportunity record, it will prompt them with an error that the JDA__c can not be unchecked. 

Can someone help me with a validation rule that would prevent a user from saving the opportunity record if they uncheck the box from true to false? 

Thanks!

API Field Name: JDA__c
I'm currently trying to create a trigger that runs whenever an Opportunity is created or updated. The trigger needs to check all the other Opportunities related to the Account of the Opportunity being updated. It should check to see if any of the Opportunities have a StageName equal to 'Closed Won ', if so, it should update the account Type to 'Customer'. If none of the Opportunities are closed won, the Account Type should be 'Prospect'.but iam getting accs.get(o.accountId).type as null in debug log.can someone help me on this.
trigger updateAccountIfOppCustomer on Opportunity (before insert, before update) {
    list<opportunity> accOpps = new list<opportunity>();
    list<id>  accountIds = new list<id>();
    
    for(opportunity opp:trigger.new){
        accountIds.add(opp.accountId);
    }
    
    list<opportunity> opps = [select id,AccountId,StageName  from opportunity where accountId IN:accountIds];
    map<id,account> accs = new map<id,account>([select id,type from account where id IN:accountIds]);
    system.debug('accs '+accs );
    for(opportunity o:opps){
            if (o.StageName == 'Closed Won'  || o.StageName == 'Customer Reseller') {
                //acc.type = 'prospect';
                accs.get(o.accountId).type='prospect';
        }
    }
    
}

 
Can someone help me automating this requirement?

We have three fields => Start Date , Term_Duration__c , Termination Date . I want to update the Termination Date using a formula that calculates the date as Start date * Term_Duration__c , Terms is a number field that captures no. of months.

Any other alternative to do this will be greatly appreciated.
Hello , I need help with SalesforceOrg Id. It is changed after migration between two production orgs? etc.(from na1 to na4).

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  

 

That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it.