• Esther Onema
  • NEWBIE
  • 220 Points
  • Member since 2016
  • Systems Analyst


  • Chatter
    Feed
  • 7
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 21
    Replies

Hello.

Is it possible to convert a drop down field on the contact page to a text field? 

1.what is assert..? what the use..?
2.what is opportunity team...?
3..what force .com sites ..?
4.what is terrority mangement..?what the use..?
5.what is custom component..?
I'm new to Chatter & have searched but cannot identify the correct one! Can anyone provide the link to the correct page please?

I do not have any users, other then the 3 that come with it plus myself.  I don't have Allison Wheeler or any other that are used in the demos. Does anyone know why the users would be in there?

 

Hi, 
I have a problem with module "Manipulating Records with DML"
The 'insertNewAccount' method must accept an incoming string as a parameter, name the account after the parameter, insert it into the system and then return the account record.
My code is: 

public class AccountHandler {

    public static ID insertNewAccount(String nombre){
        ID prueba =null;
         Account cuent= new Account();
                try {
                  cuent = new Account(Name=nombre);
                  insert cuent;
                       prueba = cuent.Id;
               
            } catch (DmlException e) {
                  System.debug('A DML exception has occurred: ' +
                        e.getMessage());
              }
        System.debug('**********' +prueba);
        System.debug('**********' +cuent.Name);
        return prueba;
    }
}
I would like you ayudaseis I find the error.
Thank you
trigger AddRelatedCustomer on Account (after insert) {
I am new to salesforce and I am gett the no viable alternative at character '"' from this trigger.  Can you tell me what I am doing wrong

List<Contact> cont = new List<Contact>();
    for(Account acct: Trigger.new)
    {
           cont.add(New Contact(LastName = "Stitt",FirstName = "Sonny", AccountID = acct.ID));
        insert cont;
        
    }
}
Hello, 
I am attempting to create a trigger that populates an empty Country Code field (on an Event) given that the Assigned to Country Code (the event is assigned to someone) field is populated. I receive the following error after running a test on my Trigger. 

System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, SVMXC.Event_Trigger1: execution of BeforeInsert

caused by: System.NullPointerException: Attempt to de-reference a null object

Trigger.SVMXC.Event_Trigger1: line 104, column 1: []


Here is my trigger
public class SVMX_PopulateActivityCountryCode extends TriggerAction
{
    public Id eventRecordTypeId = Schema.SObjectType.Event.getRecordTypeInfosByName().get('PS WP CS').getRecordTypeId();
    List<ID> eventIDList = new List<ID>();
    public Event[] eventsToUpdate = new Event[]{};

    
    public SVMX_PopulateActivityCountryCode() 
    {
        //Call super to set batch variables and context 
        super();
    }
    
    public override Boolean shouldRun(){
        if(this.isInsert()&&!this.hasRun())
        {
            for(Event e: (List<Event>)Trigger.new)
            { 
                if(e.RecordTypeId == eventRecordTypeId && e.SXWP_Country_Code__c==null&& e.OwnerId!=null&&e.SXWP_Assigned_To_Country_Code__c!=null) 
                {
                    eventIDList.add(e.Id);
                }
            }
        }
        return !eventIDList.isEmpty();
    }
    
    
    public override void doAction()
    {
        this.markRun();
        
        for(Event existingEvent:[SELECT id FROM event WHERE id IN:eventIDList])
        {
            existingEvent.SXWP_Country_Code__c = existingEvent.SXWP_Assigned_To_Country_Code__c;
            eventsToUpdate.add(existingEvent);
        }
    
        update eventsToUpdate;
    }
    
    
}

