• Neethu u
  • NEWBIE
  • 25 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 12
    Replies
I have 2 community pages. One for taking input of type email. Once we take the email input, it should be passed to 2nd community page and it should be displayed over here.
While I am sending the email instead of '@' encoded value %40 is coming.
How to display correct special characters ?
I am using TDTM framework for my projects. I have created a triggerhandler record with my class name configured for delete. When I try deleting a record in synchronous mode it is successful. When I try deleting a record in TDTM framework in Asynchronous mode I am getting below error.

first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, hed.TDTM_CourseEnrollment: execution of AfterDelete caused by: System.NullPointerException: Attempt to de-reference a null object Class.hed.TDTM_TriggerHandler.runAsync: line 162, column 1 Class.hed.TDTM_TriggerHandler.runClass: line 135, column 1 Class.hed.TDTM_TriggerHandler.run: line 75, column 1 Class.hed.TDTM_Global_API.run: line 61, column 1 Trigger.hed.TDTM_CourseEnrollment: line 33, column 1: []

The code base is in
https://github.com/SalesforceFoundation/EDA/blob/master/src/classes/TDTM_TriggerHandler.cls

And the error is occuring as in delete it is trying to access newList.

Is there any alternative that I can use after delete in Async mode?
HI All
I have 2 account with same name and different owner,which have different opportunities. When i merge these accounts, the ownerID of the closed/Lost opportunity is not changing to current account ownerID.
Please help.
I am trying to send file as pdf via email. while opening the pdf in mail it is corrupted.
Below is my code.
ContentVersion doc = new ContentVersion();
string before = 'testing base 64';
Blob beforeblob = Blob.valueOf(before);
doc.Title = 'Attachemnt Test';
doc.PathOnClient = 'test5.pdf';
doc.VersionData = beforeblob;
insert doc;

Messaging.EmailFileAttachment attach = new Messaging.EmailFileAttachment();
attach.setContentType('application/pdf');
attach.setFileName('Test.pdf');
attach.setInline(false);
attach.Body = doc.VersionData;

//attach.body = EncodingUtil.base64Decode(jsonStr);

String email = 'abc@gmail.com';
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setUseSignature(false);
mail.setToAddresses(new String[] { email });
mail.setSubject('Document Email Demo');
mail.setHtmlBody('Here is the email you requested: Test.pdf');
mail.setFileAttachments(new Messaging.EmailFileAttachment[] { attach });

// Send the email
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });

 
I have careted a public calendar and shared it with few users and added the public calendar to my calendar.
But the events of that users are not coming in my calendar.

Any help is much appreciated.
I have a custom link which checks whether the theme is lightning, if yes redirecting to lightning report, if no redirect to classic report.
IF({!$User.UIThemeDisplayed}="Theme4d",
This is the condition check I am doing. And I am getting Theme3 as the theme for both classic and lightning .
I am not able to distinguish between lightning and classic with this global variable.
Any help is much appreciated
I am creating a report which filters data based on the query parameter like 'quote name'. We don't want the user to edit this quote name filter when they see the report at runtime.
In lightning we will be locking the filter, If we don't want the user to edit it at run time. So we locked 'quote name filter field.

We are accessing the report through custom link by passing the quote name as parameter. Since the field is locked, it is not taking the quote name filed value passed as query parameter, and it is showing the default report data not specific on the quotes.

This feature was working in Winter '19 and now the org is Spring '19 and it is not working.

Any help is much appreciated.
I have the apex class exposed as webservice, but I am not able to generate the WSDL for my Apex class.
Please help me out.
I have used
var dismissActionPanel = $A.get("e.force:closeQuickAction");
    dismissActionPanel.fire();

But again the pop up is coming for few seconds.
How to disable the popup so that it will not show up.
There was an unhandled exception. Please reference ID: MBTUVXVW. Error: Faraday::ConnectionFailed. Message: Failed to open TCP connection to resourceful-moose-s6bke2-dev-ed.my.salesforce.com:443 (getaddrinfo: Name or service not known)
I am using TDTM framework for my projects. I have created a triggerhandler record with my class name configured for delete. When I try deleting a record in synchronous mode it is successful. When I try deleting a record in TDTM framework in Asynchronous mode I am getting below error.

first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, hed.TDTM_CourseEnrollment: execution of AfterDelete caused by: System.NullPointerException: Attempt to de-reference a null object Class.hed.TDTM_TriggerHandler.runAsync: line 162, column 1 Class.hed.TDTM_TriggerHandler.runClass: line 135, column 1 Class.hed.TDTM_TriggerHandler.run: line 75, column 1 Class.hed.TDTM_Global_API.run: line 61, column 1 Trigger.hed.TDTM_CourseEnrollment: line 33, column 1: []

The code base is in
https://github.com/SalesforceFoundation/EDA/blob/master/src/classes/TDTM_TriggerHandler.cls

And the error is occuring as in delete it is trying to access newList.

Is there any alternative that I can use after delete in Async mode?
I have 2 community pages. One for taking input of type email. Once we take the email input, it should be passed to 2nd community page and it should be displayed over here.
While I am sending the email instead of '@' encoded value %40 is coming.
How to display correct special characters ?
Our program call Salesforce's Webservice API to create Cases, the corresponding method name is: create (sObject[] sObjects).
Sometimes Case cannot be created successfully (about one-third probability), and the error message is "The operation has timed out"
More details:
1. The related Objects contains only one Case object, and the Case object contains only 6 fields, so the amount of data is very small.
2. We use a customer's Sandbox account to test.
3. We found that the process of creating has a long execution time, sometimes 3 to 4 seconds, sometimes more than 30 seconds, and will return the error message "The operation has timed out" when the execution time exceeds 100 seconds.
4. We tested the network between the server and the Salesforce sandbox and found no network problems.
5. If we switch to another Salesforce account (not a sandbox account), the problem does not exist.
User-added imageUser-added image
Here is the apex class I wrote and scheduled but it is throwing an error.

global class LastLoginEmail2 implements Schedulable {
    global void execute(SchedulableContext SC) {
        List<User> uds =[SELECT Id, LastLoginDate, Email FROM User where IsActive=True];
        
        EmailTemplate et=[Select id from EmailTemplate where Name=:'Users_Please_login']; 
        Messaging.SingleEmailMessage[] mails = new Messaging.SingleEmailMessage[0];
        for(User u : uds){
            If( u.LastLoginDate<=System.today().addDays(-1)){
                Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); 
                mail.setTargetObjectId(u.Id); 
                mail.setSenderDisplayName('Salesforce Support'); 
                mail.setUseSignature(false); 
                mail.setBccSender(false); 
                mail.setSaveAsActivity(false); 
                mail.setTemplateId(et.id); 
                mails.add(mail);
            }
            Messaging.sendEmail(mails);
        }
    }
}

