• Natasha Ali
  • NEWBIE
  • 110 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 46
    Questions
  • 21
    Replies
Hi,

I have a flow which seems to be working fine when I go to debug it, it's just the GET element that doesn't seem to be retrieving any records at all - even when I add the criteria to meet a specific test record, or remove the criteria completely to retrieve all records (returns null).

The Flow would be triggered by a process, GET Client/Candidate (Person Account) records and store them, then a DECISION element to either update the record if the email address is the same as the input variable OR create a new record if not.
 - If there is an existing record with a matching email address, then the ASSIGNMENT element updates the existing record with a change to the status.
 - Else, proceed to CREATE a new record.


User-added image

There is a record with the same email address and that meets the conditions of the GET element of the Flow (even when I remove the criteria I get the same error): 

User-added image

 
Hi,
We've implemented an API that connects to an external database, which we can search within our Salesforce org. I'm running into an 
Attempt to de-reference a null object error:

User-added image

Here is the Visualforce Page:
<apex:page controller="EDSSearchController">
    <apex:form >
        <apex:pageBlock title="EDS Search">
            Enter search term here: <apex:inputText value="{!searchTerm}"/>
            <apex:commandButton action="{!Search}" value="Search"/>
        </apex:pageBlock>
    </apex:form>
</apex:page>

And the Controller:
public class EDSSearchController {

    public String searchTerm { get; set; }
    servicesEdrsEducationGovUkV17.EmployerLookupSoap a;
    EDS_Credentials__c edsCreds;


    public EDSSearchController() {
      edsCreds = EDS_Credentials__c.getValues('Default');
        a = new servicesEdrsEducationGovUkV17.EmployerLookupSoap();
    }

    public String getSearchTerm() {
        return searchTerm;
    }

    public PageReference search() {
        a.ByFreeText(searchTerm, false,'O','',edsCreds.API_Key__c);
        return null;
    }
}

How would I resolve this error?

ANY help is MUCH appreciated!
Many Thanks,
Natasha :)
 
Hi,
I have the following controller which seems fine in terms of syntax but I'm still getting an error? I only added a StageName to the SOQL (the original controller deployed fine without it):
 
public class OpportunityVFController {
    
    public List<Opportunity> opp {get;set;}

    public OpportunityVFController {
        opp = [SELECT Id, Name, CreatedDate, Pathway__c, StageName, Placement__c, LDN_Company__c, Description, Job_Title__c, CloseDate, 
        NextStep, Salary__c, Future_Prospects__c, Duration__c, Training_Delivery_Site__c, Qualification_taken__c, Entry_Requirements__c, 
                Key_Responsibilities__c, Skills_Required__c, Account.Name, Employer_Name__c,  Account.BillingPostalCode, Account.BillingStreet, Account.BillingCity FROM Opportunity 
        WHERE (StageName = '1 - Qualifying'or StageName = '2 - Booked for CK' or StageName = '3 - Live'
                or StageName = '4 - Work Trial') AND (Placement__c = 'New Apprentice') AND (Post_Ad__c = TRUE)];
          }
}

The original deployed one:
public class OpportunityVFController {
    
    public List<Opportunity> opp {get;set;}

    public OpportunityVFController {
        opp = [SELECT Id, Name, CreatedDate, Pathway__c, StageName, Placement__c, LDN_Company__c, Description, Job_Title__c, CloseDate, 
        NextStep, Salary__c, Future_Prospects__c, Duration__c, Training_Delivery_Site__c, Qualification_taken__c, Entry_Requirements__c, 
                Key_Responsibilities__c, Skills_Required__c, Account.Name, Employer_Name__c,  Account.BillingPostalCode, Account.BillingStreet, Account.BillingCity FROM Opportunity 
        WHERE (StageName = '2 - Booked for CK' or StageName = '3 - Live'
                or StageName = '4 - Work Trial') AND (Placement__c = 'New Apprentice') AND (Post_Ad__c = TRUE)];
          }
    
}
Any help is much appreciated!
Many Thanks,
Natasha :)
 
Hi,
I have the following controller and need to add a criteris: AND 
Post_Ad__c = TRUE

How do I go about doing this?
public class OpportunityController {
    
    public List<Opportunity> opp {get;set;}