and Here is the test class 
@isTest 
public class SVMX_PopulateActivityCCTest 
{
    private static Id techRecordTypeId = Schema.SObjectType.SVMXC__Service_Group_Members__c.getRecordTypeInfosByName().get('Technician').getRecordTypeId();
    private static Id teamRecordTypeId = Schema.SObjectType.SVMXC__Service_Group__c.getRecordTypeInfosByName().get('Technician').getRecordTypeId();
    private static Id eventRecordTypeId = Schema.SObjectType.Event.getRecordTypeInfosByName().get('PS WP CS').getRecordTypeId();
	private static Event currentEvent = new Event();
    private static User u = new User();
    private static SVMXC__Service_Group__c team = new SVMXC__Service_Group__c();
    private static SVMXC__Service_Group_Members__c technician = new SVMXC__Service_Group_Members__c();



    
    private static void setUpData()
    {
        team.RecordTypeId = teamRecordTypeId;
        team.Name = 'Carnival';
        insert team;
        
        u= TestUtil.createUser('00e120000019I9K');
        u.GID__c = 'Z002SH0P';
        insert u;
        
       	technician.RecordTypeId = techRecordTypeId;
        technician.SVMXC__Service_Group__c = team.Id;
        technician.Name = 'Victor Hugo';
        technician.SVMXC__Enable_Scheduling__c = True;
        technician.SVMXC__Active__c = True; 
        //The meat of the trigger lies in the following line
        technician.SXWP_Country_Code__c = 'CA';
        technician.SXWP_GID__c ='Z002SH0P';
        insert technician;
        
       id userId = [Select id from User where GID__c ='Z002SH0P'].get(0).Id;
      String techCC = [SELECT SXWP_Country_Code__c from SVMXC__Service_Group_Members__c WHERE SXWP_GID__c ='Z002SH0P' limit 1][0].SXWP_Country_Code__c;
       currentEvent.SXWP_Country_Code__c= NULL;
       currentEvent.Record_Id__c = eventRecordTypeId;
       currentEvent.OwnerId = userId;
       currentEvent.Subject = 'Event Test';
       currentEvent.Location = 'Location';
       currentEvent.Description='description';
       currentEvent.IsAllDayEvent=false;
       currentEvent.Start_Date__c= date.newInstance(1990, 11, 21);
        currentEvent.EndDateTime = date.newInstance(1990, 11, 22);
       insert currentEvent;
        

    }
    
    
     Static testmethod void updateEvent()
     {
         Test.startTest();
         setUpData();
         
         List<SVMXC__Service_Group_Members__c > sgm = [Select SXWP_Country_Code__c from SVMXC__Service_Group_Members__c Where Id = :technician.Id LIMIT 1];
         system.assertEquals(1,[Select Count() from SVMXC__Service_Group_Members__c  Where Id = :technician.Id]);
         
         List<Event> e = [Select SXWP_Assigned_To_Country_Code__c,SXWP_Country_Code__c from Event Where Id = :currentEvent.Id LIMIT 1];
         system.assertEquals(1,[Select Count() from Event Where Id = :currentEvent.Id]);
         
         system.assertNotEquals(NULL,e[0].SXWP_Country_Code__c);
         system.assertEquals(e[0].SXWP_Assigned_To_Country_Code__c,e[0].SXWP_Country_Code__c);
         Test.stopTest();
     }

    
}

 
Hello,
I am working on a visualforce page that asks the viewer to enter an email adress they are searching for within the salesforce system. Upon clicking a button, I would like the viewer to see a list of user emails that direcly match/simliar to the one entered on the previous page. How do I launch a new visualforce page upon the click of a button? And how do I create the second page as described prior?

Here is what I have so far.
<apex:page standardController="User">
    
    <apex:form > 
        <apex:pageBlock title="User email search">
        
        Please enter the email address of the user you are looking for: <p/>
        
        <apex:inputField value="{!user.email}"/> <p/>
        <apex:commandButton action="{!save}" value="Submit"/>
        
        </apex:pageBlock>
    </apex:form>
</apex:page>

 
The field 'Prequalified_Amount__c' either does not exists on the Contact object or it is not of type currency. 

i am getting this when i added Prequalified Amount as field under the object "Contact". Looked straightforward. Not sure what went wrong. I selected data type as currency and updated Prequalified Amount and field lable and PrequalifiedAmount as field name... got stuck in the first challange question of trailhead playground. Can anyone help..
Hi,

whenever case is opened for account for particular region ( say WEST-WE), only inside rep ( it’s a rep) should get email alert for the concerned case of his account (not for the account for which he is not rep.)

How to do it?

Hello.

Is it possible to convert a drop down field on the contact page to a text field? 

Hello, 
I am attempting to create a trigger that populates an empty Country Code field (on an Event) given that the Assigned to Country Code (the event is assigned to someone) field is populated. I receive the following error after running a test on my Trigger. 

