• Marni
  • NEWBIE
  • 100 Points
  • Member since 2011

  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 25
    Replies

I am writing an Apex Test Class and am receiving the error: Compile Error: Expression cannot be assigned at line -1 column -1.  Can anyone help me with this??  The class below.  Any help is greatly appreciated!  Thanks!!

 

  Error: Compile Error: Expression cannot be assigned at line -1 column -1

 

@isTest
private class TestBankTransactionRollUpTrigger {

    static testMethod void testRollUpToBankTransaction() {
        Test.startTest();
        //get the Client account record type
        RecordType clientRt = [SELECT Id, DeveloperName FROM RecordType WHERE DeveloperName = 'Client'];
      
        //Client Owner of Bank Account
        Account pAccount = new Account();
        pAccount.Name = 'Client Account';
        account.RecordTypeId = clientRt.id;
        insert pAccount;
        
        //Bank Account
        Client_Fiduciary_Bank_Account__c pBankAccount = new Client_Fiduciary_Bank_Account__c();
        pBankAccount.Name = 'Bank Account';
        pBankAccount.Client_Owner_of_Account__c = pAccount.id;
        pBankAccount.Account_Number__c = '12345';
        pBankAccount.Bank_Number__c = '12345';
        pBankAccount.Last_Statement_Date__c = '5/31/2013';
        insert pBankAccount;
        
        //Bank Transaction
        Bank_Transaction__c pBankTransaction = new Bank_Transaction__c();
        pBankTransaction.Bank_Account__c = pBankAccount.id;
        pBankTransaction.Transaction_Type__c = 'Incoming Wire';
        pBankTransaction.Transaction_Date__c = '1/1/2013';
        pBankTransaction.Transaction_Amount__c = '1000000.00';
        insert pBankTransaction;
        
        //Claim
        User user = TestCreateMockData.buildTestUser(41, 'Standard User');
        insert user;
        Contact underwriter = TestCreateMockData.buildTestUnderwriter(42, 'The Underwriter');
        insert underwriter;
        Account iVosProgram = TestCreateMockData.buildTestProgramAck(43, 'iVos Program', user);
        insert iVosProgram;
        Account insured = TestCreateMockData.buildTestInsuredNoAck(44, 'Insured iVos', user);
        insert insured;
        Policy__c policy = TestCreateMockData.buildTestPolicy(45, 'The Policy', underwriter, insured);
        insert policy;
        Claim__c iVosClaim = TestCreateMockData.buildTestiVOSClaim(46, 'iVos Claim1 TBD', iVosProgram, insured, policy);
        insert iVosClaim;
        
        //create cash calls and add it to bank account
        List<Cash_Call_Request__c> cashCalls = new List<Cash_Call_Request__c>();
        
        Cash_Call_Request__c cashCall1 = new  Cash_Call_Request__c();     
        cashCall1.Claim__c = iVosClaim.id;
        cashCall1.Bank_Account__c = pBankAccount.id;
        cashCall1.Amount_Requested__c = '125000.00';
        cashCall1.Comments__c = 'legal';
        cashCall1.Submitted_for_Approval__c = true;
        cashCall1.Approved_for_Cash_Call__c = true;
        cashCall1.Submitted_for_Cash_Call__c = true;
                
        Cash_Call_Request__c cashCall2 = new  Cash_Call_Request__c();         
        cashCall2.Claim__c = iVosClaim.id;
        cashCall2.Bank_Account__c = pBankAccount.id;
        cashCall2.Amount_Requested__c = '150000.00';
        cashCall2.Comments__c = 'legal';
        cashCall2.Submitted_for_Approval__c = true;
        cashCall2.Approved_for_Cash_Call__c = true;
        cashCall2.Submitted_for_Cash_Call__c = true;
          
        cashCalls.add(cashCall1);
        cashCalls.add(cashCall2);
        insert cashCalls;
        
        //update cash call to funded and paid
        cashCall1.Cash_Call_Funded__c = true;
        cashCall1.Check_Number__c = '1234';
        cashCall1.Paid__c = true;
        cashCall1.Date_Check_Printed__c = '5/31/2013';
        cashCall1.Amount_Paid__c = '100000.00';
        cashCall1.Funding_Wire_Transfer__c = pBankTransaction.id;
        update cashCall1;
        
        //check that the total cash call requested has increased to $125000.00
        pBankTransaction = [SELECT id, name, Total_Cash_Call_Requested__c FROM Bank_Transaction__c WHERE ID = :pBankTransaction.id];
        System.assertEquals(125000, pBankTransaction.Total_Cash_Call_Requested__c);
        
        cashCall2.Cash_Call_Funded__c = true;
        cashCall2.Check_Number__c = '5678';
        cashCall2.Paid__c = true;
        cashCall2.Date_Check_Printed__c = '6/1/2013';
        cashCall2.Amount_Paid__c = '90000.00';
        cashCall2.Funding_Wire_Transfer__c = pBankTransaction.id;
        update cashCall2;
        
       //check that the total cash call requested has increased to $275000
        pBankTransaction = [SELECT id, name, Total_Cash_Call_Requested__c FROM Bank_Transaction__c WHERE ID = :pBankTransaction.id];
        System.assertEquals(275000, pBankTransaction.Total_Cash_Call_Requested__c);
        
        delete cashCall1;
        Test.stopTest();
    }
}

 

 

   

  • June 20, 2013
  • Like
  • 0

I have a visualforce page that works - it pulls two related lists and shows all the results on a PDF.  My users have asked if I can order the tables that appear so the results are more manageable.  I am having an issue figuring what to add to the page.  I have pasted my VF code below which all works perfectly, I just need a little help figuring out what to add.  Any help on this is greatly appreciated.  Thanks!!

 

 

<apex:page renderas="PDF" standardController="Account" showHeader="false" sidebar="false">
<head>
<style>

@page {
    margin : 70pt .5in .5in .5in;
    @top-center {
        content : "Insured Claim Check";
     }

    @bottom-left {
        content : "LVL Claims Services, LLC - Privileged and Confidential";
    }
    @bottom-right {
        content: "Page " counter(page) " of " counter(pages);
    }
}

div.header {
    position : running(header) ;
}

