• Kemi
  • NEWBIE
  • 60 Points
  • Member since 2013
  • Principal Success Specialist
  • Salesforce

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

Hi,

 

I have created a Visualforce Page and within a page block section, I have 2 columns with different fields in each column. Everything works fine!

 

Is there a way to separate the columns like have a separation line in between the columns. Can someone suggest an approach that I can use to fix this issue?

 

Thanks!

As a followup to my previous posts (Again, many many thanks) I am still having trouble with the trigger.

The code seems to function and I created a test class and the code itself is 100% covered.

The Trigger will not work, I am getting 0% coverage and I am not sure what I am doing wrong.

Trigger:

trigger FirmwareTrigger on Customer_Asset__c (before update, after update) {        
     FirmwareClass helper = new FirmwareClass();        
       helper.createCases(Trigger.new);        
} 

Test Class

@isTest
private class FirmwareClassTest {
   private static testMethod void testCreateCases() {
    //create a new instance of a Customer_Asset__c to use in the test
    List<Customer_Asset__c> testAssets = new List<Customer_Asset__c> {};
    Customer_Asset__c ta = new Customer_Asset__C();
    ta.Firmware_Update_Available__c = True;
    testAssets.add(ta);

    FirmwareClass helper = new FirmwareClass();
    Test.startTest();
    helper.createCases(testAssets);
    Test.stopTest();

    // query for cases to see if some were created and do an assertion
}
Customer_Asset__c[] acctQuery = [SELECT Firmware_Update_Available__c FROM Customer_Asset__c];

Class

public with sharing class FirmwareClass{

   public void createCases(List<Customer_Asset__c> assets){
    List<Case> casesToCreate = new List<Case>();

   for(Customer_Asset__c acc:assets){
      if (acc.Firmware_Update_Available__c == TRUE){
      Case caseToAdd = new Case();
      caseToAdd.AccountId = acc.Account__c;
      caseToAdd.Subject = 'Software Upgrade Available';
      casesToCreate.add(caseToAdd);
   }       
 } 
  if (casesToCreate.size() > 0)
  insert casesToCreate;
   }

   }

I tried to get fancy and added (what I hoped / thought) would be some sort of validation within the trigger.

Updated Trigger

trigger FirmwareTrigger on Customer_Asset__c (before update) {

 List<FirmwareUpdate> listfirm = new list<FirmwareUpdate>();
      for (Customer_Asset__c ta: trigger.new)
 {
  FirmwareUpdate firmup = [SELECT Firmware_Update_Available__c FROM Customer_Asset__c];
if (firmup == 1)
{
       FirmwareClass helper = new FirmwareClass();
       for (Customer_Asset__c az: Trigger.new);
        helper.createCases(Trigger.new);
      }
}
}

I receive a compile error with the New Trigger:

Error: Compile Error: Invalid type: FirmwareUpdate at line 3 column 47

The old trigger compiles but is showing a 0 code coverage.   At this point I am stuck.  I believe my class works, but I can't get past this point.

is there any way to display VF page on home components directly without clicking Custom link. ?

 

My requirement :-

Community user will login and he will see cases and tasks assigned to him.

 

Please suggest.

Hi,

 

I have activated Salesforce Communities for my org, but I need to use my own custom login page and not the default one. We have an option to override the Login Page in Normal Sites but I cannot see the same in the site created for community (Force.com community).

 

Please help

 

 

Greetings. I am rather good with SF tool on the front end and very very new to Apex code. I was unable to build a workflow that would update the field "Stage picklist" in an opportunity record based on a date field. As you all know, workflows do not interface with picklist fields. I am in need of some trigger code to fix this.

 

The Apex trigger code would allow a particular close dates expiration to trigger  a change in picklist status. So, for example, on 5/31/13, the picklist field denotes: "Current Student" but on 6/2/2013 (once the close date is passed), I would like to build a trigger that changes the field "Stage"  from "Current Student" to "Alumnus". I have been doing all sorts of training on Apex code and can get around in the console okay but I don't feel confident in trying to build the code that would acheive this functionality. 

Any help appreciated.

Thanks!
Micael

Hi,

 

I have created a Visualforce Page and within a page block section, I have 2 columns with different fields in each column. Everything works fine!

 

Is there a way to separate the columns like have a separation line in between the columns. Can someone suggest an approach that I can use to fix this issue?

 

Thanks!

As a followup to my previous posts (Again, many many thanks) I am still having trouble with the trigger.

The code seems to function and I created a test class and the code itself is 100% covered.

The Trigger will not work, I am getting 0% coverage and I am not sure what I am doing wrong.

Trigger:

trigger FirmwareTrigger on Customer_Asset__c (before update, after update) {        
     FirmwareClass helper = new FirmwareClass();        
       helper.createCases(Trigger.new);        
} 

Test Class

@isTest
private class FirmwareClassTest {
   private static testMethod void testCreateCases() {
    //create a new instance of a Customer_Asset__c to use in the test
    List<Customer_Asset__c> testAssets = new List<Customer_Asset__c> {};
    Customer_Asset__c ta = new Customer_Asset__C();
    ta.Firmware_Update_Available__c = True;
    testAssets.add(ta);

    FirmwareClass helper = new FirmwareClass();
    Test.startTest();
    helper.createCases(testAssets);
    Test.stopTest();

    // query for cases to see if some were created and do an assertion
}
Customer_Asset__c[] acctQuery = [SELECT Firmware_Update_Available__c FROM Customer_Asset__c];

Class

public with sharing class FirmwareClass{

   public void createCases(List<Customer_Asset__c> assets){
    List<Case> casesToCreate = new List<Case>();

   for(Customer_Asset__c acc:assets){
      if (acc.Firmware_Update_Available__c == TRUE){
      Case caseToAdd = new Case();
      caseToAdd.AccountId = acc.Account__c;
      caseToAdd.Subject = 'Software Upgrade Available';
      casesToCreate.add(caseToAdd);
   }       
 } 
  if (casesToCreate.size() > 0)
  insert casesToCreate;
   }

   }

I tried to get fancy and added (what I hoped / thought) would be some sort of validation within the trigger.

Updated Trigger

trigger FirmwareTrigger on Customer_Asset__c (before update) {

 List<FirmwareUpdate> listfirm = new list<FirmwareUpdate>();
      for (Customer_Asset__c ta: trigger.new)
 {
  FirmwareUpdate firmup = [SELECT Firmware_Update_Available__c FROM Customer_Asset__c];
if (firmup == 1)
{
       FirmwareClass helper = new FirmwareClass();
       for (Customer_Asset__c az: Trigger.new);
        helper.createCases(Trigger.new);
      }
}
}

I receive a compile error with the New Trigger:

Error: Compile Error: Invalid type: FirmwareUpdate at line 3 column 47

The old trigger compiles but is showing a 0 code coverage.   At this point I am stuck.  I believe my class works, but I can't get past this point.