• Scott.Eng
  • NEWBIE
  • 0 Points
  • Member since 2015
  • Glenmede

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies
Hello, I'm using the jQuery Datatables plugin.  I've implemented individual column searching/filtering using this example:
https://datatables.net/examples/api/multi_filter.html

Normally, the columns are intelligently sized based on the data in the column.  However, I've noticed that when the column searching is implemented, the column width auto-sizing stops working. Instead, each column has the same width (e.g. if there are 5 columns, each is then 20%).

Has anyone encountered this, and know of a way to get the "intelligent" column auto-sizing to work with the .search()?
Hello,

In the Admin Advanced --> Advanced Formulas --> Using Picklists in Formulas module, the challenge requirment is as follows:

"Create a validation rule formula that does not allow a user to mark a case as escalated unless the priority is set to 'High', the case was not Closed when Created, and the case isn’t closed."

I am setting up a valid formula (did a bunch of tests on Case object so I'm sure it is valid and I'm not going to post it here to let this remain as a challenge). I am using four fields, which are IsClosed, IsClosedOnCreate, Priority and Status, as understood from the challenge description.

However, checking the challenge gives me this error. Apparently, despite the description, we gotta use IsEscalated field instead of IsClosed:
User-added image

After I change IsClosed field with IsEscalated in the formula, I get this error:
User-added image

I am reproducing this scenario in a Case record and validation rule triggers.

Did anyone manage to pass this challenge? If not, could the Trailhead Dev Team have a look at wording of this challenge please? 

Thanks in advance.



 
Hi
I have below code
<apex:outputLabel value="{!$ObjectType.ABC.fields.field.label}"
                                      rendered="{IF(!cloned.field == 'some value'),true,false)}">
So I want block section to disappear if the If condition is false and appear when IF condition is true. cloned.field is being read form the controller and it does populate the value in other areas of the VF page but looks like in the IF condition the values is not coming and the IF condition always evaluates to false and block section is never displayed. I am expecting the VF page to read the value from the controller. Any hint of what I am missing here would be appreciated

Thanks
  • April 03, 2015
  • Like
  • 0
Hello Everyone,

I am reallly struck to get the Test coverage for the batch calls,Can you please help me out
/*
 Purpose: Creates an Adjustment Record Based on Techonlogy
Will Update the logic here
 
 */