    public OpportunityController() {
        opp = [SELECT Id, Name, CreatedDate, Pathway__c, StageName, Placement__c, LDN_Company__c, Description, Job_Title__c, CloseDate, 
        NextStep, Salary__c, Future_Prospects__c, Duration__c, Training_Delivery_Site__c, Qualification_taken__c, Entry_Requirements__c, 
                Key_Responsibilities__c, Skills_Required__c, Account.Name, Account.BillingPostalCode, Account.BillingStreet, Account.BillingCity FROM Opportunity 
        WHERE (StageName = '2 - Booked for CK' or StageName = '3 - Live'
                or StageName = '4 - Work Trial') AND (Placement__c = 'New Apprentice')];
          }
}

Any help is much appreciated!
Many Thanks,
Natasha :)
Hi,
I have a trigger in Salesforce which converts Leads into Person Accounts if the 'Company Name' field is Null :
Trigger AutoConvert on Lead (after insert) {
     LeadStatus convertStatus = [
          select MasterLabel
          from LeadStatus
          where IsConverted = true
          limit 1
     ];
     List<Database.LeadConvert> leadConverts = new List<Database.LeadConvert>();

     for (Lead lead: Trigger.new) {
          if (!lead.isConverted && lead.Company == null) {
               Database.LeadConvert lc = new Database.LeadConvert();
               String oppName = lead.Name;
               
               lc.setLeadId(lead.Id);
               lc.setDoNotCreateOpportunity(true);
               lc.setConvertedStatus(convertStatus.MasterLabel);
               
               leadConverts.add(lc);
          }
     }

     if (!leadConverts.isEmpty()) {
          List<Database.LeadConvertResult> lcr = Database.convertLead(leadConverts);
     }
}

I need to write some test classes to validate and deploy this code and it needs to include any error handling. How would I go about achieving this? 

Any help is much appreciated :)
Many Thanks,
Natasha  
Hi,

So we will be using an API to connect Salesforce to a third party app and one of the fields shared is Address. In Salesforce, the address is already concatenated (it comes in through a separate web app as Address Line, Address Line 2, City and Postcode). However the third party we want to connect to requires the Address field to be split. Is there some apex or mechnanism that would split the fields? Or anything that needs to be written into the API connections to enable this?

Any help is much appreciated :)
Many Thanks,
Natasha 
Hi,
I'm using the following formula to set a date and time for another field:
DATETIMEVALUE(TEXT(DATEVALUE([Session__c].Course__c.Knowledge_Module_Session_1__c)+266) +” 09:00:00")
Regardless of time changes and time zones, I need to set the time to be 09:00:00 everytime. Is there any way of setting the time as 09:00:00 and forcing it to stay like that?

Many Thanks,
Natasha 
 

Hi,
I need to expose certain Salesforce Data to a third party app that doesn't have a ready-made Salesforce integration. I'm going to use REST API to expose the data and this action will be triggered when a status changes. 

Here is the general process of what should happen 
1. User changes status which triggers the API
2. API call made to an external app and Salesforce Data is exposed, ready to be consumed
3. External App consumes data 

I'm struggling to understand what would I need to ask from the third part? and is there anything else I would need to do?

Any help is much appreciated :)
Many Thanks,
Natasha 


 

Hi :)
We have a custom object called ‘Courses’ and is the parent object of another custom object called ‘Sessions’. 'Sessions' are created within Courses and the number of sessions depends on the 'Course Structure'
We have a trigger that creates sessions when the new course is created:

trigger CourseTrigger on Course__c (after insert) {
  if(Trigger.isAfter){
    if(Trigger.isInsert){
      CourseTriggerHandler.createSessionAfterCourseCreated(Trigger.new);  
    }
  }
}

The Trigger Handler:

