• Mike 317
  • NEWBIE
  • 40 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 1
    Likes Given
  • 6
    Questions
  • 9
    Replies
Hey, 

I'm trying to create a narrow chart that will show the color status of an account. Data is populated in a related object weekly. Currently, I'm not getting an error, but nothing is rendering. Debug logs show my query is returning the records. I've never used charts before, so it's probably something silly i've missed. Any thoughts?

Page
<apex:page standardcontroller="Account" extensions="ClientHealthExtension">
    <apex:chart height="125" width="100%" data="{!trendData}">
        <apex:axis type="Numeric" position="bottom" fields="week"/>
        <apex:axis type="Category" position="left" fields="xName"/>
        <apex:barSeries orientation="vertical" axis="bottom" xField="week" yField="xName"/>
    </apex:chart>
</apex:page>

Controller ext.
public class ClientHealthExtension {

    private final Account acct;
    public Account acctName;
    public ID acctId;
    public List<Account> nameList;
    
    public ClientHealthExtension (ApexPages.StandardController stdController){
        this.acct = (Account) stdController.getRecord();
        acctId = acct.Id;
        nameList = [SELECT Name FROM Account WHERE Id=:acctId limit 1];
        if(!nameList.isEmpty()){
            acctName = nameList[0];
        }
    }
    
    public List<Account_Trend__c> gettrendData(){
        List<Account_Trend__c> trends = [SELECT Account_Name__c, Client_Health_Status_Indicator__c, CreatedDate FROM Account_Trend__c WHERE Account_Name__c =:acctName.Name ORDER BY CreatedDate];
        system.debug('trends: '+trends);
        return trends;
    }
    // Wrapper class
    public class trendData {

        public String xName { get; set; }
        public String health { get; set; }
        public date week { get; set; }
        public ID xId { get; set; }
        public String xIso { get; set; }

        public trendData(String xName, String health, date week, ID xId, String xIso) {
            this.xName = xName;
            this.health = health;
            this.week = week;
        }
    }    
}

 
Hey All, 
I am working with a 3rd party and they have a VFP with a list that has sortable columns. The test class has test methods without system asserts. On the one hard, this makes sense because what would you actually assert? But on the other hand, this simply calls the method. It doesn't actually validate anything. Code snipet is below. 
 
@isTest
	static void test_SortByAccount() {
		RecordReturnsCtrl ctrl = new RecordReturnsCtrl();
		ctrl.columnName = 'Account';
		ctrl.ascendingSort = false;
		ctrl.sortRecords();
}

Is this ok? My gut wants a system assert that checks the results against what is expected. But i'm not sure if i'm just asking for too much. Thanks. 

-Mike
Hey, 

I need to find a way to pull a few values from case.description. I'm very new to code, and i have no idea where to start. Here's what i need:
if case.description is:
"VAR1: Juice
 VAR1: Lime
 VAR3: Ginger"
How can i put the values for Vars 1-3 into their respective case fields?

Any help is greatly appreciated. Thanks!
Hey All, 

I need a way to allow a user to reassign a case when they are creating it.

I created a picklist with user aliases. I'd like to be able to choose a value on that picklist and have APEX change the owner after the record is created. Can that be done? I know I can't do it with a workflow, so I'm stuck. Any help would be appreciated. Thanks!

-Mike
Hey, 

I'm working on the "Integrating External Data" Trailhead and I'm running into this issue. I'm stumped because as far as I can tell, I have everything in correctly. Any ideas?

screen shot

Thanks. 

-Mike
Hi, 

I'm trying to do the Writing SOQL Queries Challenge on Trailhead but i'm getting the following error:

There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 30115000000LJiz. Contact your administrator for help.: []

I've looked and some people say there might be an issue with a validation rule or trigger that is preventing the validation. I've checked and i don't have any active validation rules or triggers on the case object. From what I can tell, my code is fine:

public class ContactSearch {
        public static List<Contact> searchForContacts(String lastName, String mailingPostalCode) {
            return [SELECT Id, Name, LastName, MailingPostalCode
                                     FROM Contact
                                     WHERE LastName = :lastName AND MailingPostalCode = :mailingPostalCode];
        }   
    }

Any thoughts on why it's not validating? Thanks!

-Mike
Hey, 

I'm working on the "Integrating External Data" Trailhead and I'm running into this issue. I'm stumped because as far as I can tell, I have everything in correctly. Any ideas?

screen shot

Thanks. 

-Mike
Hi, 

I'm trying to do the Writing SOQL Queries Challenge on Trailhead but i'm getting the following error:

There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 30115000000LJiz. Contact your administrator for help.: []

I've looked and some people say there might be an issue with a validation rule or trigger that is preventing the validation. I've checked and i don't have any active validation rules or triggers on the case object. From what I can tell, my code is fine:

public class ContactSearch {
        public static List<Contact> searchForContacts(String lastName, String mailingPostalCode) {
            return [SELECT Id, Name, LastName, MailingPostalCode
                                     FROM Contact
                                     WHERE LastName = :lastName AND MailingPostalCode = :mailingPostalCode];
        }   
    }

Any thoughts on why it's not validating? Thanks!

-Mike
Hey, 

I'm trying to create a narrow chart that will show the color status of an account. Data is populated in a related object weekly. Currently, I'm not getting an error, but nothing is rendering. Debug logs show my query is returning the records. I've never used charts before, so it's probably something silly i've missed. Any thoughts?

Page
<apex:page standardcontroller="Account" extensions="ClientHealthExtension">
    <apex:chart height="125" width="100%" data="{!trendData}">
        <apex:axis type="Numeric" position="bottom" fields="week"/>
        <apex:axis type="Category" position="left" fields="xName"/>
        <apex:barSeries orientation="vertical" axis="bottom" xField="week" yField="xName"/>
    </apex:chart>
</apex:page>

Controller ext.
public class ClientHealthExtension {

    private final Account acct;
    public Account acctName;
    public ID acctId;
    public List<Account> nameList;
    
    public ClientHealthExtension (ApexPages.StandardController stdController){
        this.acct = (Account) stdController.getRecord();
        acctId = acct.Id;
        nameList = [SELECT Name FROM Account WHERE Id=:acctId limit 1];
        if(!nameList.isEmpty()){
            acctName = nameList[0];
        }
    }
    
    public List<Account_Trend__c> gettrendData(){
        List<Account_Trend__c> trends = [SELECT Account_Name__c, Client_Health_Status_Indicator__c, CreatedDate FROM Account_Trend__c WHERE Account_Name__c =:acctName.Name ORDER BY CreatedDate];
        system.debug('trends: '+trends);
        return trends;
    }
    // Wrapper class
    public class trendData {

        public String xName { get; set; }
        public String health { get; set; }
        public date week { get; set; }
        public ID xId { get; set; }
        public String xIso { get; set; }

        public trendData(String xName, String health, date week, ID xId, String xIso) {
            this.xName = xName;
            this.health = health;
            this.week = week;
        }
    }    
}

 
Hey All, 

I need a way to allow a user to reassign a case when they are creating it.

I created a picklist with user aliases. I'd like to be able to choose a value on that picklist and have APEX change the owner after the record is created. Can that be done? I know I can't do it with a workflow, so I'm stuck. Any help would be appreciated. Thanks!

-Mike
Hey, 

I'm working on the "Integrating External Data" Trailhead and I'm running into this issue. I'm stumped because as far as I can tell, I have everything in correctly. Any ideas?

screen shot

Thanks. 

-Mike
Hi, 

I'm trying to do the Writing SOQL Queries Challenge on Trailhead but i'm getting the following error:

There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 30115000000LJiz. Contact your administrator for help.: []

I've looked and some people say there might be an issue with a validation rule or trigger that is preventing the validation. I've checked and i don't have any active validation rules or triggers on the case object. From what I can tell, my code is fine:

public class ContactSearch {
        public static List<Contact> searchForContacts(String lastName, String mailingPostalCode) {
            return [SELECT Id, Name, LastName, MailingPostalCode
                                     FROM Contact
                                     WHERE LastName = :lastName AND MailingPostalCode = :mailingPostalCode];
        }   
    }

Any thoughts on why it's not validating? Thanks!

-Mike
Question :

Create an Apex class that returns contacts based on incoming parameters

My answer: 

public class ContactSearch {
    public static  List<Contact> searchForContacts(String lastName,String postalCode){
     
       List<Contact> contacts = new List<Contact>();
        
       contacts = [Select Id, Name from Contact
                        where LastName = :lastName 
                        and    MailingPostalCode  like :('%'+postalCode+'%') ];

         return contacts;  
        
        }
}

I tested the answer from dev console. it works fine..

But I get this error from Trialhead , why? and it is saying about deletion why?

Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Delete failed. First exception on row 0 with id 0031a00000EiCzvAAF; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Not authorized !!! : []
Our client, a small to mid sized consulting company, is looking for a Solution Architect who is passionate and enjoys working closely with stake holders, program and product managers and analysts.  A hands-on expert who can ensure effective solution design that meets business requirements in many different industries.  This position is in Metro DC or can be REMOTE! If interested email:  nancy@tech2resources.com. 

More info - http://jobs.tech2resources.com/index.smpl?arg=jb_details&POST_ID=3230578 (http://jobs.tech2resources.com/index.smpl?arg=jb_details&POST_ID=3230578)