Here is the error:
Scheduler: failed to execute scheduled job:class: common.apex.async.AsyncApexJobObject, reason: List has no rows for assignment to SObject

I tried it in different ways but still this error is coming, could anyone help me on this please.

Thanks

Hi! 

I am trying to set up web-to-lead in the free developer org in the Sales instance. I have never used this part of SF before and am learning on the fly, I have been told to research " out of the box " web-to-lead on the core platform. I am wondering if anyone knows where i can find this? 

Am i correct in assuming that I will need to set up my own website and create a leadform in order for this to work or is there a practice website i can enter into the return URL? 

If you respond to this, thank you in advance!! 

Bec

 

 

Hello,

I am receiving a vales from api.
instead of Value i get "Value", How can i remove the two semicolon if they exsist in apex code.

Thank you for suggetion
  • February 05, 2019
  • Like
  • 0
Can anyone share if it exists, as there is very little information on the Internet
I am new to development and can someone help to write trigger for the senario:

whenever a new guest is created (custom object Event Guest) trigger should find if there is an existing lead or contact, if any exists it should add lead/contact to campaign otherwise create a new lead and add to campaign. Campaign is find this way Event Guest->Event->Campaign.

trigger NewGuest on Event_Guests__c(after insert){
    for(Event_Guests__c myGuest : Trigger.New) {
        List<Lead> exLead = [SELECT Id FROM Lead WHERE Email = :myGuest.Guest_Email__c];
            if (exLead.size() == 0)
                {
                    List<Contact> exContact = [SELECT Id FROM Contact WHERE Email = :myGuest.Guest_Email__c];
                    if(exContact.size() == 0)
                        {
                            Lead newLead = new Lead();
                            newLead.FirstName = myGuest.Name;
                            newLead.LastName = myGuest.Last_Name__c;
                            newLead.Phone = myGuest.Guest_Phone__c;
                            newLead.Email = myGuest.Guest_Email__c;
                            newLead.LeadSource = 'Workshop Guest';
                            insert newLead;
                    
                            Campaignmember newMember = new Campaignmember();
                            newMember.LeadId = newLead.id;
                            newMember.dc__Registered_First_Name__c = myGuest.Name;
                            newMember.dc__Registered_Last_Name__c = myGuest.Last_Name__c;
                            newMember.dc__Registered_Email__c = myGuest.Guest_Email__c;
                            newMember.dc__Registered_Phone__c = myGuest.Guest_Phone__c;
                            newMember.Campaign = [SELECT dc__Event_Campaign__c FROM dc__Event__c WHERE Id = :myGuest.Event__c];
                            insert newMember;
                        }
                    else
                        {
                            Campaignmember newMember = new Campaignmember();
                            newMember.Contact = exContact.Id;
                            newMember.dc__Registered_First_Name__c = myGuest.Name;
                            newMember.dc__Registered_Last_Name__c = myGuest.Last_Name__c;
                            newMember.dc__Registered_Email__c = myGuest.Guest_Email__c;
                            newMember.dc__Registered_Phone__c = myGuest.Guest_Phone__c;
                            newMember.Campaign = [SELECT dc__Event_Campaign__c FROM dc__Event__c WHERE Id = :myGuest.Event__c];
                            insert newMember;
                        }               
                    
                }               
            if (exLead.size() != 0)
                {
                    Campaignmember newMember = new Campaignmember();
                    newMember.Lead = exLead.Id;
                    newMember.dc__Registered_First_Name__c = myGuest.Name;
                    newMember.dc__Registered_Last_Name__c = myGuest.Last_Name__c;
                    newMember.dc__Registered_Email__c = myGuest.Guest_Email__c;
                    newMember.dc__Registered_Phone__c = myGuest.Guest_Phone__c;
                    newMember.Campaign = [SELECT dc__Event_Campaign__c FROM dc__Event__c WHERE Id = :myGuest.Event__c];
                    insert newMember;
                }
                
            }
    }
User-added image

I have created a permission set with the system permission "Two-Factor Authentication for User Interface Logins" and assigned it to the Samantha Cordero users. Here is the login history which i have used the Authenticator to authenticate the login of the user.

User-added image
What else am i missing? Any help is much appreciated.