• dtraveller
  • NEWBIE
  • 25 Points
  • Member since 2009

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

Hello.  I have a custom component on my VF page and I am passing a List element to it as a component attribute.  This list object might have no elements, and this null condition is causing "list is empty" VF error.

 

How can I detect that the object is empty and avoid invoking the component?  I can't find clear documentation on the <c:> component tag.

 

I'm able to use outputPanel with rendered= to avoid the error, but I'm wondering if there's a more direct way to deal with the issue.

 

Thanks

David

Hello.  Does lead conversion skip the CampaignMember AfterUpdate trigger if a lead is a campaign member?  The new contact is populating the campaignmember record so it should fire the trigger, but it does not.  I have tested in a clean dev instance using a basic trigger and a unit test, and my afterupdate trigger doesn't fire when I run the unit test.
Hello.  In developer console, I've set a checkpoint and then I run a unit test. When I view the checkpoint result for an sObject in the Symbols tab, some of the values are mixed up among the fields. For example, a date field shows a "false" value, while an Id field shows a datetime, etc.

Has anyone seen this before? This happens in Chrome on both Mac and Windows.
Hello.  Does lead conversion skip the CampaignMember AfterUpdate trigger if a lead is a campaign member?  The new contact is populating the campaignmember record so it should fire the trigger, but it does not.  I have tested in a clean dev instance using a basic trigger and a unit test, and my afterupdate trigger doesn't fire when I run the unit test.
Hello.  In unit tests, is there a specific way of creating completed tasks so that they appear immediately in the ActivityHistory read-only object?   See code snippet below.  When I run the unit test, the activity history is empty.  However, when I create completed tasks manually in the UI, the ActivityHistory is populated.

Account acct = new Account(Name = 'Apex Test');
insert acct;

Task tsk1 = new Task(WhatId = acct.Id, Subject = 'Email: apex test', ActivityDate = date.today(), Status = 'Completed');
Task tsk2 = new Task(WhatId = acct.Id, Subject = 'Call: apex test', ActivityDate = date.today(), Status = 'Completed');
Task tsk3 = new Task(WhatId = acct.Id, Subject = 'Email: apex test', ActivityDate = date.today().addYears(-2), Status = 'Completed');
Task[] tskList = new List<Task>{ tsk1, tsk2, tsk3 };
insert tskList;

Account result = [select Id (SELECT ActivityDate, Subject FROM ActivityHistories) from Account where Id = :acct.Id];

Hello.  I have a custom component on my VF page and I am passing a List element to it as a component attribute.  This list object might have no elements, and this null condition is causing "list is empty" VF error.

 

How can I detect that the object is empty and avoid invoking the component?  I can't find clear documentation on the <c:> component tag.

 

I'm able to use outputPanel with rendered= to avoid the error, but I'm wondering if there's a more direct way to deal with the issue.

 

Thanks

David

I need help with the test method of this trigger, can someone please help me with the code, the trigger works but do not know how to create the test methods to deploy it to production:

Thank you!

 

The trigger is:

 

trigger CopyAttachments on MileStone__c(after insert)

{

Attachment[] attList = [select id, name, body from Attachment where ParentId = :Trigger.new[0].Opportunity__c];

Attachment[] insertAttList = new Attachment[]{};

 

         for(Attachment a: attList)

         {

               Attachment att = new Attachment(name = a.name, body = a.body, parentid = Trigger.new[0].id);

               insertAttList.add(att);

         }

       if(insertAttList.size() > 0)

       {

            insert insertAttList;

       }

 

Good morning,

 

Trying to create a validation rule pulling from the Case object as well as two custom objects (Agency Input Task and Collaboration Task)

 

(ispickval (Status, "Resolved")  || ispickval(status, "Closed")  || ispickval (status, "Denied")) &&  ($ObjectType.Agency_Input_Task__c.Fields.Completed__c  =  false) ||  ($ObjectType.Collaboration_Task__c.Fields.Completed__c = false)

 

so basically if either an Agency Input Task or Collaboration Task is not complete (marked by a checkbox)(boolean) then the Case cannot be resolved/closed/denied. 

 

But the fields from the custom objects seem to be returning an error:

Incorrect parameter for operator '='.  Expected Object, received Boolean

 

does anyone know how to correct this?

 

thanks

Hi,

 

I have created a trigger on case comments that update a field on the parent case. It works very nicely. But when I want to select only cases that are created by SSP Users I have run into problems.

 

I tried getUserType() in the rem:ed line below (I also check for case status there) but it doesn't act differently so I assum both internal and external SSP users are of type 'Standard''
 

 

trigger IsNewCaseComment on CaseComment (after insert) {
Map<Id,CaseComment> cMap = new Map<Id,CaseComment>();
  for (CaseComment t: Trigger.new){
  cMap.put(t.ParentId,t);
}
  List<Case> CasesToUpdate = new List<Case>();
  Set<Id> idSet = cMap.keySet();
  for(Case c:[select Id,CreatedById,Status,IsNewCaseComment__c from Case where Id in :idSet]) {
     {
	//if (C.Status !='Waiting for Documentation' &&  UserInfo.getUserType()!='Standard'){
	c.IsNewCaseComment__c=true;
	CasesToUpdate.add(c);
	//}
}
}
  update CasesToUpdate;
}

 

Any idea on how to proceed?

I can do single table Selects, but I need to do a Select from Case and CaseStatus where CaseStatus ISClosed = False.

 

Would you give me tip on how to do that please?

 

Thank you