div.footer {
    position : running(footer) ;
}
</style>
</head>
<p>{!Account.Name} as of {!if(Month(Today())=1,"January","")}{!if(Month(Today())=2,"February","")}{!if(Month(Today())=3,"March","")}{!if(Month(Today())=4,"April","")}{!if(Month(Today())=5,"May","")}{!if(Month(Today())=6,"June","")}{!if(Month(Today())=7,"July","")}{!if(Month(Today())=8,"August","")}{!if(Month(Today())=9,"September","")}{!if(Month(Today())=10,"October","")}{!if(Month(Today())=11,"November","")}{!if(Month(Today())=12,"December","")} {!Day(Today())}, {!Year(Today())}
</p>
<p></p>
<p><u>Related Policies</u></p>
<apex:variable value="{!1}" var="count"/>
<table id="policies" border="1" cellspacing="2" cellpadding="5">
<tr>
<th>#</th>
<th>Policy Number</th>
<th>Policy Period</th>
<th>Underwriter</th>
<th>Underwriting Branch Office</th>
</tr>
<apex:repeat var="rp" value="{!Account.Policies5__r}">
<tr>
<td>{!FLOOR(count)} </td>
<td>{!rp.Name} </td>
<td><apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rp.Effective_Date__c}"/></apex:outputText> - <apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rp.Expiration_Date__c}"/></apex:outputText></td>
<td>{!rp.Underwriter__r.Name}</td>
<td>{!rp.Underwriting_Branch_Office__c}</td>
<apex:variable var="count" value="{!count+ 1}"/>
</tr>
</apex:repeat>
<p/>
<b>Total number of Policies: </b> {!FLOOR(count-1)}
</table>
<p><u>Related Claims</u></p>
<apex:variable value="{!1}" var="count"/>
<table id="claims" border="1" cellspacing="2" cellpadding="5">
<tr>
<th>#</th>
<th>Claim Number</th>
<th>Insured</th>
<th>Claimant Name</th>
<th>Policy Number</th>
<th>Claim Status</th>
<th>Date Reported</th>
<th>Examiner</th>
</tr>
<apex:repeat var="rc" value="{!Account.Claims__r}">
<tr>
<td>{!FLOOR(count)} </td>
<td>{!rc.Name} </td>
<td>{!rc.Insured_Lookup__r.name}</td>
<td>{!rc.Claimant_Name__c}</td>
<td>{!rc.Policy__r.name}</td>
<td>{!rc.Status__c}</td>
<td><apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rc.Date_Reported__c}"/></apex:outputText></td>
<td>{!rc.Assigned_Examiner2__r.name}</td>
<apex:variable var="count" value="{!count+ 1}"/>
</tr>
</apex:repeat>
<p/>
<b>Total number of Claims: </b> {!FLOOR(count-1)}
</table>
<p/>
</apex:page>

  • December 07, 2012
  • Like
  • 0

I have Apex Triggers in my production environment that are successfully working.  In my sandbox, I recently added two fields on an object (Account) that is referenced via a lookup field on another object (Claim__c).  I then wanted to add those two fields that were added on Account as criteria for when the apex trigger should fire.  Once I added the reference to those two fields, my trigger stopped working.  I think I may be referencing those fields incorrectly and was looking for some hlep.  Below is my trigger and I identified the new code I added to reference the fields on the Account record that is identified through a lookup field on the Claim__c object in red text.

 

Any help is greatly appreciated, thanks!

 

***Please note that Acknowledgment_Letter__c is a picklist and Combo_Letter_Instead_of_Acknowledgment__c is a checkbox.

 

trigger AcknowledgmentLetterTask on Claim__c (before update) {
 List<Task> tasks = new List<Task>();
    for(Claim__c claim : Trigger.new){
    if(claim.Acknowledgment_Letter_Task_Created__c != null &&
         claim.Acknowledgment_Letter_Task_Created__c == false &&
         claim.Approval_Received__c == true &&
         claim.Program_Lookup__r.Acknowledgment_Letter__c == 'Yes' &&
         claim.Insured_Lookup__r.Combo_Letter_Instead_of_Acknowledgment__c != null &&
         claim.Insured_Lookup__r.Combo_Letter_Instead_of_Acknowledgment__c == false

){

//Do your Task creation
            Task AcknowledgmentTask = new Task();
            AcknowledgmentTask.ActivityDate = claim.LVL_Received_Date__c + 2;   
            AcknowledgmentTask.WhatId = claim.id;
            AcknowledgmentTask.OwnerId = claim.Program_Lookup__r.Acknowledgment_Letter_Task_User__c;    
            AcknowledgmentTask.Priority = 'Normal';   
            AcknowledgmentTask.Status = 'Not Started';
            AcknowledgmentTask.Subject = claim.Program_ID__c + ' Acknowledgment Letter -- ' + claim.Insured__C + ' -- ' + claim.Claimant_Name__c;   

//Add the Task
tasks.add(AcknowledgmentTask);
            
//Update the field on Claim so this isn't done again
claim.Acknowledgment_Letter_Task_Created__c = true;
        }
    }  
    
    insert tasks;
}

  • October 02, 2012
  • Like
  • 0

I am new to Apex and am having an issue moving a trigger I created in Sandbox through a Change Set to production.  The trigger I created is working great but when I try the Change Set it does not validate because it says I need to test the trigger.  I was reading about Apex Test Methods but am a little confused as to how to I execute the test.  Any help on next steps would be greatly appreciated!  The trigger I need to test is:

 

trigger CoverageLetterTask on Claim__c (before update) {
 List<Task> tasks = new List<Task>();
    for(Claim__c claim : Trigger.new){
    if(claim.Task_created__c != null &&
       claim.Task_created__c == false &&
       claim.Approval_Received__c == true &&
       claim.Insured__c != 'Catholic Health East'){


//Do your Task creation
            Task CoverageTask= new Task();
            CoverageTask.ActivityDate = claim.LVL_Received_Date__c + 30;   
            CoverageTask.WhatId = claim.id;
            CoverageTask.OwnerId = claim.Assigned_Examiner2__c;   
            CoverageTask.Priority = 'Normal';   
            CoverageTask.Status = 'Not Started';
            CoverageTask.Subject = claim.Program_ID__c + ' Coverage Letter -- ' + claim.Insured__C + ' -- ' + claim.Claimant_Name__c;   

//Add the Task
tasks.add(CoverageTask);
            
//Update the field on Claim so this isn't done again
            claim.Task_Created__c = true;
        }
    }  
    
    insert tasks;
}

  • August 25, 2012
  • Like
  • 0

I am not familiar with maps so any help is greatly appreciated!  Can anyone help me understand why I am getting the below error on the below code??  Please note that line 15 is "Map idsCoverage = new Map();"

 

Thanks in advance for any help!!!

 

Error: Compile Error: unexpected token: 'Map' at line 15 column 0

 

 

//This trigger includes all financial rollups to the Coverage

trigger UpdateRollupsToCoverage on Claim__c (after update)
//Define variables
{
double sumCoverageTotalExpenseOS = 0.0;
double sumCoverageTotalExpensePD = 0.0;
double sumCoverageTotalLegalOS = 0.0;
double sumCoverageTotalLegalPD = 0.0;
double sumCoverageTotalIndemnityOS = 0.0;
double sumCoverageTotalIndemnityPD = 0.0;
Coverage__c [] coveragesToUpdate = new Coverage__c[]{};


Map idsCoverage = new Map();

if(Trigger.isUpdate)
if(Claim__c.Claim_Coverage__c!=null)
{
Claim__c [] teNew = trigger.new;
for(Claim__c te : teNew)
{
for (Coverage__c claimCoverage : [select Id, Name, Coverage_Total_Expense_O_S__c from Coverage__c where Id = :te.Claim_Coverage__c])
{

//Sum all the claimCoverage entries
//Total Expense OS
for (Claim__c expenseOSs: [select Id, Expense_OS__c from Claim__c where Claim_Coverage__c = :claimCoverage.id])
{sumCoverageTotalExpenseOS += expenseOSs.Expense_OS__c;}
claimCoverage.Coverage_Total_Expense_O_S__c = sumCoverageTotalExpenseOS;
//Total Expense PD
for (Claim__c expensePDs: [select Id, Expense_PD__c from Claim__c where Claim_Coverage__c = :claimCoverage.id])
{sumCoverageTotalExpensePD += expensePDs.Expense_PD__c;}
claimCoverage.Coverage_Total_Expense_PD__c = sumCoverageTotalExpensePD;
//Total Legal OS
for (Claim__c legalOSs: [select Id, Legal_OS__c from Claim__c where Claim_Coverage__c = :claimCoverage.id])
{sumCoverageTotalLegalOS += legalOSs.Legal_OS__c;}
claimCoverage.Coverage_Total_Legal_O_S__c = sumCoverageTotalLegalOS;
//Total Legal PD
for (Claim__c legalPDs: [select Id, Legal_PD__c from Claim__c where Claim_Coverage__c = :claimCoverage.id])
{sumCoverageTotalLegalPD += legalPDs.Legal_PD__c;}
claimCoverage.Coverage_Total_Legal_PD__c = sumCoverageTotalLegalPD;
//Total Indemnity OS
for (Claim__c indemnityOSs: [select Id, Indemnity_OS__c from Claim__c where Claim_Coverage__c = :claimCoverage.id])
{sumCoverageTotalIndemnityOS += indemnityOSs.Indemnity_OS__c;}
claimCoverage.Coverage_Total_Indemnity_O_S__c = sumCoverageTotalIndemnityOS;
//Total Indemnity PD
for (Claim__c indemnityPDs: [select Id, Indemnity_PD__c from Claim__c where Claim_Coverage__c = :claimCoverage.id])
{sumCoverageTotalIndemnityPD += indemnityPDs.Indemnity_PD__c;}
claimCoverage.Coverage_Total_Indemnity_PD__c = sumCoverageTotalIndemnityPD;

if(!idsCoverage.containsId(claimCoverage.id))
{
idsCoverage.put(claimCoverage.id, claimCoverage.id);
//add claimCoverage to list to be updated outside of the loop only if coverage is Unique
coveragesToUpdate.add(claimCoverage);
}
else
{
//If coverage exists then update separately

update claimCoverage;
}

}}}

//commit the changes to Salesforce
update coveragesToUpdate;}

  • August 15, 2012
  • Like
  • 0

