• (e)
  • NEWBIE
  • 25 Points
  • Member since 2011

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

I'm using a wrapper class on the Case object so that users can select multiple users to "tie" them to a case.  Upon selection, these additional users are inserted into the Case_Associate__c object, which is a detail to the Case.  

 

Here is a link to the full code: http://boards.developerforce.com/t5/Apex-Code-Development/Test-Method-to-cover-Wrapper-Class-only-covering-79/m-p/364981

 

How can I check to see if a record has already been created in the Case_Assoicate object in my Apex class, before inserting, to avoid duplicate Case Associate records that include the same case ID and user ID?  Below is the code snippet I need to expand on:

 

Thanks for any help!

 

public PageReference processSelected() {

 

//We create a new list of Users that we be populated only with Users if they are selected


List<User> selectedUsers = new List<User>();
List<Case_Associate__c> caseAss = new List<Case_Associate__c>();  //here is where I list out the records to set it up to check for dupes before inserting

 

//We will cycle through our list of cUsers and will check to see if the selected property is set to true, if it is we add the User to the selectedUsers list


for(cUser cUse: getUsers()) { 
if(cUse.selected == true && User.Id != Case_Associate__c.User.Id) {  // check for duplicates on the Case Associate object before adding the Users to the selectedUsers list
selectedUsers.add(cUse.use);
}
}

I have a formula field of date return type on custom object. which is rightly calculated and can be seen on the page layout. But when I try to display this field on Visual force page either using outputfield or outputtext tags, the date don't show up on the VF page.

 

Can you guys please give some insight on this? 

 

Here is the tag  I am using on the VF Page

 

<apex:outputText  value="{!BigMachines_Quote__c.Expiration_Date__c}"/>

 

and formula field is

 

Expiration_Date__c = DATEVALUE( Quote_Expiration_Date__c )  //Quote_Expiration_Date__c  is a text field

 

Can you tell me what I am doing wrong? Or am I missing something here? 

 

Thanks in Advance

I'm using a wrapper class on the Case object so that users can select multiple users to "tie" them to a case.  Upon selection, these additional users are inserted into the Case_Associate__c object, which is a detail to the Case.  

 

Here is a link to the full code: http://boards.developerforce.com/t5/Apex-Code-Development/Test-Method-to-cover-Wrapper-Class-only-covering-79/m-p/364981

 

How can I check to see if a record has already been created in the Case_Assoicate object in my Apex class, before inserting, to avoid duplicate Case Associate records that include the same case ID and user ID?  Below is the code snippet I need to expand on:

 

Thanks for any help!

 

public PageReference processSelected() {

 

//We create a new list of Users that we be populated only with Users if they are selected


List<User> selectedUsers = new List<User>();
List<Case_Associate__c> caseAss = new List<Case_Associate__c>();  //here is where I list out the records to set it up to check for dupes before inserting

 

//We will cycle through our list of cUsers and will check to see if the selected property is set to true, if it is we add the User to the selectedUsers list


for(cUser cUse: getUsers()) { 
if(cUse.selected == true && User.Id != Case_Associate__c.User.Id) {  // check for duplicates on the Case Associate object before adding the Users to the selectedUsers list
selectedUsers.add(cUse.use);
}
}

Is there any wildcard or way to setup so it doesn't do an exact match.

 

I want to do a redirect anytime it hits a relative url like /detail/foo ... however if it has a querystring it ignores it  so this does nothing 

/detail/foo?id=xxxxxxxxxxxxxxxx

 

Tried a variety of different formats but no luck.  Not sure it is possible.

 

Thanks

  • September 14, 2011
  • Like
  • 0