System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, SVMXC.Event_Trigger1: execution of BeforeInsert

caused by: System.NullPointerException: Attempt to de-reference a null object

Trigger.SVMXC.Event_Trigger1: line 104, column 1: []


Here is my trigger
public class SVMX_PopulateActivityCountryCode extends TriggerAction
{
    public Id eventRecordTypeId = Schema.SObjectType.Event.getRecordTypeInfosByName().get('PS WP CS').getRecordTypeId();
    List<ID> eventIDList = new List<ID>();
    public Event[] eventsToUpdate = new Event[]{};

    
    public SVMX_PopulateActivityCountryCode() 
    {
        //Call super to set batch variables and context 
        super();
    }
    
    public override Boolean shouldRun(){
        if(this.isInsert()&&!this.hasRun())
        {
            for(Event e: (List<Event>)Trigger.new)
            { 
                if(e.RecordTypeId == eventRecordTypeId && e.SXWP_Country_Code__c==null&& e.OwnerId!=null&&e.SXWP_Assigned_To_Country_Code__c!=null) 
                {
                    eventIDList.add(e.Id);
                }
            }
        }
        return !eventIDList.isEmpty();
    }
    
    
    public override void doAction()
    {
        this.markRun();
        
        for(Event existingEvent:[SELECT id FROM event WHERE id IN:eventIDList])
        {
            existingEvent.SXWP_Country_Code__c = existingEvent.SXWP_Assigned_To_Country_Code__c;
            eventsToUpdate.add(existingEvent);
        }
    
        update eventsToUpdate;
    }
    
    
}

and Here is the test class 
@isTest 
public class SVMX_PopulateActivityCCTest 
{
    private static Id techRecordTypeId = Schema.SObjectType.SVMXC__Service_Group_Members__c.getRecordTypeInfosByName().get('Technician').getRecordTypeId();
    private static Id teamRecordTypeId = Schema.SObjectType.SVMXC__Service_Group__c.getRecordTypeInfosByName().get('Technician').getRecordTypeId();
    private static Id eventRecordTypeId = Schema.SObjectType.Event.getRecordTypeInfosByName().get('PS WP CS').getRecordTypeId();
	private static Event currentEvent = new Event();
    private static User u = new User();
    private static SVMXC__Service_Group__c team = new SVMXC__Service_Group__c();
    private static SVMXC__Service_Group_Members__c technician = new SVMXC__Service_Group_Members__c();



    
    private static void setUpData()
    {
        team.RecordTypeId = teamRecordTypeId;
        team.Name = 'Carnival';
        insert team;
        
        u= TestUtil.createUser('00e120000019I9K');
        u.GID__c = 'Z002SH0P';
        insert u;
        
       	technician.RecordTypeId = techRecordTypeId;
        technician.SVMXC__Service_Group__c = team.Id;
        technician.Name = 'Victor Hugo';
        technician.SVMXC__Enable_Scheduling__c = True;
        technician.SVMXC__Active__c = True; 
        //The meat of the trigger lies in the following line
        technician.SXWP_Country_Code__c = 'CA';
        technician.SXWP_GID__c ='Z002SH0P';
        insert technician;
        
       id userId = [Select id from User where GID__c ='Z002SH0P'].get(0).Id;
      String techCC = [SELECT SXWP_Country_Code__c from SVMXC__Service_Group_Members__c WHERE SXWP_GID__c ='Z002SH0P' limit 1][0].SXWP_Country_Code__c;
       currentEvent.SXWP_Country_Code__c= NULL;
       currentEvent.Record_Id__c = eventRecordTypeId;
       currentEvent.OwnerId = userId;
       currentEvent.Subject = 'Event Test';
       currentEvent.Location = 'Location';
       currentEvent.Description='description';
       currentEvent.IsAllDayEvent=false;
       currentEvent.Start_Date__c= date.newInstance(1990, 11, 21);
        currentEvent.EndDateTime = date.newInstance(1990, 11, 22);
       insert currentEvent;
        

    }
    
    
     Static testmethod void updateEvent()
     {
         Test.startTest();
         setUpData();
         
         List<SVMXC__Service_Group_Members__c > sgm = [Select SXWP_Country_Code__c from SVMXC__Service_Group_Members__c Where Id = :technician.Id LIMIT 1];
         system.assertEquals(1,[Select Count() from SVMXC__Service_Group_Members__c  Where Id = :technician.Id]);
         
         List<Event> e = [Select SXWP_Assigned_To_Country_Code__c,SXWP_Country_Code__c from Event Where Id = :currentEvent.Id LIMIT 1];
         system.assertEquals(1,[Select Count() from Event Where Id = :currentEvent.Id]);
         
         system.assertNotEquals(NULL,e[0].SXWP_Country_Code__c);
         system.assertEquals(e[0].SXWP_Assigned_To_Country_Code__c,e[0].SXWP_Country_Code__c);
         Test.stopTest();
     }

    
}

 
1.what is assert..? what the use..?
2.what is opportunity team...?
3..what force .com sites ..?
4.what is terrority mangement..?what the use..?
5.what is custom component..?
I'm new to Chatter & have searched but cannot identify the correct one! Can anyone provide the link to the correct page please?