global class AdjustmentFeeBatch implements Database.Batchable<sObject> 
 {
       global Database.QueryLocator start(Database.BatchableContext BC) {
       String query = 'Select Id,Name,Contact__c,End_Date__c,Name__c,Fee_frequency__c,Package__c,Start_Date__c,Waive_End_Date__c,Fee_Amount__c,Waive_Start_Date__c,Status__c,Waive_Amount__c from Technology__C';
       system.debug('query=====>>>>>>>>>>>>>>>>'+query); 
       return Database.getQueryLocator(query);
       
    }
  global void execute(Database.BatchableContext BC, List<Technology__C> scope) {
         List<Adjustment_Fees__c> AdjustmentFeeInsert= new List<Adjustment_Fees__c>();
     for(Technology__C Technology : scope)
      {
      //if(Technology.Id=='a0YK00000021I5b')
         //{  
              Datetime todayDate =date.today();
              system.debug('todayDate====>>>>'+todayDate);
              Datetime StartDate=Technology.Start_Date__c;
              Datetime EndDates=Technology.End_Date__c;
              Datetime WaivesEndDates=Technology.Waive_End_Date__c;
              Datetime WaiveStartDates=Technology.Waive_Start_Date__c;
              system.debug('WaiveStartDateValue==========>>>>>>>>>'+WaiveStartDates);
              Integer CurrentDay=todayDate.dayGmt();
              Integer currentMonth = Date.Today().Month();
              Integer startDay;
              Integer startDays;
          // set Start Date
          if(WaiveStartDates!=null){
               Date WaiveStdate=WaiveStartDates.dateGmt();
               startDay=WaiveStdate.day();
             }else{
              Date vStartDate=StartDate.dateGmt();
              startDays=vStartDate.day();
            }
          system.debug('startDayoutside===========>>>>>>'+startDay);
          //PACKAGE IS ACTIVE WITH OUT END DATE
         if(EndDates==null) //ITS CHECKS WHETEHR THE PACKAGE IS ACTIVE and havine waive date 
          {
              
             if(WaivesEndDates!=null || WaiveStartDates!=null)
              {  
                  //Integer WaiveEndMonth=WaivesEndDates.month();
                  system.debug('WaivesEndDates---->'+WaivesEndDates);
                  system.debug(WaivesEndDates+'ASHOK'+todayDate);
                  if(WaivesEndDates==null || WaivesEndDates>=todayDate)
                   {
                       system.debug('Technology------------3>>>>>>>>>>>>>> I am here ');
                       system.debug('Technology------------4>>>>>>>>>>>>>>'+Technology.Id);
                       system.debug('CurrentDay----5>>>>>>>>>>>>>>>'+CurrentDay+'>>>>>>>>>>'+startDay);
                      if(CurrentDay==startDay)
                      {
                          Adjustment_Fees__c Adjustment = new Adjustment_Fees__c();
                          Adjustment.Technologies__c=Technology.Id;
                          Adjustment.Contact__c=Technology.Contact__c;
                          Adjustment.Adjustment_Type__c='Technology Fee';
                          Adjustment.Frequency__c=Technology.Fee_frequency__c;
                          Adjustment.Adjustment_Description__c=Technology.Name__c +'--'+Technology.Package__c;
                          Adjustment.Start_date__c=Technology.Start_Date__c;
                          Adjustment.Waive_Start_Date__c=Technology.Waive_Start_Date__c;
                          Adjustment.Waive_End_Date__c=Technology.Waive_End_Date__c;
                          Adjustment.Amount__c=Technology.Waive_Amount__c;
                          AdjustmentFeeInsert.add(Adjustment);
                      }
                  
                  }else{
                            system.debug('FeeAmount===========>>>>>>'+Technology.Fee_Amount__c);
                            Date vStartDate=StartDate.dateGmt();
                            startDay=vStartDate.day();
                            system.debug(endDates+'JPMOR===========>>>>>>>>>>>>>>>>'+todayDate);
                           if(CurrentDay==startDay)
                          {
                              system.debug('Technology------------2>>>>>>>>>>>>>> I am here ');
                              Adjustment_Fees__c Adjustment = new Adjustment_Fees__c();
                              Adjustment.Technologies__c=Technology.Id;
                              Adjustment.Contact__c=Technology.Contact__c;
                              Adjustment.Adjustment_Type__c='Technology Fee';
                              Adjustment.Frequency__c=Technology.Fee_frequency__c;
                              Adjustment.Adjustment_Description__c=Technology.Name__c +'--'+Technology.Package__c;
                              Adjustment.Start_date__c=Technology.Start_Date__c;
                              Adjustment.Waive_Start_Date__c=Technology.Waive_Start_Date__c;
                              Adjustment.Waive_End_Date__c=Technology.Waive_End_Date__c;
                              Adjustment.Amount__c=Technology.Fee_Amount__c;
                              AdjustmentFeeInsert.add(Adjustment);
                        }
                   }
              }else 
                  {   
                      Date vStartDate=StartDate.dateGmt();
                        startDay=vStartDate.day();
                      startDay=StartDate.dayGmt();
                      if(startDay==CurrentDay)
                      {
                          system.debug('Technology------------1>>>>>>>>>>>>>> I am here ');
                          Adjustment_Fees__c Adjustment = new Adjustment_Fees__c();
                          Adjustment.Technologies__c=Technology.Id;
                          Adjustment.Contact__c=Technology.Contact__c;
                          Adjustment.Adjustment_Type__c='Technology Fee';
                          Adjustment.Frequency__c=Technology.Fee_frequency__c;
                          Adjustment.Adjustment_Description__c=Technology.Name__c +'--'+Technology.Package__c;
                          Adjustment.Start_date__c=Technology.Start_Date__c;
                          Adjustment.Waive_Start_Date__c=Technology.Waive_Start_Date__c;
                          Adjustment.Waive_End_Date__c=Technology.Waive_End_Date__c;
                          Adjustment.Amount__c=Technology.Fee_Amount__c;//Added Here
                          AdjustmentFeeInsert.add(Adjustment);
                      }
                  }
           }else {  //IF  BOTH END DATE IS NOT BLANK
             if(WaivesEndDates!=null || WaiveStartDates!=null)
              {
                  //Integer WaiveEndMonth=WaivesEndDates.month();
                 if(WaivesEndDates==null || WaivesEndDates>=todayDate)
                   {
                      if(CurrentDay==startDay)
                      {
                              system.debug('Technology------------>>>>>>>>>>>>>> I am here ');
                              Adjustment_Fees__c Adjustment = new Adjustment_Fees__c();
                              Adjustment.Technologies__c=Technology.Id;
                              Adjustment.Contact__c=Technology.Contact__c;
                              Adjustment.Adjustment_Type__c='Technology Fee';
                              Adjustment.Frequency__c=Technology.Fee_frequency__c;
                              Adjustment.Adjustment_Description__c=Technology.Name__c +'--'+Technology.Package__c;
                              Adjustment.Start_date__c=Technology.Start_Date__c;
                              Adjustment.Waive_Start_Date__c=Technology.Waive_Start_Date__c;
                              Adjustment.Waive_End_Date__c=Technology.Waive_End_Date__c;
                              Adjustment.Amount__c=Technology.Waive_Amount__c;
                              AdjustmentFeeInsert.add(Adjustment);
                      }
                   }else{
                       system.debug(endDates+'JPMOR===========121>>>>>>>>>>>>>>>>'+todayDate);
                      if(endDates>=todayDate)
                      {
                        if(CurrentDay==startDay)
                          {
                              system.debug('Technology------------121>>>>>>>>>>>>>> I am here ');
                              Adjustment_Fees__c Adjustment = new Adjustment_Fees__c();
                              Adjustment.Technologies__c=Technology.Id;
                              Adjustment.Contact__c=Technology.Contact__c;
                              Adjustment.Adjustment_Type__c='Technology Fee';
                              Adjustment.Frequency__c=Technology.Fee_frequency__c;
                              Adjustment.Adjustment_Description__c=Technology.Name__c +'--'+Technology.Package__c;
                              Adjustment.Start_date__c=Technology.Start_Date__c;
                              Adjustment.Waive_Start_Date__c=Technology.Waive_Start_Date__c;
                              Adjustment.Waive_End_Date__c=Technology.Waive_End_Date__c;
                              Adjustment.Amount__c=Technology.Waive_Amount__c;
                              AdjustmentFeeInsert.add(Adjustment);
                        }
                      }
                   }
              }else 
                  {
                      if(endDates>=todayDate)
                      {
                      if(startDay==CurrentDay)
                       {
                              system.debug('Technology------------>>>>>>>>>>>>>> I am here ');
                              Adjustment_Fees__c Adjustment = new Adjustment_Fees__c();
                              Adjustment.Technologies__c=Technology.Id;
                              Adjustment.Contact__c=Technology.Contact__c;
                              Adjustment.Adjustment_Type__c='Technology Fee';
                              Adjustment.Frequency__c=Technology.Fee_frequency__c;
                              Adjustment.Adjustment_Description__c=Technology.Name__c +''+Technology.Package__c;
                              Adjustment.Start_date__c=Technology.Start_Date__c;
                              Adjustment.Waive_Start_Date__c=Technology.Waive_Start_Date__c;
                              Adjustment.Waive_End_Date__c=Technology.Waive_End_Date__c;
                              Adjustment.Amount__c=Technology.Fee_Amount__c;//Added Here on 03/18
                              AdjustmentFeeInsert.add(Adjustment);
                        }
                      }
                  //}
          }
             //CODED HERE FOR 
             /*
             if(WaivesEndDates==null)
             {
                if(startDay==CurrentDay)
                       {
                          system.debug('Technology------------>>>>>>>>>>>>>> I am here ');
                          Adjustment_Fees__c Adjustment = new Adjustment_Fees__c();
                          Adjustment.Technologies__c=Technology.Id;
                          Adjustment.Contact__c=Technology.Contact__c;
                          Adjustment.Adjustment_Type__c='Technology Fee';
                          Adjustment.Frequency__c=Technology.Fee_frequency__c;
                          Adjustment.Adjustment_Description__c=Technology.Name__c +''+Technology.Package__c;
                          Adjustment.Start_date__c=Technology.Start_Date__c;
                          Adjustment.Waive_Start_Date__c=Technology.Waive_Start_Date__c;
                          Adjustment.Waive_End_Date__c=Technology.Waive_End_Date__c;
                          Adjustment.Amount__c=Technology.Waive_Amount__c;
                          AdjustmentFeeInsert.add(Adjustment);
                       } 
             }
*/
                    
            }
      
      }
      
     
     if(AdjustmentFeeInsert.size()>0)
    
           insert AdjustmentFeeInsert;
      }
    global void finish(Database.BatchableContext BC) {
        
    }
 }
