• BKW
  • NEWBIE
  • 0 Points
  • Member since 2012

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

I am working on some code in Dev Console (part of a larger trigger). Basically I am trying to pull the OwnerID of a record on a custom object. Then run a new list to pull the name of the owner from the user records based on the result from the initial query. 

The last row is giving me the Intial Term of field expression must be concrete SObject:List. error. The Field OwnerID is pulled with the list.  Any thoughts as to why I am getting this error?  If I comment out the last line it executes fine including pulling the ownerID.

 

 
String  ClientID;
 
 List<Client__c> Cl = new List<Client__c>();
List<User> U = new List<User>();
     
ClientID = '112465';
Cl = [Select ID, Name, OwnerID from Client__c Where Name = :CLientID];
U = [Select ID, Name from User Where ID = :Cl.OwnerID];

  • October 16, 2012
  • Like
  • 0

I am looking for some advice. 

I have a team that would like to be notified (or have a case reassigned) if their agents has closed a case and a new email was sent to the case. Specifically if the email is left as new for longer then 4 hours they would like a  notification or reassignment. 

 

I tried using a workflow rule on the email message, but since reading or replying to an email counts as a soft save it doesn't reevluate the workflow. I talked to support and they suggested that I code something in to force to the email message workflow to reevaluate. But since I don't have access to a email message object I am not sure where I would code that. 

 

Anyone have any thoughts as to how I can achieve my teams request? 

  • September 27, 2012
  • Like
  • 0

Does anyone know if there is a way to write an and/or rule to check for multiple values on a multi select picklist in a case workflow?

  • June 20, 2012
  • Like
  • 0

Hello,

I am new to working with Apex and I have what I suspect is in an easy question. I have a trigger that I have written to create a record on a custom object on Insert or Update of case with a specific topic. The issue I am having (as you would guess) is that it creating a new record everytime the case is updated.  I only want it to fire on update if the record is being saved with the "Price" topic when it wasn't previously. Anyone have a good idea for that?  I think I am close if I could get that answer.

 

 trigger CreatePriceRequestFromCase on Case (after Insert, after update){List<Request__c> Req =
new List<request__c>();
 
   String  RequestTypeId = Functions.getRecordTypeId( 'Price', 'Request__c' );

 if (trigger.isInsert){
       for (Case newCase: Trigger.New) {        
         if (newCase.Sub_Topic__c == 'Price){
                                    {Req.add(new Request__c(     
                 RecordTypeId = RequestTypeId,
                 Price__c = newCase.Price__c,
                 Case_Number__c = newCase.CaseNumber,
                 Status__c = 'New'));
                         insert Req;}
               

                  }
         }
         }else if (trigger.isUpdate){
                   for (Case newCase2: Trigger.New) {        
                   if (newCase2.Sub_Topic__c == 'Price){
                       {Req.add(new Request__c(     
                         RecordTypeId = RequestTypeId,
                         Price__c = newCase2.Price__c,
                         Case_Number__c = newCase2.CaseNumber,
                         Status__c = 'New'));
                                            
                            insert Req;}
                  }
                }
                }
               
                }

  • April 25, 2012
  • Like
  • 0

I am working on some code in Dev Console (part of a larger trigger). Basically I am trying to pull the OwnerID of a record on a custom object. Then run a new list to pull the name of the owner from the user records based on the result from the initial query. 

The last row is giving me the Intial Term of field expression must be concrete SObject:List. error. The Field OwnerID is pulled with the list.  Any thoughts as to why I am getting this error?  If I comment out the last line it executes fine including pulling the ownerID.

 

 
String  ClientID;
 
 List<Client__c> Cl = new List<Client__c>();
List<User> U = new List<User>();
     
ClientID = '112465';
Cl = [Select ID, Name, OwnerID from Client__c Where Name = :CLientID];
U = [Select ID, Name from User Where ID = :Cl.OwnerID];

  • October 16, 2012
  • Like
  • 0

Hello,

I am new to working with Apex and I have what I suspect is in an easy question. I have a trigger that I have written to create a record on a custom object on Insert or Update of case with a specific topic. The issue I am having (as you would guess) is that it creating a new record everytime the case is updated.  I only want it to fire on update if the record is being saved with the "Price" topic when it wasn't previously. Anyone have a good idea for that?  I think I am close if I could get that answer.

 

 trigger CreatePriceRequestFromCase on Case (after Insert, after update){List<Request__c> Req =
new List<request__c>();
 
   String  RequestTypeId = Functions.getRecordTypeId( 'Price', 'Request__c' );

 if (trigger.isInsert){
       for (Case newCase: Trigger.New) {        
         if (newCase.Sub_Topic__c == 'Price){
                                    {Req.add(new Request__c(     
                 RecordTypeId = RequestTypeId,
                 Price__c = newCase.Price__c,
                 Case_Number__c = newCase.CaseNumber,
                 Status__c = 'New'));
                         insert Req;}
               

                  }
         }
         }else if (trigger.isUpdate){
                   for (Case newCase2: Trigger.New) {        
                   if (newCase2.Sub_Topic__c == 'Price){
                       {Req.add(new Request__c(     
                         RecordTypeId = RequestTypeId,
                         Price__c = newCase2.Price__c,
                         Case_Number__c = newCase2.CaseNumber,
                         Status__c = 'New'));
                                            
                            insert Req;}
                  }
                }
                }
               
                }

  • April 25, 2012
  • Like
  • 0