• Susan Ross-Wentworth
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 4
    Replies
Hi,

I have  a VF page which displays a list of account team members.  The page uses a controller extension which get the actual list.  I have a test class in which I create an account and the team members. I don't know how to actually test that the team member list is correctly displayed.  

Thank you in advance!!

Here is my VF page:

<apex:page standardController="Account" extensions="AcctTeamMemberController">
    
    <apex:form >

       <apex:pageBlock title="Account Team">
            
            <apex:pageBlockTable value="{!atmList}" var="atm">
                
                <apex:column width="130" value="{!atm.User.Name}"/>
                <apex:column value="{!atm.TeamMemberRole}"/>
            
            </apex:pageBlockTable>
        
        </apex:pageBlock>
    
    </apex:form>

</apex:page>


Here is my controller extension:

public class AcctTeamMemberController {
    public List<AccountTeamMember> atmList {get; set;}
    public AcctTeamMemberController(ApexPages.StandardController controller) {
        Account acc = (Account) controller.getRecord();
        
        atmList = [SELECT Id, AccountId, TeamMemberRole,UserId, 
                   User.Name FROM AccountTeamMember where AccountId =: acc.Id];
    }

}

Here is my test class so far:

@isTest
public class TestAcctTeamMemberController {
    private static testmethod void TestATMController(){
        
        //create an account
        Account Acc = new Account(Name='New Account', Type='Client', OwnerId='005d0000001l4LXAAY');
        insert Acc;
        
        //create account team members 
        AccountTeamMember atm1 = new AccountTeamMember(AccountId=Acc.Id,TeamMemberRole='Imaging System Manager',UserId='005d000000277hpAAA');
        insert atm1;
        
        AccountTeamMember atm2 = new AccountTeamMember(AccountId=Acc.Id,TeamMemberRole='Client Service Manager',UserId='005d000000277hgAAA');
        insert atm2;
        
        AccountTeamMember atm3 = new AccountTeamMember(AccountId=Acc.Id,TeamMemberRole='Receptionist',UserId='005d000000277hhAAA');
        insert atm3;
        
        AccountTeamMember atm4 = new AccountTeamMember(AccountId=Acc.Id,TeamMemberRole='Relationship Manager',UserId='005d000000277haAAA');
        insert atm4;

        
        Test.startTest();
        
        //Inform Test Class to set current page as Page where Extension is used
        Test.setCurrentPage(Page.DisplayAccountTeam);
        
        //Instantiate object of "ApexPages.StandardController" by passing object
        ApexPages.StandardController stdController = new ApexPages.StandardController(Acc);
        ApexPages.currentPage().getParameters().put('id', Acc.Id);
        
        //Create Object of Controller extension by passing object of standardController
        AcctTeamMemberController ext = new AcctTeamMemberController(stdController);
      
//I don't know what to put here to call up the list

        Test.stopTest();

    }
}

 
I have been using event log file browser to download logs.  Suddenly today I am unable to open the application.  When I use my Salesforce credentials, I get an error "Something went wrong" but no other information.  The only thing that has changed since I last used event file browser is that my Salesforce self-signed certificate was due to expire, so I created a new one and made the new one the default for the API client certificate and the default for identity provider certificate.  Could this be preventing me from getting into event log file browser?
Hi,

As part of a trailhead challenge, I created and subscribed to a SF report. I now get an email notification every day for this report:

Alert: The conditions you specified when subscribing to 'Leads by Lead Source' have been met. https://na55.salesforce.com/00Of1000000lBpv"

The trailhead challenge is completed, so I don't need to get this notification and want to unsubscribe from the report, but when I log into my trailhead org and enter the SF id referenced in the email, I get the result "Data not Available". I can't find the report by going to the reports tab, either. How do I unsubscribe from this report and stop getting unnecessary email notifications?

Thanks!
Hi,