/*

**   Method & Business Logic:
    1) createSessionAfterCourseCreated: 
      - after new Course is created, create new Session(s) based on the amount of '# of Sessions' in Default Modules.
/*

public with sharing class CourseTriggerHandler {
  
  public static void createSessionAfterCourseCreated(List<Course__c> newList){
    
    Map<Id,Id> mapCourseCourseStructure = new Map<Id,Id>();
    Set<Id> courseStructureIds = new Set<Id>();
    for(Course__c c : newList){
      
      //Store related Course_Structure__c
      courseStructureIds.add(c.Course_Structure__c);
      
    }
    
    // mapCSDM = map of Course Structure => Default Modules
    Map<Id,List<Default_Module__c>> mapCSDM = new Map<Id,List<Default_Module__c>>();
    // mapDefaultModule = map of DefaultModule.ID => Default Modules
    Map<Id,Default_Module__c> mapDefaultModule = new Map<Id,Default_Module__c>();
    for(Default_Module__c dm : [Select Name, Course_Structure__c, Module_Code__c, of_Sessions__c From Default_Module__c Where Course_Structure__c IN:courseStructureIds]){
      
      if(mapCSDM.get(dm.Course_Structure__c) == null) mapCSDM.put(dm.Course_Structure__c, new List<Default_Module__c>());
      mapCSDM.get(dm.Course_Structure__c).add(dm);
      
      mapDefaultModule.put(dm.Id,dm);
    }
    
    // create CourseModule records
    List<Course_Module__c> lstCourseModule2Insert = new List<Course_Module__c>();
    for(Course__c c : newList){
      
      //check in case there are Course Structure without Default Module => continue loop
      if(mapCSDM.get(c.Course_Structure__c) == null) continue;
      
      for(Default_Module__c dm : mapCSDM.get(c.Course_Structure__c)){
        lstCourseModule2Insert.add(new Course_Module__c(Name=dm.Name, Default_Module__c = dm.Id, Course__c = c.Id));
      }
    }
    
    insert lstCourseModule2Insert;
    
    
    // create Session records
    List<Session__c> lstSession2Insert = new List<Session__c>();
    
    for(Course_Module__c cm : lstCourseModule2Insert){
      
      Integer sessionNumber = Integer.valueOf(mapDefaultModule.get(cm.Default_Module__c).of_Sessions__c);
      
      for(integer i=0; i<sessionNumber; i++){
        lstSession2Insert.add(new Session__c(  Name = mapDefaultModule.get(cm.Default_Module__c).Name + ' - Session ' + (i+1),
                            Course__c = cm.Course__c,
                            Default_Module__c = cm.Default_Module__c,
                            Module_Code__c = mapDefaultModule.get(cm.Default_Module__c).Module_Code__c,
                            Course_Module__c = cm.Id
                            ));
      }
    }
    
    // insert new Sessions
    insert lstSession2Insert;
    
    
  }
}
 


The requirement is to auto-populate the session planned dates which are based off the initial Course Start Date and follow the same pattern every time for this Course Structure:

User-added image
To follow this pattern:

User-added image

Any help is much appreciated,
Thaanks :)
Natasha 
 

Hi All,
I'm getting emails about SFDC Expiring Certificate Notifications and I don't understand what I need to do! I've read the recommended article: https://help.salesforce.com/articleView?id=000231048&type=1 but I'm still unsure as to what I have to do! We do have 3rd party APIs and apps such as Zapier and Typeform which connect to Salesforce. 

Any help is much appreciated :) 
Thanks,
Natasha 
Hi All,
I have a validation rule on the contract object which doesn't allow a checkbox to be checked by users until they have completed the required fields. The issue is that some of these fields are picklist values and are very much needed. Here is the rule with the other fields (without the picklist ones):
AND( 
OR( 
ISBLANK (Knowledge__c ), 
ISBLANK(Functional_Skills__c), 
ISBLANK(App_Attendance_Absent__c), 
ISBLANK(App_Attendance_Late__c), 
ISBLANK(App_Attendance_Present__c), 
ISBLANK(App_Attendance_Present_including_Late2__c), 
ISBLANK(How_can_you_improve_your_score__c), 
ISBLANK(Apprentice__c), 
ISBLANK(Career_Options__c), 
ISBLANK(Competency__c), 
ISBLANK(Date_of_last_Review__c), 
ISBLANK(Date_of_this_review__c ), 
ISBLANK(Due_Date_1__c), 
ISBLANK(Due_Date_2__c), 
ISBLANK(Due_Date_3__c), 
ISBLANK(Employer_Representative_Comments__c), 
ISBLANK(English_Diagnostic_Assessment__c), 
ISBLANK(Functional_Skills__c), 
ISBLANK(Health_Safety_E_D_topic__c), 
ISBLANK(How_would_you_score_yourself__c), 
ISBLANK(Issues_or_Concerns__c), 
ISBLANK(LDS_Comments__c), 
ISBLANK(LDS_How_to_improve_score_next_month__c), 
ISBLANK(maths_English__c), 
ISBLANK(maths_Diagnostic_Assessment__c), 
ISBLANK(Overall_Progress_Blue__c), 
ISBLANK(Overall_Progress_Green__c), 
ISBLANK(Overall_Progress_Orange__c), 
ISBLANK(PDP__c), 
ISBLANK(Projects_or_areas_of_work__c), 
ISBLANK(Review_Location__c), 
ISBLANK(Safeguarding_topic__c), 
ISBLANK(Score_for_the_month__c), 
ISBLANK(LDS_Score_for_the_month__c), 
ISBLANK(Target_1__c), 
ISBLANK(Target_2__c), 
ISBLANK(Target_3__c), 
ISBLANK(To_keep_myself_and_others_safe_I_can__c), 
ISBLANK(Work_Attendance_Late__c), 
ISBLANK(Work_Attendance_Sick__c) 
), 
Review_Completed__c = true 
)
Here are the picklist values:
ISBLANK(All_Smart_Targets_met__c),
   ISBLANK(Additional_Support__c),
   ISBLANK(Apprentice_of_the_month__c),
   ISBLANK(Apprenticeship_work__c),
   ISBLANK(At_risk_record_to_be_created_or_updated__c),
   ISBLANK(Do_we_need_to_open_FS_aims__c),
   ISBLANK(Enrichment_sessions__c),
   ISBLANK(For_Whom__c),
   ISBLANK(For_Whom_2__c),
   ISBLANK(For_Whom_3__c),
   ISBLANK(Is_employer_partnerships_input_required__c),
   ISBLANK(Is_the_manager_happy_generally__c),
   ISBLANK(Qualification_Level__c),
   ISBLANK(Reflective_log__c),
   ISBLANK(Target_Type_1__c),
   ISBLANK(Target_Type_2__c),
   ISBLANK(Target_Type_3__c),
   ISBLANK(The_Employer_Reference__c),
   ISBLANK(Upcoming__c),
Thaaaanks :) 

 

Hi, so I have an existing VF page which comes up when the custom button is clicked on the Account object. I've also checked the "Available for Lightning Experience, Lightning Communities, and the mobile app" box.

The page is a Calendar view. Here's the VF code before and after:

<apex:page action="/00U/c">
    <apex:ListViews type="Event"/>
</apex:page>

AFTER:

<apex:page action="/00U/c" lightningStylesheets="true">
    <apex:ListViews type="Event"/>
</apex:page>

It let me save the pages but doesn't work!
Here is the custom link button:
 

https://ldngroup.my.salesforce.com/00U/c?cType=2&md2=41&md0=2017 
It's working perfectly fine in Classic, just not in Lightning.

Any help is much appreciated!!
Thanks,
Natasha
Natasha Ali 
What is the alternative attribute to <apex: enhancedList>?
Hi all,
I'm migrating the SF org over to lightning the following VF page needs to be converted into a lightning component as the <apex: enhancedList> attribute isn't supported. What would be the alternative to it? Or are there any workarounds? 
 
<apex:page lightningStylesheets="true">
<apex:enhancedList type="Activity" height="700" customizable="True"/>
</apex:page>

Thanks
Hi,
I'm unsure how to go about doing this, I have the following VF code which I need as a lightning component as we are migrating over to lightning. Any help is much appreciated!!! Thank you! :)
 
<apex:page lightningStylesheets="true">
<apex:enhancedList type="Activity" height="700" customizable="True"/>
</apex:page>

 
I'm very new to apex and programming, and I've come up with the following trigger, but need a test class in order for it to be deployed. What we essentially want to do is autoconvert the lead into a person account when the company field is blank, (coming in via an external webform).
Here's the trigger:
Trigger AutoConverter on Lead (after insert) {
    LeadStatus convertStatus = [
         select MasterLabel
         from LeadStatus
         where IsConverted = true
         limit 1
    ];
    List<Database.LeadConvert> leadConverts = new List<Database.LeadConvert>();

    for (Lead lead: Trigger.new) {
         if (!lead.isConverted) {
              Database.LeadConvert lc = new Database.LeadConvert();
              String oppName = lead.Name;
               
              lc.setLeadId(lead.Id);
              lc.setOpportunityName(oppName);
              lc.setConvertedStatus(convertStatus.MasterLabel);
             
              leadConverts.add(lc);
         }
    }
    if (!leadConverts.isEmpty()) {
         List<Database.LeadConvertResult> lcr = Database.convertLead(leadConverts);
    }
}

any help would be MUCH appreciated!! :)