I have a test class that that is inserting a product into the standard pricebook.
Relevant code:
Id pricebookId = Test.getStandardPricebookId();

Product2 prd1 = new Product2 (Name='Test Product Entry 1', Description='Test Product Entry 1',productCode = '99999', isActive = true);
insert prd1;

PricebookEntry pbe1 = new PricebookEntry (Product2ID=prd1.id, Pricebook2ID=pricebookId, UnitPrice=50, isActive=true);
insert pbe1;
Next, in the trigger, I can have the same product code in multiple pricebooks, so I have to check to see if the product
is from the standard pricebook.  Again, relevant code;
thePbe = [SELECT id, Product2Id, Pricebook2.IsStandard, Pricebook2.Id  
                   FROM PricebookEntry 
                   WHERE  IsActive = true AND Pricebook2.IsStandard=true 
                   AND Product2Id IN (SELECT Id FROM Product2 WHERE ProductCode = '99999' And isActive = True) ];
This returns zero rows - which I thought was weird.  So, in the trigger I queried the price books like this;
List<PricebookEntry> pbe =  [SELECT id, Pricebook2.IsStandard, Pricebook2.Id  from PricebookEntry WHERE  IsActive = true ];
System.debug('pbe.size(): ' + pbe.size());    // Prints "1"

if(pbe.size() > 0)
     System.debug('pbe[0].Pricebook2.IsStandard: ' + pbe[0].Pricebook2.IsStandard);
This prints "false" (!)

In other words - I don't see why SFDC would give us the ability to get and set the "StandardPricebookId" - yet when queried, it is not the standard pricebook.    Obviously, I don't want to use Seealldata=true.   

Is there a way around this?   Does anyone see anything wrong?
Thanks.