I do not have any users, other then the 3 that come with it plus myself.  I don't have Allison Wheeler or any other that are used in the demos. Does anyone know why the users would be in there?

 

Hi, 
I have a problem with module "Manipulating Records with DML"
The 'insertNewAccount' method must accept an incoming string as a parameter, name the account after the parameter, insert it into the system and then return the account record.
My code is: 

public class AccountHandler {

    public static ID insertNewAccount(String nombre){
        ID prueba =null;
         Account cuent= new Account();
                try {
                  cuent = new Account(Name=nombre);
                  insert cuent;
                       prueba = cuent.Id;
               
            } catch (DmlException e) {
                  System.debug('A DML exception has occurred: ' +
                        e.getMessage());
              }
        System.debug('**********' +prueba);
        System.debug('**********' +cuent.Name);
        return prueba;
    }
}
I would like you ayudaseis I find the error.
Thank you
trigger AddRelatedCustomer on Account (after insert) {
I am new to salesforce and I am gett the no viable alternative at character '"' from this trigger.  Can you tell me what I am doing wrong

List<Contact> cont = new List<Contact>();
    for(Account acct: Trigger.new)
    {
           cont.add(New Contact(LastName = "Stitt",FirstName = "Sonny", AccountID = acct.ID));
        insert cont;
        
    }
}
HI am a newbee to SF. Kindly suggest what's wrong with the below test class. 

@IsTest
public class testclassownerassignmanager{
 static testmethod void metest(){
    Profile pro = [SELECT Id FROM Profile WHERE Name='Standard User']; 
User testUserA = new User(
    Alias = 'standard', Email='standarduser@testorg.com',  
    EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
    LocaleSidKey='en_US', ProfileId = pro.Id, 
    TimeZoneSidKey='America/Los_Angeles', 

UserName='testUserA@testorganise.com'); 
  insert testUserA ;

User testUserB = new User(
    Alias = 'standard', Email='standarduser@testorg.com',  
    EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
    LocaleSidKey='en_US', ProfileId = pro.Id,  
    TimeZoneSidKey='America/Los_Angeles', 
     UserName='testUserB@testorganise.com'); 
     testUserB.ManagerID = testUserA.id;
     
     insert testUserB;


  
  List<Account> acclist= new List<Account>();
  for(Integer i=0;i<=10;i++){
  account a = new account(Name='Test' + i, ownerid=testUserB.id);
    acclist.add(a);
  
  List<Account> TobUpdateAcclist= new List<Account>();
  for(Account ac: acclist){
     if (ac.owner.isactive == false )
      {
       ac.ownerid=testUserB.managerid;
       TobUpdateAcclist.add(a);
      }
      }
  
  test.starttest();
  if (Test.isRunningTest()) {
      System.runAs(new User(Id = Userinfo.getUserId())) {
       update TobUpdateAcclist;
      }
    } else {
       update TobUpdateAcclist;
    }
  test.stoptest();
  
  List<Account> updatedaccs = [select id,name from Account where ID IN: TobUpdateAcclist];
   system.assertEquals(a.owner.Managerid, a.ownerid);
  
  
 }}}
Hi All

Steps for project deployment?

can anyone explain.....