• HANK LI (Freelance)
  • 0 Points
  • Member since 2018
  • hankli.me

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 3
I need to access ALL data sets in a list custom setting rather than name a specific data set:
CustomSettingName__c mc = CustomSettingName__c.getValues(data_set_name);

Tried the below but then the query will return an error:
list <CustomSetting__c> mc = CustomSetting__c.getAll().values();

Database.getQueryLocator([select Id FROM Case WHERE Country__c LIKE :mc.Country_Code__c]);
ERROR: Variable does not exist: Country_Code__c

Can someone help me out please?
  • April 26, 2018
  • Like
  • 0
I'm not a developer, so I'm not even going to pretend to know how to modify this page.  A dev created this page for me, but I would like to change it so that it updates a field on a custom Object.  The field is in an Object called "Sample Submission Form" and the api field name is "status__C".  Can someone write the code that would update this field to "Submitted"?  I'm showing the beginning of the VF page.
Thanks a million!
<apex:page showHeader="false" sidebar="false" standardController="Sample_Submission_Form__c" renderAs="pdf"   extensions="SampleSubmissionPDFController">

    <div style="font-family: Arial, Helvetica, sans-serif">
        <apex:pageBlock rendered="{!Sample_Submission_Form__c.No_Docs__c}">
           <p> You are missing required fields.
               You must edit your Sample Submisson Form.
        <apex:pageBlock rendered="{!Sample_Submission_Form__c.Generate_Doc__c}">
            <!-- HEADER -->
            <table style="border-collapse: collapse; width: 100%;" >
                <tr style="width: 100%;">
                    <td style="border:1px solid black; width: 33%;">

Hi Guys,
I have the following code and want a test method to cover the for loop.Please give the test method so as to cover the for loop

Public class CreateDummyAccount{

Public static void dummyMethod(List<Account> accList){
    if(accList != NULL && !accList.isEmpty()){
        List<Contact> conList = new List<Contact>();
        for(Account acc : accList){
        conList.add(new  Contact(LastName = 'Larry'))
        insert conList;