I have multiple custom objects.  In our Sandbox, Policy is the Master Object to both Claim and Coverage.  Coverage (in some cases) can be considered to be like a master to Claim so I have written Apex Triggers to act as a rollupsummary of all claim records that have a lookup to a specific Coverage record.  This trigger works great when we are manually update the claim records.

 

We use another system in which we import a refresh of data on a daily basis through a CSV file using the data management tool in SalesForce.  This currently works great in our production environment but in Sandbox we are developing new Master-Detail Relationships and Apex Triggers which appear to be causing an issue with this daily import.

 

In our business, there are multiple Claims that can have the same Coverage referenced.  When the Claim refresh file is imported , I recieve an exception error on the trigger because the trigger is for AfterUpdate.  I believe this is happening because the refresh file is updating multiple claim records at once that reference the same coverage and the apex trigger is firing AfterUpdate for for a single Coverage record and doesn't know how to handle the multiple Claim records that are causing it to fire.  (I hope this makes sense.)

 

Is there anyway to refresh multiple records at once that reference the same record of another object in which an AfterUpdate apex trigger is fired?

 

Any help on this is greatly appreciated.

 

Thanks!

  • July 31, 2012
  • Like
  • 0

I have a situation where a child object (Claim__c) technically has multiple Master-Detail relationships.  Since SF does not support this, I needed to create an Apex Trigger to create a roll up summary for one of the 'parent' custom objects (Coverage__c) that is a lookup field (Claim_Coverage__c on object Claim__c).  Here is what I am trying to do:

 

On the Coverage__c custom object populate a field called Coverage_Total_Indemnity_PD__c with a calculation of the Indemnity_PD__c field on Claim__c.

 

This is new to me with Apex but I have made an attempt at the trigger (below) but keep getting the following error:

Error: Compile Error: Variable does not exist: ListCoverages at line 27 column 20

(I note in the code below the line with the error)


From what I understand, this variable does exist earlier in the trigger so I am not sure how to resolve.  Any help is resolving this error is greatly appreciated!  

 

 

trigger CoverageIndemnityPDTrigger On Claim__c(after insert, after update){
set<Id> setCoverageid=new set<Id>();
Map<string,Decimal> CoveragewithTotalIndemnityPD=new Map<string,Decimal>();
for(Claim__c acs:Trigger.New){
if(acs.Claim_Coverage__c!=null && acs.Indemnity_PD__c!=null){
setCoverageid.add(setCoverageid);
}
}

if(setCoverageid.size()>0){
List<Coverage__c> ListCoverages = [Select Id, Coverage_Total_Indemnity_PD__c from Coverage__c where Coverage__c =:setCoverageid];
List<Claim__c> ListCoverageClaims = [Select Id, Indemnity_PD__c from Claim__c where Coverage__c =:setCoverageid and Indemnity_PD__c!=null];
for(Id CoverageId:setCoverageid){
Decimal totCovIndPD=0;
for(Claim__c acs: ListCoverageClaims){
if(CoverageId=acs.Coverage_c){
totCovIndPD=totCovIndPD + acs.Indemnity_PD__c ;
}
}
CoveragewithTotalIndemnityPD.put(CoverageId,totCovIndPD);

}
}

List<Coverage__c> UpdateCoverage=new List<Coverage__c>();

 

****BELOW IS THE LINE THAT CONTAINS THE ERROR -- THE ERROR IS 'LISTCOVERAGES')*****

for(Coverage__c MC:ListCoverages){

 

MC.Coverage_Total_Indemnity_PD__c=CoveragewithTotalIndemnityPD.get(MC.id);
UpdateCoverage.add(MC);
}

if(UpdateCoverage.size()>0){
update UpdateCoverage;
}

}

  • April 30, 2012
  • Like
  • 0

I am trying to write a validation rule that says:

If Submitted_for_Approval__c is checked and the text field Name__c does not contain the characters 'TBD' then show the error.  Name__c can contain other characters but it it does not speficially have 'TBD' as part of those characters I want to show the error.

 

I am able to create a working validation rule that says the opposite:

If Submitted_for_Approval__c is checked and the text field Name__c contains the characters 'TBD' then show the error.

by using:

AND(Submitted_for_Approval = true, CONTAINS(Name, 'TBD'))

 

Is there an Operator for 'DOES NOT CONTAIN' or someway to express that?

 

Any help is greatly appreciated, thanks!!

 

 

  • April 25, 2012
  • Like
  • 0

I am adding a custom field to the AccountHierarchyTree and have been able to successfully add this field BUT it is showing the SalesForce ID rather than the text.  The field I am adding is a Lookup field to another account so the SalesForce ID of the account is displaying when I would like the Account Name to display.  I added the following to the component but assume there is either something I need to add or use instead of apex:outputText.  Any help is greatly appreciated!  Thanks!

 

 <apex:outputText style="{!IF(pos.currentNode,'font-weight: bold;','')}" value=", {!pos.account.Related_Program__c}" rendered="{!IF(pos.account.Related_Program__c != '', true, false)}"/>
  • February 27, 2012
  • Like
  • 0

I have a visualforce page that shows a related list and I was wondering if it was possible to add either a table row count at the bottom of a table or add row numbers?  I have tried a few different sets of code that I had found but nothing is working.   Any help would be great!  Thanks! Below is the e table:

 

<p><u>Related Claims</u></p>
<table id="claims" border="1" cellspacing="2" cellpadding="5">
<tr>
<th>Claim Number</th>
<th>Insured</th>
<th>Claimant Name</th>
<th>Policy Number</th>
<th>Claim Status</th>
<th>Date Reported</th>
<th>Examiner</th>
</tr>
<apex:repeat var="rc" value="{!Account.Claims__r}">
<tr>
<td>{!rc.Name} </td>
<td>{!rc.Insured_Lookup__r.name}</td>
<td>{!rc.Claimant_Name__c}</td>
<td>{!rc.Policy__r.name}</td>
<td>{!rc.Status__c}</td>
<td><apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rc.Date_Reported__c}"/></apex:outputText></td>
<td>{!rc.Assigned_Examiner2__r.name}</td>
</tr>
</apex:repeat>
</table>

  • November 18, 2011
  • Like
  • 0

