• Cynthia Rodgers 12
  • NEWBIE
  • 50 Points
  • Member since 2017
  • VP Salesforce Administration
  • Texas Capital Bank


  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 22
    Replies
I have created a custom checkbox field that is checking to see if two date fields are the same.  If they are the same then i want the checkbox to update to true.  This is not happening.  The formula(s) i am using are :

LLC_BI__Account__r.Exception_Pricing_Effective_Date__c = Created_Date_1__c

IF(LLC_BI__Account__r.Exception_Pricing_Effective_Date__c = Created_Date_1__c,TRUE,FALSE)

I created a new record to test the functionality and these two dates (exceptiong pricing effect date and the created date) are the same, however the checkbox is unchecked.  When i set the operator to not equal then the field updates to true.  
I have created an apex class and a test class but my code coverage is at 33% and I need it to be at 75% or higher. I am not sure how to increase the test class i created using test generator, can you tell me how to increase my code coverage?

My Apex class is evaluating the account fields TSS Designation = Temporary and TSS Temporary End Date.  When the designation is temporary and the end date is today, then this class will update those fields to null.  I have this class setup on the scheduler to run daily.

apex class: update tss fields
public class update_tss_fields implements Schedulable, Database.Batchable<sObject>
{
    public void execute( SchedulableContext context )
    {
        Database.executeBatch( this );
    }
    public Database.QueryLocator start( Database.BatchableContext context )
    {
        return Database.getQueryLocator
        (   'SELECT Id, TSS_Designation__c, TSS_Temporary_End_Date__c '
        +   'FROM Account '
        +   'WHERE TSS_Temporary_End_Date__c = TODAY'
        );
    }

    public void execute( Database.BatchableContext context, List<Account> accounts )
    {
        for ( Account account : accounts )
        {
            account.TSS_Designation__c = null;
            account.TSS_Temporary_End_Date__c = null;
        }
        update accounts;
    }
    public void finish( Database.BatchableContext context )
    {
        // nothing to do here...
    }
}



 
I have not written an apex class yet so I'm not sure i have the hang of this yet.  I am needing to update two custom account fields to null once a date field has been met.  Im going the route of apex class because i need to add it to the scheduler for the update versus using workflow or process builder.  

Scenario:  When the TSS Temporary End Date = TODAY(), i want to update the TSS Designation field (picklist) to Null and update the TSS Temporary End Date to Null.

public class update_tss_fields {
    public static String saveData(){
        for (Account a : [SELECT Id FROM Account WHERE TSS_Temporary_End_Date__c = TODAY()]){
               if (a.TSS_Temporary_End_Date__c = TODAY()){ 
                   a.TSS_Designation__C = null;
                   a.TSS_Temporary_End_Date__c = null;
                   update a;
               } 
               }    
        }
     }