I have a question for Scott M - SFDC Fan, who posted that great solution about using the offest container and apex (http://salesforce-tips.blogspot.de/2016/01/salesforce-visual-workflow-with.html).  I tried his solution and it worked great in most cases but not all.

It works great for any time values from 10:00 am onward, but will not work for times prior to 10 am.  For example, an input value of 8:30 am results in a calculated date time value which has a three-day offset from my entered date value and a three-hour offset from my entered time (it becomes 11:30 am).  A 9:00 am input value sometimes comes back as 9:00 pm.

I’ve tried various way to get around this but nothing has worked:

The blog mentions using text values of 01:00, 01:15, etc. for the time input values.  I used that format, starting with 08:30, 09:00, 09:30, etc.  When I tried to save the flow, I got an error saying the “SelectionAsNumber” formulas were invalid because of an “incorrect parameter for function “TEXT()”.  Expected Number, Date, DateTime, Picklist, received Text.”

So I changed my time input values to be numbers, starting with 0830, 0900, 0930, 1000, etc.  I used the same “SelectionAsNumber” formulas as before.  Everything then worked beautifully for all time values of 10 am (1000) onward, but not for the times between 8:30 am and 9:30 am (the offset is calculated incorrectly and is off by several days and several hours).

I tried going back to using text for my time input values and took the TEXT() reference out of the “SelectionAsNumber” formulas, leaving everything else the same.  That produces no converted DateTime value at all.

Since everything after 10 am is working, I wish I could just drop the earlier time values, but I have to be able to include them in my input values.

Thanks!!

 
I’m taking the “Working with Custom Lightning Components” trailhead module, which requires that I enable My Domain.  I’m nervous about doing this.  When I set up a custom domain in the developer edition I’m using for trailhead, am I also messing with my active production org?  We have not migrated to Lightning in production, have no Lightning components, and do not have My Domain set up in production.  If I create a new domain for testing purposes in developer, would my production users then have to use that URL to log into Salesforce?
I have created a visual flow which uses a loop to count the number of address objects which are related to a specified contact so that an automatic task will be generated if a contact is found to have more than one address.  My fast lookup returns the correct addresses, and I have an assignment element which, on each iteration of the loop, should add 1 to a number variable within my flow (the variable having stared with a default value of 0).  My fast lookup returns two records, so my loop should increase the value of my number variable by 2, but it doesn’t.  My variable only increases by 1, as if my loop is only counting the first record in the collection instead of every record in the collection.

flow steps

loop element

assignment element

loop results
Hi,
 
I’m trying to create report which will show a user whether they have double-booked any of their scheduled events.  I created a report for each user and the events assigned to them, thinking I could then summarize the report by grouping together all events which have the same date and time.  When I drag the “Time” field into my report as a column, it displays the date and time but when I use the Time field to create a grouping, the time portion gets dropped and only the date is applied, which means anything on the same day regardless of time get grouped together.  I’ve tried grouping on the “Due Time” field as well but the same thing happens.
 
I also tried creating a custom field on the activity which would convert the “activitydatetime” field to text and then use that in my report but the custom field I created using TEXT(ActivityDateTime) always returns the incorrect event time.
 
Hi,

I have  a VF page which displays a list of account team members.  The page uses a controller extension which get the actual list.  I have a test class in which I create an account and the team members. I don't know how to actually test that the team member list is correctly displayed.  

Thank you in advance!!

Here is my VF page:

<apex:page standardController="Account" extensions="AcctTeamMemberController">
    
    <apex:form >

       <apex:pageBlock title="Account Team">
            
            <apex:pageBlockTable value="{!atmList}" var="atm">
                
                <apex:column width="130" value="{!atm.User.Name}"/>
                <apex:column value="{!atm.TeamMemberRole}"/>
            
            </apex:pageBlockTable>
        
        </apex:pageBlock>
    
    </apex:form>

</apex:page>


Here is my controller extension:

public class AcctTeamMemberController {
    public List<AccountTeamMember> atmList {get; set;}
    public AcctTeamMemberController(ApexPages.StandardController controller) {
        Account acc = (Account) controller.getRecord();
        
        atmList = [SELECT Id, AccountId, TeamMemberRole,UserId, 
                   User.Name FROM AccountTeamMember where AccountId =: acc.Id];
    }

}

Here is my test class so far:

@isTest
public class TestAcctTeamMemberController {
    private static testmethod void TestATMController(){
        
        //create an account
        Account Acc = new Account(Name='New Account', Type='Client', OwnerId='005d0000001l4LXAAY');
        insert Acc;
        
        //create account team members 
        AccountTeamMember atm1 = new AccountTeamMember(AccountId=Acc.Id,TeamMemberRole='Imaging System Manager',UserId='005d000000277hpAAA');
        insert atm1;
        
        AccountTeamMember atm2 = new AccountTeamMember(AccountId=Acc.Id,TeamMemberRole='Client Service Manager',UserId='005d000000277hgAAA');
        insert atm2;
        
        AccountTeamMember atm3 = new AccountTeamMember(AccountId=Acc.Id,TeamMemberRole='Receptionist',UserId='005d000000277hhAAA');
        insert atm3;
        
        AccountTeamMember atm4 = new AccountTeamMember(AccountId=Acc.Id,TeamMemberRole='Relationship Manager',UserId='005d000000277haAAA');
        insert atm4;

        
        Test.startTest();
        
        //Inform Test Class to set current page as Page where Extension is used
        Test.setCurrentPage(Page.DisplayAccountTeam);
        
        //Instantiate object of "ApexPages.StandardController" by passing object
        ApexPages.StandardController stdController = new ApexPages.StandardController(Acc);
        ApexPages.currentPage().getParameters().put('id', Acc.Id);
        
        //Create Object of Controller extension by passing object of standardController
        AcctTeamMemberController ext = new AcctTeamMemberController(stdController);
      
//I don't know what to put here to call up the list

        Test.stopTest();

    }
}

 
I’m taking the “Working with Custom Lightning Components” trailhead module, which requires that I enable My Domain.  I’m nervous about doing this.  When I set up a custom domain in the developer edition I’m using for trailhead, am I also messing with my active production org?  We have not migrated to Lightning in production, have no Lightning components, and do not have My Domain set up in production.  If I create a new domain for testing purposes in developer, would my production users then have to use that URL to log into Salesforce?
I have created a visual flow which uses a loop to count the number of address objects which are related to a specified contact so that an automatic task will be generated if a contact is found to have more than one address.  My fast lookup returns the correct addresses, and I have an assignment element which, on each iteration of the loop, should add 1 to a number variable within my flow (the variable having stared with a default value of 0).  My fast lookup returns two records, so my loop should increase the value of my number variable by 2, but it doesn’t.  My variable only increases by 1, as if my loop is only counting the first record in the collection instead of every record in the collection.

flow steps

loop element

assignment element

loop results
I have a flow that collects the date from one field, the time from a dropdown, and then uses a formula to combine the two to use to create an Event Record.

User-added image

I've used various combinations trying to get the formula to create something that can be used to populate the StartDateTime and the ActivityDateTime fields, but can't find a way to get it to work.

I have my choice stored values for time set to return miltary hours:minutes:seconds, e.g. 13:00:00

My current formula is: Text({!Tour_Date}) + " " + {!Tour_Time}

As a text formula this shows on my display text screen (that I'm using to verify my field inputs prior to using Record Create) as 2014-11-24 1:00PM, which seems to be as close as I can get as an input for the Event DateTime format.

But as soon as I change the formula value data type to DateTime, or if I add DATETIMEVALUE() around the formula above, my test sceen in the flow shows nothing for the result.

What am I missing?