I have looked through a number of board discussions and read through the related articles but cannot seem to get a solution to work so any help is really appreciated!  I have a VF that I have built that works great.  The only issue I have is that when it requires more than one page, it most often puts the page break in the middle of one of the tables.  Is there anyway to have a dynamic page break that is not driven by number of records?  I ask this because I want it as much on a single page as possible but there are two tables and I do not know how to do number of records when I am dependent on two different tables populating that will have a different number of records each time? 

 

Also, if possible to add page numbers that would be great but not as important as the dynamic page break.

 

Below is the code of the page I need this on.

 

Thanks!!

 

<apex:page renderas="PDF" standardController="Account" showHeader="false" sidebar="false">
<p><b><font size="4">{!Account.Name}</font></b></p>
<p><b><font size="2">Claim Check as of {!if(Month(Today())=1,"January","")}{!if(Month(Today())=2,"February","")}{!if(Month(Today())=3,"March","")}{!if(Month(Today())=4,"April","")}{!if(Month(Today())=5,"May","")}{!if(Month(Today())=6,"June","")}{!if(Month(Today())=7,"July","")}{!if(Month(Today())=8,"August","")}{!if(Month(Today())=9,"September","")}{!if(Month(Today())=10,"October","")}{!if(Month(Today())=11,"November","")}{!if(Month(Today())=12,"December","")} {!Day(Today())}, {!Year(Today())}
</font></b></p>
<p></p>
<p><b>RELATED POLICIES:</b></p>
<table border="1" cellspacing="2" cellpadding="5">
<tr>
<th>Policy Number</th>
<th>Policy Period</th>
<th>Underwriter</th>
<th>Underwriting Branch Office</th>
</tr>
<apex:repeat var="rp" value="{!Account.Policies5__r}">
<tr>
<td>{!rp.Name} </td>
<td><apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rp.Effective_Date__c}"/></apex:outputText> - <apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rp.Expiration_Date__c}"/></apex:outputText></td>
<td>{!rp.Underwriter__r.Name}</td>
<td>{!rp.Underwriting_Branch_Office__c}</td>
</tr>
</apex:repeat>
</table>
<p><b>RELATED CLAIMS:</b></p>
<table border="1" cellspacing="2" cellpadding="5">
<tr>
<th>Claim Number</th>
<th>Insured</th>
<th>Claimant Name</th>
<th>Policy Number</th>
<th>Claim Status</th>
<th>Date Reported</th>
<th>Examiner</th>
</tr>
<apex:repeat var="rc" value="{!Account.Claims__r}">
<tr>
<td>{!rc.Name} </td>
<td>{!rc.Insured_Lookup__r.name}</td>
<td>{!rc.Claimant_Name__c}</td>
<td>{!rc.Policy__r.name}</td>
<td>{!rc.Status__c}</td>
<td><apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rc.Date_Reported__c}"/></apex:outputText></td>
<td>{!rc.Owner.name}</td>
</tr>
</apex:repeat>
</table>
<p/>
<div class="bPageFooter" id="bodyFooter"><div class="footer">Privileged and Confidential - LVL Claims Services, LLC</div></div>
</apex:page>

  • November 16, 2011
  • Like
  • 0

I have a Visualforce page which I have two versions of but the only difference is that one renders as a PDF.  On this one, the date does not appear.  I use the same code for the page that does not render as a PDF and the date appears without issue.  Any help would be great!  Thanks!

 

<apex:page renderas="PDF" standardController="Policy__c" showHeader="false" sidebar="false">
<p><b><font size="4">{!Policy__c.Name} - {!Policy__c.Insured__r.Name}</font></b></p>
<p><b><font size="2">Claim Check as of <script>
 var mydate=new Date()
    var year=mydate.getYear()
   
    if (year < 1000)
        year+=1900
   
    var day=mydate.getDay()
    var month=mydate.getMonth()+1
   
    if (month<10)
        month="0"+month
   
    var daym=mydate.getDate()
    if (daym<10)
        daym="0"+daym
   
    document.write(month+"/"+daym+"/"+year)
</script></font></b></p>
<p></p>
<table border="1" cellspacing="2" cellpadding="10">
<tr>
<th>Claim Number</th>
<th>Insured</th>
<th>Claimant Name</th>
<th>Policy Number</th>
<th>Claim Status</th>
<th>Date Reported</th>
<th>Examiner</th>
</tr>
<apex:repeat var="rc" value="{!Policy__c.Claims1__r}">
<tr>
<td>{!rc.Name} </td>
<td>{!rc.Insured_Lookup__r.name}</td>
<td>{!rc.Claimant_Name__c}</td>
<td>{!rc.Policy__r.name}</td>
<td>{!rc.Status__c}</td>
<td><apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rc.Date_Reported__c}"/></apex:outputText></td>
<td>{!rc.Assigned_Examiner2__r.Name}</td>
</tr>
</apex:repeat>
</table>
<p/>
<div class="bPageFooter" id="bodyFooter"><div class="footer">Privileged and Confidential - LVL Claims Services, LLC</div></div>
</apex:page>

  • November 11, 2011
  • Like
  • 0

