• Arvind Jain
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
I have design a Apex Trigger Code:


trigger BusinessHrs on Customer__c (before insert, before update)
{
Long Diff1;
Long Diff2;
for(Customer__c c1: trigger.new)
{
BusinessHours stdBusinessHours = [select id from businesshours where id = '01mi0000000aAVI'];

DateTime d1 = DateTime.newInstance(1997, 1, 31, 7, 8, 16);
DateTime d2 = DateTime.newInstance(1997, 1, 31, 7, 8, 16);

d1=c1.Startdate__c;
d2=c1.EndDate__c;

Diff1=BusinessHours.diff('01mi0000000aAVI',d1, d2) ;
c1.Business_Hour1__c=(Diff1/(1*60*60*1000));

DateTime d3=DateTime.newInstanceGmt((d1.dateGmt()), (d1.timeGmt()) );
DateTime d4=DateTime.newInstanceGmt((d2.dateGmt() ), (d2.timeGmt() ) );

Diff2=BusinessHours.diff('01mi0000000aAVI',d1, d2) ;
c1.Business_Hour2__c=(Diff2/(1*60*60*1000)); } } }

In Both Business_Hour1__c,Business_Hour2__c the number field(decimal 2 places) have no decimal value... Is something wrong in : Diff2=BusinessHours.diff('01mi0000000aAVI',d1, d2) ;
c1.Business_Hour2__c=(Diff2/(1*60*60*1000));

We have created a Percentile Summary formula and want report get filter for record more than 95 percentile .... Can we do it?? 

I dont see summary formula field name in new filter.