I've tried 'UPDATE', 'IF' and when i try to save it get an error when using those expressions.  So im now getting this error: Error: Compile Error: Expecting ']' but was: '(' at line 3 column 89) 

Any help would be appreciated.

I did recieve the following updated code from another user in the community but it did not resolve my issue.  I get a new error:  Error: Compile Error: Method does not exist or incorrect signature: void TODAY() from the type update_tss_fields at line 4 column 85

public class update_tss_fields {
    public static String saveData(){
     List<Account> accountsToUpdate = new LIST<Account>();
        for (Account a : [SELECT Id FROM Account WHERE TSS_Temporary_End_Date__c =: TODAY()]){
               if (a.TSS_Temporary_End_Date__c = TODAY()){ 
                   a.TSS_Designation__C = null;
                   a.TSS_Temporary_End_Date__c = null;
                   accountsToUpdate.add(a); // make use of collections to store records
                 
               } 
               }    
update accountsToUpdate; // do the dml outside of for loop
        }
     }
I am currently working with a consulting company that eluded there is a way to assign permission sets by role versus by user.  I am unaware of any changes and wanted to reachout to our group to see if that has changed?  Please let me know if this is now possible and how to accomplish assiging permissions to roles.
I have created a vf page used when clicking the Post Idea button from Idea's.  I have assigned that page to all profiles and validated the field level security.  I am still unable to see the new page.  What am I missing?   
I have created a vf page and added it to a new section of the case page layout(standard), however I am not able to see the vfpage when I try to edit or create a new record.  On my vf page I am using field sets to display the custom fields.  I am looking to be able to see formula fields when creating a new record type as well as populate the manual entry fields.  

The screenshot is of what the vf page looks like on the case page.  
User-added image

When its in edit mode the entire vf page(section) is not visible.

User-added image
VFPage code:
<apex:page standardController="Case">
    <apex:form >
        <apex:pageBlock >
                    <apex:pageBlockSection title="Advance Disbursement/LIBOR Rollover Authorization" columns="2">
           <apex:repeat value="{!$ObjectType.Case.FieldSets.Advance_Request}" 
                    var="field">
              <apex:inputField value="{!Case[field]}" />
              </apex:repeat>
                       </apex:pageBlockSection>
     </apex:pageBlock>
     </apex:form>
       <apex:form >
        <apex:pageBlock >
                    <apex:pageBlockSection title="Borrowing Base Information (Optional)" columns="2">
           <apex:repeat value="{!$ObjectType.Case.FieldSets.Advance_Request}" 
                    var="field">
              <apex:inputField value="{!Case[field]}" />
              </apex:repeat>
                       </apex:pageBlockSection>
     </apex:pageBlock>
     </apex:form>
<apex:form >
        <apex:pageBlock >
                    <apex:pageBlockSection title="Disbursement Instructions" columns="2">
           <apex:repeat value="{!$ObjectType.Case.FieldSets.Advance_Request}" 
                    var="field">
              <apex:inputField value="{!Case[field]}" />
              </apex:repeat>
                       </apex:pageBlockSection>
     </apex:pageBlock>
     </apex:form>
     <apex:form >
        <apex:pageBlock >
                    <apex:pageBlockSection title="Option Priced Loan Advance and Rollover Information (If Applicable)" columns="2">
           <apex:repeat value="{!$ObjectType.Case.FieldSets.Advance_Request}" 
                    var="field">
              <apex:inputField value="{!Case[field]}" />
              </apex:repeat>
                       </apex:pageBlockSection>
     </apex:pageBlock>
     </apex:form>
     </apex:page>

 
I have a popup alert on my case page layout that appears at the top of the case page.  I wanted to find out if the popup alert message could be
  • moved to the middle of the page
  • how to add a image file (that is sized down) or a border to make it stand out.  
  • image that i have saved to Documents is Exclamation  [img src="https://texascapitalbank--WMPDev1--c.cs11.content.force.com/servlet/servlet.ImageServer?id=015Z0000002Ty1e&amp;oid=00DZ000000N88xi&amp;lastMod=1500469279000"]
User-added image



 
I need some assistance with a popup alert I created for one of my case record types.  I want the alert to fire when a custom field (Wire to) is populated only.  What is currently happening is the alert is popping at every edit of the record, even when this field is not populated.  

I need the alert to validate when the Wire to field is not null and then display the message.

VF Page
 
I am using a standard object and custom object thats related.  I am trying to solve for the following:  When LLC_BI_Status__c = Complete, update the Opportunity stage (stagename) to "Won".  Object Names; Product Package (API= Product_Package). Status (LLC_BI_Status__c)  and Opportunitites (Stagename)
 
I have created a vf page and added it to a new section of the case page layout(standard), however I am not able to see the vfpage when I try to edit or create a new record.  On my vf page I am using field sets to display the custom fields.  I am looking to be able to see formula fields when creating a new record type as well as populate the manual entry fields.  

The screenshot is of what the vf page looks like on the case page.  
User-added image

When its in edit mode the entire vf page(section) is not visible.

User-added image
VFPage code:
<apex:page standardController="Case">
    <apex:form >
        <apex:pageBlock >
                    <apex:pageBlockSection title="Advance Disbursement/LIBOR Rollover Authorization" columns="2">
           <apex:repeat value="{!$ObjectType.Case.FieldSets.Advance_Request}" 
                    var="field">
              <apex:inputField value="{!Case[field]}" />
              </apex:repeat>
                       </apex:pageBlockSection>
     </apex:pageBlock>
     </apex:form>
       <apex:form >
        <apex:pageBlock >
                    <apex:pageBlockSection title="Borrowing Base Information (Optional)" columns="2">
           <apex:repeat value="{!$ObjectType.Case.FieldSets.Advance_Request}" 
                    var="field">
              <apex:inputField value="{!Case[field]}" />
              </apex:repeat>
                       </apex:pageBlockSection>
     </apex:pageBlock>
     </apex:form>
<apex:form >
        <apex:pageBlock >
                    <apex:pageBlockSection title="Disbursement Instructions" columns="2">
           <apex:repeat value="{!$ObjectType.Case.FieldSets.Advance_Request}" 
                    var="field">
              <apex:inputField value="{!Case[field]}" />
              </apex:repeat>
                       </apex:pageBlockSection>
     </apex:pageBlock>
     </apex:form>
     <apex:form >
        <apex:pageBlock >
                    <apex:pageBlockSection title="Option Priced Loan Advance and Rollover Information (If Applicable)" columns="2">
           <apex:repeat value="{!$ObjectType.Case.FieldSets.Advance_Request}" 
                    var="field">
              <apex:inputField value="{!Case[field]}" />
              </apex:repeat>
                       </apex:pageBlockSection>
     </apex:pageBlock>
     </apex:form>
     </apex:page>

 
I have created a custom checkbox field that is checking to see if two date fields are the same.  If they are the same then i want the checkbox to update to true.  This is not happening.  The formula(s) i am using are :

LLC_BI__Account__r.Exception_Pricing_Effective_Date__c = Created_Date_1__c

IF(LLC_BI__Account__r.Exception_Pricing_Effective_Date__c = Created_Date_1__c,TRUE,FALSE)

I created a new record to test the functionality and these two dates (exceptiong pricing effect date and the created date) are the same, however the checkbox is unchecked.  When i set the operator to not equal then the field updates to true.  
I have created an apex class and a test class but my code coverage is at 33% and I need it to be at 75% or higher. I am not sure how to increase the test class i created using test generator, can you tell me how to increase my code coverage?

My Apex class is evaluating the account fields TSS Designation = Temporary and TSS Temporary End Date.  When the designation is temporary and the end date is today, then this class will update those fields to null.  I have this class setup on the scheduler to run daily.

apex class: update tss fields
public class update_tss_fields implements Schedulable, Database.Batchable<sObject>
{
    public void execute( SchedulableContext context )
    {
        Database.executeBatch( this );
    }
    public Database.QueryLocator start( Database.BatchableContext context )
    {
        return Database.getQueryLocator
        (   'SELECT Id, TSS_Designation__c, TSS_Temporary_End_Date__c '
        +   'FROM Account '
        +   'WHERE TSS_Temporary_End_Date__c = TODAY'
        );
    }

    public void execute( Database.BatchableContext context, List<Account> accounts )
    {
        for ( Account account : accounts )
        {
            account.TSS_Designation__c = null;
            account.TSS_Temporary_End_Date__c = null;
        }
        update accounts;
    }
    public void finish( Database.BatchableContext context )
    {
        // nothing to do here...
    }
}



 
I have not written an apex class yet so I'm not sure i have the hang of this yet.  I am needing to update two custom account fields to null once a date field has been met.  Im going the route of apex class because i need to add it to the scheduler for the update versus using workflow or process builder.  

Scenario:  When the TSS Temporary End Date = TODAY(), i want to update the TSS Designation field (picklist) to Null and update the TSS Temporary End Date to Null.

public class update_tss_fields {
    public static String saveData(){
        for (Account a : [SELECT Id FROM Account WHERE TSS_Temporary_End_Date__c = TODAY()]){
               if (a.TSS_Temporary_End_Date__c = TODAY()){ 
                   a.TSS_Designation__C = null;
                   a.TSS_Temporary_End_Date__c = null;
                   update a;
               } 
               }    
        }
     }


I've tried 'UPDATE', 'IF' and when i try to save it get an error when using those expressions.  So im now getting this error: Error: Compile Error: Expecting ']' but was: '(' at line 3 column 89) 

Any help would be appreciated.

I did recieve the following updated code from another user in the community but it did not resolve my issue.  I get a new error:  Error: Compile Error: Method does not exist or incorrect signature: void TODAY() from the type update_tss_fields at line 4 column 85

public class update_tss_fields {
    public static String saveData(){
     List<Account> accountsToUpdate = new LIST<Account>();
        for (Account a : [SELECT Id FROM Account WHERE TSS_Temporary_End_Date__c =: TODAY()]){
               if (a.TSS_Temporary_End_Date__c = TODAY()){ 
                   a.TSS_Designation__C = null;
                   a.TSS_Temporary_End_Date__c = null;
                   accountsToUpdate.add(a); // make use of collections to store records
                 
               } 
               }    
update accountsToUpdate; // do the dml outside of for loop
        }
     }
I am currently working with a consulting company that eluded there is a way to assign permission sets by role versus by user.  I am unaware of any changes and wanted to reachout to our group to see if that has changed?  Please let me know if this is now possible and how to accomplish assiging permissions to roles.
I have created a vf page used when clicking the Post Idea button from Idea's.  I have assigned that page to all profiles and validated the field level security.  I am still unable to see the new page.  What am I missing?   
I have created a vf page and added it to a new section of the case page layout(standard), however I am not able to see the vfpage when I try to edit or create a new record.  On my vf page I am using field sets to display the custom fields.  I am looking to be able to see formula fields when creating a new record type as well as populate the manual entry fields.  

The screenshot is of what the vf page looks like on the case page.  
User-added image

When its in edit mode the entire vf page(section) is not visible.

User-added image
VFPage code:
<apex:page standardController="Case">
    <apex:form >
        <apex:pageBlock >
                    <apex:pageBlockSection title="Advance Disbursement/LIBOR Rollover Authorization" columns="2">
           <apex:repeat value="{!$ObjectType.Case.FieldSets.Advance_Request}" 
                    var="field">
              <apex:inputField value="{!Case[field]}" />
              </apex:repeat>
                       </apex:pageBlockSection>
     </apex:pageBlock>
     </apex:form>
       <apex:form >
        <apex:pageBlock >
                    <apex:pageBlockSection title="Borrowing Base Information (Optional)" columns="2">
           <apex:repeat value="{!$ObjectType.Case.FieldSets.Advance_Request}" 
                    var="field">
              <apex:inputField value="{!Case[field]}" />
              </apex:repeat>
                       </apex:pageBlockSection>
     </apex:pageBlock>
     </apex:form>
<apex:form >
        <apex:pageBlock >
                    <apex:pageBlockSection title="Disbursement Instructions" columns="2">
           <apex:repeat value="{!$ObjectType.Case.FieldSets.Advance_Request}" 
                    var="field">
              <apex:inputField value="{!Case[field]}" />
              </apex:repeat>
                       </apex:pageBlockSection>
     </apex:pageBlock>
     </apex:form>
     <apex:form >
        <apex:pageBlock >
                    <apex:pageBlockSection title="Option Priced Loan Advance and Rollover Information (If Applicable)" columns="2">
           <apex:repeat value="{!$ObjectType.Case.FieldSets.Advance_Request}" 
                    var="field">
              <apex:inputField value="{!Case[field]}" />
              </apex:repeat>
                       </apex:pageBlockSection>
     </apex:pageBlock>
     </apex:form>
     </apex:page>

 
I have a popup alert on my case page layout that appears at the top of the case page.  I wanted to find out if the popup alert message could be
  • moved to the middle of the page
  • how to add a image file (that is sized down) or a border to make it stand out.  
  • image that i have saved to Documents is Exclamation  [img src="https://texascapitalbank--WMPDev1--c.cs11.content.force.com/servlet/servlet.ImageServer?id=015Z0000002Ty1e&amp;oid=00DZ000000N88xi&amp;lastMod=1500469279000"]
User-added image



 
I need some assistance with a popup alert I created for one of my case record types.  I want the alert to fire when a custom field (Wire to) is populated only.  What is currently happening is the alert is popping at every edit of the record, even when this field is not populated.  

I need the alert to validate when the Wire to field is not null and then display the message.

VF Page