I am very new to Visualforce Pages so I apologize in advance for such a broad question.  .  I am looking to create a new Button/Link that will open a Visualforce page that simply displays the fields and responses on a simply layout for a user to print (basically the 'Printable View' but with no logos or references to SalesForce.  I also don't want it to show any of the headers, sidebars, etc. of SalesForce.  I just want it to show the fields and responses as they appear on screen.  Very simple, very plain.   I tried copying the Source Code of the Printable View link to get me started but I had two issues:

 

1. Once I added the standardcontroller of my Custom Object in order to get the page to appear as an available option for a custom button, it added in all of the header, side bars, etc.of SalesForce. 

2.  I also realized that it was simply showing the text of the responses rather than directing the page to pull that records responses.  I tried replacing the text that appears in the code with references to the object field but I keep getting errors.

 

Any advice or an example of how I can accomplish this would be greatly appreciated!  Thank you!

  • November 10, 2011
  • Like
  • 0

I have a Visualforce email template and it seems that thSalesForce ID of an Account is appearing rather than the name of the Account Name. 

 

The field I am referencing is a Lookup field on the custom object Policy to an Account.  I am having the same issue with a Lookup field on this custom object to a Contact.  The code I am using for these fields is:

 

Insured: {!relatedTo.Insured__c}

Underwriter: {!relatedTo.Underwriter__c}

 

I am also pulling in two date fields but rather than showing that appears on the screen (e.g. 4/1/2010) it is showing Thu Apr 01 00:00:00 GMT 2010 .  How can I get it to just show MM/DD/YYYY.  The code I am using for these fields is:

 

Effective Date: {!relatedTo.Effective_Date__c}
Expiration Date: {!relatedTo.Expiration_Date__c}

 

Any help is greatly appreciated!  Thanks

  • November 09, 2011
  • Like
  • 0

I am new to Visualforce Email Templates so any help is greatly appreciated!  Thanks!

 

I have an email template that I want to fire off of a custom object (Policy__c) but I want to pull in the Related List that appears on the Policy object - the Related List is called Claims.  Below is the code I have but the error I keep getting is:

 

Error: Invalid field Claims__r for SObject Policy__c

 

<messaging:emailTemplate subject="90 Day Policy Expiration: {!relatedTo.name}" recipientType="Contact" relatedToType="Policy__c">
<messaging:plainTextEmailBody >
The following policy has an Expiration Date that is within 90 days from today.

Details:
Policy: {!relatedTo.Name}
Insured: {!relatedTo.Insured__c}
Effective Date: {!relatedTo.Effective_Date__c}
Expiration Date: {!relatedTo.Expiration_Date__c}
Underwriter: {!relatedTo.Underwriter__c}
Underwriting Branch Office: {!relatedTo.Underwriting_Branch_Office__c}

RELATED CLAIMS:
<apex:repeat value="{!relatedTo.Claims__r}">
</apex:repeat>

</messaging:plainTextEmailBody>
</messaging:emailTemplate>

  • November 09, 2011
  • Like
  • 0

Hi, I am new to Apex and have been working on developing a few triggers that will create a new Task based on specific criteria.  The trigger will only fire after some sort of update on the record.  I have been able to successfully write the trigger but the issue I am having is how to write it so it only fires once.  Below is the trigger I wrote.  Any help in how to change it so that it only fires once would be greatly appreciated.  Thank you!

 

trigger ARGOCoverageLetterTask on Claim__c (after update) {
Claim__c SO=Trigger.new[0];
if (SO.Name == 'ARGO*'){
Task argoCoverageTask = new Task();
argoCoverageTask.ActivityDate = SO.LVL_Received_Date__c + 30;   
argoCoverageTask.WhatId = SO.id;
argoCoverageTask.OwnerId = SO.Assigned_Examiner2__c;   
argoCoverageTask.Priority = 'Normal';   
argoCoverageTask.Status = 'Not Started';   
argoCoverageTask.Subject = 'Coverage Letter';   
Insert argoCoverageTask;
}// else nothing
}



  • October 24, 2011
  • Like
  • 0

I am writing an Apex Test Class and am receiving the error: Compile Error: Expression cannot be assigned at line -1 column -1.  Can anyone help me with this??  The class below.  Any help is greatly appreciated!  Thanks!!

 

  Error: Compile Error: Expression cannot be assigned at line -1 column -1

 

@isTest
private class TestBankTransactionRollUpTrigger {

    static testMethod void testRollUpToBankTransaction() {
        Test.startTest();
        //get the Client account record type
        RecordType clientRt = [SELECT Id, DeveloperName FROM RecordType WHERE DeveloperName = 'Client'];
      
        //Client Owner of Bank Account
        Account pAccount = new Account();
        pAccount.Name = 'Client Account';
        account.RecordTypeId = clientRt.id;
        insert pAccount;
        
        //Bank Account
        Client_Fiduciary_Bank_Account__c pBankAccount = new Client_Fiduciary_Bank_Account__c();
        pBankAccount.Name = 'Bank Account';
        pBankAccount.Client_Owner_of_Account__c = pAccount.id;
        pBankAccount.Account_Number__c = '12345';
        pBankAccount.Bank_Number__c = '12345';
        pBankAccount.Last_Statement_Date__c = '5/31/2013';
        insert pBankAccount;
        
        //Bank Transaction
        Bank_Transaction__c pBankTransaction = new Bank_Transaction__c();
        pBankTransaction.Bank_Account__c = pBankAccount.id;
        pBankTransaction.Transaction_Type__c = 'Incoming Wire';
        pBankTransaction.Transaction_Date__c = '1/1/2013';
        pBankTransaction.Transaction_Amount__c = '1000000.00';
        insert pBankTransaction;
        
        //Claim
        User user = TestCreateMockData.buildTestUser(41, 'Standard User');
        insert user;
        Contact underwriter = TestCreateMockData.buildTestUnderwriter(42, 'The Underwriter');
        insert underwriter;
        Account iVosProgram = TestCreateMockData.buildTestProgramAck(43, 'iVos Program', user);
        insert iVosProgram;
        Account insured = TestCreateMockData.buildTestInsuredNoAck(44, 'Insured iVos', user);
        insert insured;
        Policy__c policy = TestCreateMockData.buildTestPolicy(45, 'The Policy', underwriter, insured);
        insert policy;
        Claim__c iVosClaim = TestCreateMockData.buildTestiVOSClaim(46, 'iVos Claim1 TBD', iVosProgram, insured, policy);
        insert iVosClaim;
        
        //create cash calls and add it to bank account
        List<Cash_Call_Request__c> cashCalls = new List<Cash_Call_Request__c>();
        
        Cash_Call_Request__c cashCall1 = new  Cash_Call_Request__c();     
        cashCall1.Claim__c = iVosClaim.id;
        cashCall1.Bank_Account__c = pBankAccount.id;
        cashCall1.Amount_Requested__c = '125000.00';
        cashCall1.Comments__c = 'legal';
        cashCall1.Submitted_for_Approval__c = true;
        cashCall1.Approved_for_Cash_Call__c = true;
        cashCall1.Submitted_for_Cash_Call__c = true;
                
        Cash_Call_Request__c cashCall2 = new  Cash_Call_Request__c();         
        cashCall2.Claim__c = iVosClaim.id;
        cashCall2.Bank_Account__c = pBankAccount.id;
        cashCall2.Amount_Requested__c = '150000.00';
        cashCall2.Comments__c = 'legal';
        cashCall2.Submitted_for_Approval__c = true;
        cashCall2.Approved_for_Cash_Call__c = true;
        cashCall2.Submitted_for_Cash_Call__c = true;
          
        cashCalls.add(cashCall1);
        cashCalls.add(cashCall2);
        insert cashCalls;
        
        //update cash call to funded and paid
        cashCall1.Cash_Call_Funded__c = true;
        cashCall1.Check_Number__c = '1234';
        cashCall1.Paid__c = true;
        cashCall1.Date_Check_Printed__c = '5/31/2013';
        cashCall1.Amount_Paid__c = '100000.00';
        cashCall1.Funding_Wire_Transfer__c = pBankTransaction.id;
        update cashCall1;
        
        //check that the total cash call requested has increased to $125000.00
        pBankTransaction = [SELECT id, name, Total_Cash_Call_Requested__c FROM Bank_Transaction__c WHERE ID = :pBankTransaction.id];
        System.assertEquals(125000, pBankTransaction.Total_Cash_Call_Requested__c);
        
        cashCall2.Cash_Call_Funded__c = true;
        cashCall2.Check_Number__c = '5678';
        cashCall2.Paid__c = true;
        cashCall2.Date_Check_Printed__c = '6/1/2013';
        cashCall2.Amount_Paid__c = '90000.00';
        cashCall2.Funding_Wire_Transfer__c = pBankTransaction.id;
        update cashCall2;
        
       //check that the total cash call requested has increased to $275000
        pBankTransaction = [SELECT id, name, Total_Cash_Call_Requested__c FROM Bank_Transaction__c WHERE ID = :pBankTransaction.id];
        System.assertEquals(275000, pBankTransaction.Total_Cash_Call_Requested__c);
        
        delete cashCall1;
        Test.stopTest();
    }
}

 

 

   

  • June 20, 2013
  • Like
  • 0

I have a visualforce page that works - it pulls two related lists and shows all the results on a PDF.  My users have asked if I can order the tables that appear so the results are more manageable.  I am having an issue figuring what to add to the page.  I have pasted my VF code below which all works perfectly, I just need a little help figuring out what to add.  Any help on this is greatly appreciated.  Thanks!!

 

 

<apex:page renderas="PDF" standardController="Account" showHeader="false" sidebar="false">
<head>
<style>

@page {
    margin : 70pt .5in .5in .5in;
    @top-center {
        content : "Insured Claim Check";
     }

    @bottom-left {
        content : "LVL Claims Services, LLC - Privileged and Confidential";
    }
    @bottom-right {
        content: "Page " counter(page) " of " counter(pages);
    }
}

div.header {
    position : running(header) ;
}

div.footer {
    position : running(footer) ;
}
</style>
</head>
<p>{!Account.Name} as of {!if(Month(Today())=1,"January","")}{!if(Month(Today())=2,"February","")}{!if(Month(Today())=3,"March","")}{!if(Month(Today())=4,"April","")}{!if(Month(Today())=5,"May","")}{!if(Month(Today())=6,"June","")}{!if(Month(Today())=7,"July","")}{!if(Month(Today())=8,"August","")}{!if(Month(Today())=9,"September","")}{!if(Month(Today())=10,"October","")}{!if(Month(Today())=11,"November","")}{!if(Month(Today())=12,"December","")} {!Day(Today())}, {!Year(Today())}
</p>
<p></p>
<p><u>Related Policies</u></p>
<apex:variable value="{!1}" var="count"/>
<table id="policies" border="1" cellspacing="2" cellpadding="5">
<tr>
<th>#</th>
<th>Policy Number</th>
<th>Policy Period</th>
<th>Underwriter</th>
<th>Underwriting Branch Office</th>
</tr>
<apex:repeat var="rp" value="{!Account.Policies5__r}">
<tr>
<td>{!FLOOR(count)} </td>
<td>{!rp.Name} </td>
<td><apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rp.Effective_Date__c}"/></apex:outputText> - <apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rp.Expiration_Date__c}"/></apex:outputText></td>
<td>{!rp.Underwriter__r.Name}</td>
<td>{!rp.Underwriting_Branch_Office__c}</td>
<apex:variable var="count" value="{!count+ 1}"/>
</tr>
</apex:repeat>
<p/>
<b>Total number of Policies: </b> {!FLOOR(count-1)}
</table>
<p><u>Related Claims</u></p>
<apex:variable value="{!1}" var="count"/>
<table id="claims" border="1" cellspacing="2" cellpadding="5">
<tr>
<th>#</th>
<th>Claim Number</th>
<th>Insured</th>
<th>Claimant Name</th>
<th>Policy Number</th>
<th>Claim Status</th>
<th>Date Reported</th>
<th>Examiner</th>
</tr>
<apex:repeat var="rc" value="{!Account.Claims__r}">
<tr>
<td>{!FLOOR(count)} </td>
<td>{!rc.Name} </td>
<td>{!rc.Insured_Lookup__r.name}</td>
<td>{!rc.Claimant_Name__c}</td>
<td>{!rc.Policy__r.name}</td>
<td>{!rc.Status__c}</td>
<td><apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rc.Date_Reported__c}"/></apex:outputText></td>
<td>{!rc.Assigned_Examiner2__r.name}</td>
<apex:variable var="count" value="{!count+ 1}"/>
</tr>
</apex:repeat>
<p/>
<b>Total number of Claims: </b> {!FLOOR(count-1)}
</table>
<p/>
</apex:page>

  • December 07, 2012
  • Like
  • 0

