• harsh rohilla
  • NEWBIE
  • 0 Points
  • Member since 2018
  • Salesforce Technical Consultant

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 1
    Likes Given
  • 1
    Questions
  • 2
    Replies
I've Lightning Dialer working fine for standard objects but i want it to work on custom components which have contact number field in it. The custom component's phone field doesn't show the telephone icon as shown in custom objects.  
I've Lightning Dialer working fine for standard objects but i want it to work on custom components which have contact number field in it. The custom component's phone field doesn't show the telephone icon as shown in custom objects.  
I'm late to the game when it comes to securing sties/communities and I'm trying to make the appropriate changes before Salesforce enforces the guest rules.

I'm updating my test methods to simulate having our Site run as the Guest User for the Site ("Portal Site Guest User"), but I set up things like Account creation etc prior to running the tests under the "Portal Site Guest User", but for some reason if I try retrieving records created prior to the System.RunAs... it cannot pull up any records created earlier.

I use the @isTest(SeeAllData=true) so that I can retrieve the Portal Guest User.

Sample code:
 
@IsTest(SeeAllData=true)
static testMethod void PortalTest()
{
    Account a = new Account( Name = 'test', BillingCountry = 'United States', Type = 'Prospect', CurrencyISOCode = 'USD' );

    insert a;

    User PortalGuest = [SELECT Id FROM User WHERE Name = 'Portal Site Guest User'][0];

    System.RunAs( PortalGuest )
    {
        List< Account> accList = [SELECT Id FROM Account WHERE Id = :a.Id];
        System.assert( accList.size() == 1, 'Unable to retrieve created record; accList.size() = ' + accList.size() );
    }
}

 

The System.Assert flags and indicates that the accList.size() = 0.

I have set up Account Sharing Rules for "Portal Site Guest User" to include Account Type = 'Prospect'.

Not sure if I'm missing anything else to be able to access the record from the Guest User. Help?

  • March 05, 2020
  • Like
  • 0

Hi, I'm new to the Migration Tool and am finding it difficult to get working.  I have been through the guides and can't find any help on the problem I'm having.

 

This is the error I am receiving:

 

 Macintosh-3:DevGuide collinbrown$ ant
Buildfile: build.xml

InitUsers:

BUILD FAILED
/Users/collinbrown/Documents/BACR/Salesforce/DevGuide/build.xml:170: Problem: failed to create task or type antlib:com.salesforce:deploy
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

This appears to be an antlib declaration.
Action: Check that the implementing library exists in one of:
        -/usr/share/ant/lib
        -/Users/collinbrown/.ant/lib
        -a directory added on the command line with the -lib argument


Total time: 0 seconds
 

Any help will be greatly appreciated!

Collin

 

Hello.  I'm new to salesforce.  How do I create a trigger that will update the lead status to working when an activity is created (event, task, call)?  I saw this code while doing research, and it works for logging a call, but does not update the status if I schedule an event.  Any help will be appreciated.

trigger changeLeadStatus on Task (before insert, before update) {
    String desiredNewLeadStatus = 'Working';

    List<Id> leadIds=new List<Id>();
    for(Task t:trigger.new){
        if(t.Status=='Completed'){
            if(String.valueOf(t.whoId).startsWith('00Q')==TRUE){//check if the task is associated with a lead
                leadIds.add(t.whoId);
            }//if 2
        }//if 1
    }//for
    List<Lead> leadsToUpdate=[SELECT Id, Status FROM Lead WHERE Id IN :leadIds AND IsConverted=FALSE];
    For (Lead l:leadsToUpdate){
        l.Status=desiredNewLeadStatus;
    }//for
    
    try{
        update leadsToUpdate;
    }catch(DMLException e){
        system.debug('Leads were not all properly updated.  Error: '+e);
    }
}//trigger