I am new to Apex and am having an issue moving a trigger I created in Sandbox through a Change Set to production.  The trigger I created is working great but when I try the Change Set it does not validate because it says I need to test the trigger.  I was reading about Apex Test Methods but am a little confused as to how to I execute the test.  Any help on next steps would be greatly appreciated!  The trigger I need to test is:

 

trigger CoverageLetterTask on Claim__c (before update) {
 List<Task> tasks = new List<Task>();
    for(Claim__c claim : Trigger.new){
    if(claim.Task_created__c != null &&
       claim.Task_created__c == false &&
       claim.Approval_Received__c == true &&
       claim.Insured__c != 'Catholic Health East'){


//Do your Task creation
            Task CoverageTask= new Task();
            CoverageTask.ActivityDate = claim.LVL_Received_Date__c + 30;   
            CoverageTask.WhatId = claim.id;
            CoverageTask.OwnerId = claim.Assigned_Examiner2__c;   
            CoverageTask.Priority = 'Normal';   
            CoverageTask.Status = 'Not Started';
            CoverageTask.Subject = claim.Program_ID__c + ' Coverage Letter -- ' + claim.Insured__C + ' -- ' + claim.Claimant_Name__c;   

//Add the Task
tasks.add(CoverageTask);
            
//Update the field on Claim so this isn't done again
            claim.Task_Created__c = true;
        }
    }  
    
    insert tasks;
}

  • August 25, 2012
  • Like
  • 0

I am not familiar with maps so any help is greatly appreciated!  Can anyone help me understand why I am getting the below error on the below code??  Please note that line 15 is "Map idsCoverage = new Map();"

 

Thanks in advance for any help!!!

 

Error: Compile Error: unexpected token: 'Map' at line 15 column 0

 

 

//This trigger includes all financial rollups to the Coverage

trigger UpdateRollupsToCoverage on Claim__c (after update)
//Define variables
{
double sumCoverageTotalExpenseOS = 0.0;
double sumCoverageTotalExpensePD = 0.0;
double sumCoverageTotalLegalOS = 0.0;
double sumCoverageTotalLegalPD = 0.0;
double sumCoverageTotalIndemnityOS = 0.0;
double sumCoverageTotalIndemnityPD = 0.0;
Coverage__c [] coveragesToUpdate = new Coverage__c[]{};


Map idsCoverage = new Map();

if(Trigger.isUpdate)
if(Claim__c.Claim_Coverage__c!=null)
{
Claim__c [] teNew = trigger.new;
for(Claim__c te : teNew)
{
for (Coverage__c claimCoverage : [select Id, Name, Coverage_Total_Expense_O_S__c from Coverage__c where Id = :te.Claim_Coverage__c])
{

//Sum all the claimCoverage entries
//Total Expense OS
for (Claim__c expenseOSs: [select Id, Expense_OS__c from Claim__c where Claim_Coverage__c = :claimCoverage.id])
{sumCoverageTotalExpenseOS += expenseOSs.Expense_OS__c;}
claimCoverage.Coverage_Total_Expense_O_S__c = sumCoverageTotalExpenseOS;
//Total Expense PD
for (Claim__c expensePDs: [select Id, Expense_PD__c from Claim__c where Claim_Coverage__c = :claimCoverage.id])
{sumCoverageTotalExpensePD += expensePDs.Expense_PD__c;}
claimCoverage.Coverage_Total_Expense_PD__c = sumCoverageTotalExpensePD;
//Total Legal OS
for (Claim__c legalOSs: [select Id, Legal_OS__c from Claim__c where Claim_Coverage__c = :claimCoverage.id])
{sumCoverageTotalLegalOS += legalOSs.Legal_OS__c;}
claimCoverage.Coverage_Total_Legal_O_S__c = sumCoverageTotalLegalOS;
//Total Legal PD
for (Claim__c legalPDs: [select Id, Legal_PD__c from Claim__c where Claim_Coverage__c = :claimCoverage.id])
{sumCoverageTotalLegalPD += legalPDs.Legal_PD__c;}
claimCoverage.Coverage_Total_Legal_PD__c = sumCoverageTotalLegalPD;
//Total Indemnity OS
for (Claim__c indemnityOSs: [select Id, Indemnity_OS__c from Claim__c where Claim_Coverage__c = :claimCoverage.id])
{sumCoverageTotalIndemnityOS += indemnityOSs.Indemnity_OS__c;}
claimCoverage.Coverage_Total_Indemnity_O_S__c = sumCoverageTotalIndemnityOS;
//Total Indemnity PD
for (Claim__c indemnityPDs: [select Id, Indemnity_PD__c from Claim__c where Claim_Coverage__c = :claimCoverage.id])
{sumCoverageTotalIndemnityPD += indemnityPDs.Indemnity_PD__c;}
claimCoverage.Coverage_Total_Indemnity_PD__c = sumCoverageTotalIndemnityPD;

if(!idsCoverage.containsId(claimCoverage.id))
{
idsCoverage.put(claimCoverage.id, claimCoverage.id);
//add claimCoverage to list to be updated outside of the loop only if coverage is Unique
coveragesToUpdate.add(claimCoverage);
}
else
{
//If coverage exists then update separately

update claimCoverage;
}

}}}

//commit the changes to Salesforce
update coveragesToUpdate;}

  • August 15, 2012
  • Like
  • 0

I have multiple custom objects.  In our Sandbox, Policy is the Master Object to both Claim and Coverage.  Coverage (in some cases) can be considered to be like a master to Claim so I have written Apex Triggers to act as a rollupsummary of all claim records that have a lookup to a specific Coverage record.  This trigger works great when we are manually update the claim records.

 

We use another system in which we import a refresh of data on a daily basis through a CSV file using the data management tool in SalesForce.  This currently works great in our production environment but in Sandbox we are developing new Master-Detail Relationships and Apex Triggers which appear to be causing an issue with this daily import.

 

In our business, there are multiple Claims that can have the same Coverage referenced.  When the Claim refresh file is imported , I recieve an exception error on the trigger because the trigger is for AfterUpdate.  I believe this is happening because the refresh file is updating multiple claim records at once that reference the same coverage and the apex trigger is firing AfterUpdate for for a single Coverage record and doesn't know how to handle the multiple Claim records that are causing it to fire.  (I hope this makes sense.)

 

Is there anyway to refresh multiple records at once that reference the same record of another object in which an AfterUpdate apex trigger is fired?

 

Any help on this is greatly appreciated.

 

Thanks!

  • July 31, 2012
  • Like
  • 0

I have a situation where a child object (Claim__c) technically has multiple Master-Detail relationships.  Since SF does not support this, I needed to create an Apex Trigger to create a roll up summary for one of the 'parent' custom objects (Coverage__c) that is a lookup field (Claim_Coverage__c on object Claim__c).  Here is what I am trying to do:

 

On the Coverage__c custom object populate a field called Coverage_Total_Indemnity_PD__c with a calculation of the Indemnity_PD__c field on Claim__c.

 

This is new to me with Apex but I have made an attempt at the trigger (below) but keep getting the following error:

Error: Compile Error: Variable does not exist: ListCoverages at line 27 column 20

(I note in the code below the line with the error)


From what I understand, this variable does exist earlier in the trigger so I am not sure how to resolve.  Any help is resolving this error is greatly appreciated!  

 

 

trigger CoverageIndemnityPDTrigger On Claim__c(after insert, after update){
set<Id> setCoverageid=new set<Id>();
Map<string,Decimal> CoveragewithTotalIndemnityPD=new Map<string,Decimal>();
for(Claim__c acs:Trigger.New){
if(acs.Claim_Coverage__c!=null && acs.Indemnity_PD__c!=null){
setCoverageid.add(setCoverageid);
}
}

if(setCoverageid.size()>0){
List<Coverage__c> ListCoverages = [Select Id, Coverage_Total_Indemnity_PD__c from Coverage__c where Coverage__c =:setCoverageid];
List<Claim__c> ListCoverageClaims = [Select Id, Indemnity_PD__c from Claim__c where Coverage__c =:setCoverageid and Indemnity_PD__c!=null];
for(Id CoverageId:setCoverageid){
Decimal totCovIndPD=0;
for(Claim__c acs: ListCoverageClaims){
if(CoverageId=acs.Coverage_c){
totCovIndPD=totCovIndPD + acs.Indemnity_PD__c ;
}
}
CoveragewithTotalIndemnityPD.put(CoverageId,totCovIndPD);

}
}

List<Coverage__c> UpdateCoverage=new List<Coverage__c>();

 

****BELOW IS THE LINE THAT CONTAINS THE ERROR -- THE ERROR IS 'LISTCOVERAGES')*****

for(Coverage__c MC:ListCoverages){

 

MC.Coverage_Total_Indemnity_PD__c=CoveragewithTotalIndemnityPD.get(MC.id);
UpdateCoverage.add(MC);
}

if(UpdateCoverage.size()>0){
update UpdateCoverage;
}

}

  • April 30, 2012
  • Like
  • 0

I am trying to write a validation rule that says:

If Submitted_for_Approval__c is checked and the text field Name__c does not contain the characters 'TBD' then show the error.  Name__c can contain other characters but it it does not speficially have 'TBD' as part of those characters I want to show the error.

 

I am able to create a working validation rule that says the opposite:

If Submitted_for_Approval__c is checked and the text field Name__c contains the characters 'TBD' then show the error.

by using:

AND(Submitted_for_Approval = true, CONTAINS(Name, 'TBD'))

 

Is there an Operator for 'DOES NOT CONTAIN' or someway to express that?

 

Any help is greatly appreciated, thanks!!

 

 

  • April 25, 2012
  • Like
  • 0

I am adding a custom field to the AccountHierarchyTree and have been able to successfully add this field BUT it is showing the SalesForce ID rather than the text.  The field I am adding is a Lookup field to another account so the SalesForce ID of the account is displaying when I would like the Account Name to display.  I added the following to the component but assume there is either something I need to add or use instead of apex:outputText.  Any help is greatly appreciated!  Thanks!

 

 <apex:outputText style="{!IF(pos.currentNode,'font-weight: bold;','')}" value=", {!pos.account.Related_Program__c}" rendered="{!IF(pos.account.Related_Program__c != '', true, false)}"/>
  • February 27, 2012
  • Like
  • 0

I have a visualforce page that shows a related list and I was wondering if it was possible to add either a table row count at the bottom of a table or add row numbers?  I have tried a few different sets of code that I had found but nothing is working.   Any help would be great!  Thanks! Below is the e table:

 

<p><u>Related Claims</u></p>
<table id="claims" border="1" cellspacing="2" cellpadding="5">
<tr>
<th>Claim Number</th>
<th>Insured</th>
<th>Claimant Name</th>
<th>Policy Number</th>
<th>Claim Status</th>
<th>Date Reported</th>
<th>Examiner</th>
</tr>
<apex:repeat var="rc" value="{!Account.Claims__r}">
<tr>
<td>{!rc.Name} </td>
<td>{!rc.Insured_Lookup__r.name}</td>
<td>{!rc.Claimant_Name__c}</td>
<td>{!rc.Policy__r.name}</td>
<td>{!rc.Status__c}</td>
<td><apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rc.Date_Reported__c}"/></apex:outputText></td>
<td>{!rc.Assigned_Examiner2__r.name}</td>
</tr>
</apex:repeat>
</table>

  • November 18, 2011
  • Like
  • 0

I have looked through a number of board discussions and read through the related articles but cannot seem to get a solution to work so any help is really appreciated!  I have a VF that I have built that works great.  The only issue I have is that when it requires more than one page, it most often puts the page break in the middle of one of the tables.  Is there anyway to have a dynamic page break that is not driven by number of records?  I ask this because I want it as much on a single page as possible but there are two tables and I do not know how to do number of records when I am dependent on two different tables populating that will have a different number of records each time? 

 

Also, if possible to add page numbers that would be great but not as important as the dynamic page break.

 

Below is the code of the page I need this on.

 

Thanks!!

 

<apex:page renderas="PDF" standardController="Account" showHeader="false" sidebar="false">
<p><b><font size="4">{!Account.Name}</font></b></p>
<p><b><font size="2">Claim Check as of {!if(Month(Today())=1,"January","")}{!if(Month(Today())=2,"February","")}{!if(Month(Today())=3,"March","")}{!if(Month(Today())=4,"April","")}{!if(Month(Today())=5,"May","")}{!if(Month(Today())=6,"June","")}{!if(Month(Today())=7,"July","")}{!if(Month(Today())=8,"August","")}{!if(Month(Today())=9,"September","")}{!if(Month(Today())=10,"October","")}{!if(Month(Today())=11,"November","")}{!if(Month(Today())=12,"December","")} {!Day(Today())}, {!Year(Today())}
</font></b></p>
<p></p>
<p><b>RELATED POLICIES:</b></p>
<table border="1" cellspacing="2" cellpadding="5">
<tr>
<th>Policy Number</th>
<th>Policy Period</th>
<th>Underwriter</th>
<th>Underwriting Branch Office</th>
</tr>
<apex:repeat var="rp" value="{!Account.Policies5__r}">
<tr>
<td>{!rp.Name} </td>
<td><apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rp.Effective_Date__c}"/></apex:outputText> - <apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rp.Expiration_Date__c}"/></apex:outputText></td>
<td>{!rp.Underwriter__r.Name}</td>
<td>{!rp.Underwriting_Branch_Office__c}</td>
</tr>
</apex:repeat>
</table>
<p><b>RELATED CLAIMS:</b></p>
<table border="1" cellspacing="2" cellpadding="5">
<tr>
<th>Claim Number</th>
<th>Insured</th>
<th>Claimant Name</th>
<th>Policy Number</th>
<th>Claim Status</th>
<th>Date Reported</th>
<th>Examiner</th>
</tr>
<apex:repeat var="rc" value="{!Account.Claims__r}">
<tr>
<td>{!rc.Name} </td>
<td>{!rc.Insured_Lookup__r.name}</td>
<td>{!rc.Claimant_Name__c}</td>
<td>{!rc.Policy__r.name}</td>
<td>{!rc.Status__c}</td>
<td><apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rc.Date_Reported__c}"/></apex:outputText></td>
<td>{!rc.Owner.name}</td>
</tr>
</apex:repeat>
</table>
<p/>
<div class="bPageFooter" id="bodyFooter"><div class="footer">Privileged and Confidential - LVL Claims Services, LLC</div></div>
</apex:page>

  • November 16, 2011
  • Like
  • 0

I have a Visualforce page which I have two versions of but the only difference is that one renders as a PDF.  On this one, the date does not appear.  I use the same code for the page that does not render as a PDF and the date appears without issue.  Any help would be great!  Thanks!

 

<apex:page renderas="PDF" standardController="Policy__c" showHeader="false" sidebar="false">
<p><b><font size="4">{!Policy__c.Name} - {!Policy__c.Insured__r.Name}</font></b></p>
<p><b><font size="2">Claim Check as of <script>
 var mydate=new Date()
    var year=mydate.getYear()
   
    if (year < 1000)
        year+=1900
   
    var day=mydate.getDay()
    var month=mydate.getMonth()+1
   
    if (month<10)
        month="0"+month
   
    var daym=mydate.getDate()
    if (daym<10)
        daym="0"+daym
   
    document.write(month+"/"+daym+"/"+year)
</script></font></b></p>
<p></p>
<table border="1" cellspacing="2" cellpadding="10">
<tr>
<th>Claim Number</th>
<th>Insured</th>
<th>Claimant Name</th>
<th>Policy Number</th>
<th>Claim Status</th>
<th>Date Reported</th>
<th>Examiner</th>
</tr>
<apex:repeat var="rc" value="{!Policy__c.Claims1__r}">
<tr>
<td>{!rc.Name} </td>
<td>{!rc.Insured_Lookup__r.name}</td>
<td>{!rc.Claimant_Name__c}</td>
<td>{!rc.Policy__r.name}</td>
<td>{!rc.Status__c}</td>
<td><apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rc.Date_Reported__c}"/></apex:outputText></td>
<td>{!rc.Assigned_Examiner2__r.Name}</td>
</tr>
</apex:repeat>
</table>
<p/>
<div class="bPageFooter" id="bodyFooter"><div class="footer">Privileged and Confidential - LVL Claims Services, LLC</div></div>
</apex:page>

  • November 11, 2011
  • Like
  • 0

I am very new to Visualforce Pages so I apologize in advance for such a broad question.  .  I am looking to create a new Button/Link that will open a Visualforce page that simply displays the fields and responses on a simply layout for a user to print (basically the 'Printable View' but with no logos or references to SalesForce.  I also don't want it to show any of the headers, sidebars, etc. of SalesForce.  I just want it to show the fields and responses as they appear on screen.  Very simple, very plain.   I tried copying the Source Code of the Printable View link to get me started but I had two issues:

 

1. Once I added the standardcontroller of my Custom Object in order to get the page to appear as an available option for a custom button, it added in all of the header, side bars, etc.of SalesForce. 

2.  I also realized that it was simply showing the text of the responses rather than directing the page to pull that records responses.  I tried replacing the text that appears in the code with references to the object field but I keep getting errors.

 

Any advice or an example of how I can accomplish this would be greatly appreciated!  Thank you!

  • November 10, 2011
  • Like
  • 0

I have a Visualforce email template and it seems that thSalesForce ID of an Account is appearing rather than the name of the Account Name. 

 

The field I am referencing is a Lookup field on the custom object Policy to an Account.  I am having the same issue with a Lookup field on this custom object to a Contact.  The code I am using for these fields is:

 

Insured: {!relatedTo.Insured__c}

Underwriter: {!relatedTo.Underwriter__c}

 

I am also pulling in two date fields but rather than showing that appears on the screen (e.g. 4/1/2010) it is showing Thu Apr 01 00:00:00 GMT 2010 .  How can I get it to just show MM/DD/YYYY.  The code I am using for these fields is:

 

Effective Date: {!relatedTo.Effective_Date__c}
Expiration Date: {!relatedTo.Expiration_Date__c}

 

Any help is greatly appreciated!  Thanks

  • November 09, 2011
  • Like
  • 0

I am new to Visualforce Email Templates so any help is greatly appreciated!  Thanks!

 

I have an email template that I want to fire off of a custom object (Policy__c) but I want to pull in the Related List that appears on the Policy object - the Related List is called Claims.  Below is the code I have but the error I keep getting is:

 

Error: Invalid field Claims__r for SObject Policy__c

 

<messaging:emailTemplate subject="90 Day Policy Expiration: {!relatedTo.name}" recipientType="Contact" relatedToType="Policy__c">
<messaging:plainTextEmailBody >
The following policy has an Expiration Date that is within 90 days from today.

Details:
Policy: {!relatedTo.Name}
Insured: {!relatedTo.Insured__c}
Effective Date: {!relatedTo.Effective_Date__c}
Expiration Date: {!relatedTo.Expiration_Date__c}
Underwriter: {!relatedTo.Underwriter__c}
Underwriting Branch Office: {!relatedTo.Underwriting_Branch_Office__c}

RELATED CLAIMS:
<apex:repeat value="{!relatedTo.Claims__r}">
</apex:repeat>

</messaging:plainTextEmailBody>
</messaging:emailTemplate>

  • November 09, 2011
  • Like
  • 0