• Anvesh Paidakula
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 0
    Replies
I have trigger used to share  contact records for users. And working okay. But the problem is  i have another  trigger and in that there is a delete method  for contact share  which deletes all Manual sharing and later inserts for another users..

When my first trigger fires it shares the record and parallel the other trigger also fired and deletes Manual sharing
For the below code i am getting Limit exception while deploying into production. I knw  more tham 10k records are processed in querry...can anyone correct this ......


@isTest private static void FT_FT()
    {
      List<Transaction__c> TList = new List<Transaction__c>();
      Transaction__c F = GenTransactionForecare(1000, '', FORECARE_CU);
      Transaction__c F2 = GenTransactionForecare(1002, '', FORECARE_CU);

      TList.add(F);
      TList.add(F2);

      Test.startTest();
      insert TList;
      Test.stopTest();
   
      Map<Id, Transaction__c> TMap = new Map<Id, Transaction__c> ([SELECT External_Wholesaler__c, Id FROM Transaction__c WHERE
      Id =:F.Id OR Id =:F2.Id]);
   
//Exception occurerd getting Too Many Soql  statements
 

      System.assertEquals(true, TMap.get(F.Id).External_Wholesaler__c != null && TMap.get(F2.Id).External_Wholesaler__c != null,
        'TMap.get(F.Id).External_Wholesaler__c: '+TMap.get(F.Id).External_Wholesaler__c+
        ' . TMap.get(F2.Id).External_Wholesaler__c: '+TMap.get(F2.Id).External_Wholesaler__c);

    }
}
when i am trying to create history track report for case i am getting  'Case History'  while creating Report...I want to crreate same for custom object also. But this is not displaying while report creation.  The history Track check box has checked for my custom object. How to get   'Custom_Obj History'  while creatring report.
I have 2 objects fields are there. For Transfer object i have Expected Premium field and For Transaction object i have Amount field.

The calculation was Transfer 'Expected Premium' should be 10% of Transaction Amount.then a field is updated on Transfer Record. The problem it need to calculte below 10% and also above 10% Range. I have given below formulae but it wasnt work.

If(exchange.Expected_Premium__c <= 0.1*trans.Amount__c || exchange.Expected_Premium__c >= 0.1*trans.Amount__c ){
exchange.Transfer_Rec_d__c = true; (CheckBox field)
}

But for this , If i give out of boundaries also , it enables the check box. This ll fires while creating Transaction Record. (we ll enter the Amount while creating Transaction Record. So Trigger ll fire and  check with the condition )
I want to display the no of days since transaction records was created AND assigned to the user.. For this i had taken formulae field and captured the result value of No Of Days. This was resulting on every record fine. One user may assign to any no of records..

The formulae that i had return was

CASE(MOD( Transaction_Date__c - DATE(1985,6,24),7),
0 , CASE( MOD( TODAY() - Transaction_Date__c ,7),1,2,2,3,3,4,4,5,5,5,6,5,1),
1 , CASE( MOD( TODAY() - Transaction_Date__c ,7),1,2,2,3,3,4,4,4,5,4,6,5,1),
2 , CASE( MOD( TODAY() - Transaction_Date__c ,7),1,2,2,3,3,3,4,3,5,4,6,5,1),
3 , CASE( MOD( TODAY() - Transaction_Date__c ,7),1,2,2,2,3,2,4,3,5,4,6,5,1),
4 , CASE( MOD( TODAY() - Transaction_Date__c ,7),1,1,2,1,3,2,4,3,5,4,6,5,1),
5 , CASE( MOD( TODAY() - Transaction_Date__c ,7),1,0,2,1,3,2,4,3,5,4,6,5,0),
6 , CASE( MOD( TODAY() - Transaction_Date__c ,7),1,1,2,2,3,3,4,4,5,5,6,5,0),
999)
+
(FLOOR(( TODAY() - Transaction_Date__c )/7)*5)-2


So, This will skips the Saturday, Sunday and gives the No of days.

I have generated Report, when i drop this field on Report it Results the Summerized value. But i want MOst Recent days value. Suppose if the user last Transaction is 14/3/14. then it ll give 3 as the value(Skip saturday,sunday). for that user. (I want most recent). Because same user may have different value in some other record as i said same user can assign to any no of records.



Can we create fields on the user detail that would calculate the ‘Days since’ based on record creation.  We need to find a format where the ‘Days since last’ value is recalculated daily and the new value overwrites the old value (ideally we can capture historic values via field history tracking).
c. User field ‘Days since last Sale’ would be based on number of days since transaction records was created AND assigned to the user.
I want to display the no of days since transaction records was created AND assigned to the user.. For this i had taken formulae field and captured the result value of No Of Days. This was resulting on every record fine. One user may assign to any no of records..

The formulae that i had return was

CASE(MOD( Transaction_Date__c - DATE(1985,6,24),7),
0 , CASE( MOD( TODAY() - Transaction_Date__c ,7),1,2,2,3,3,4,4,5,5,5,6,5,1),
1 , CASE( MOD( TODAY() - Transaction_Date__c ,7),1,2,2,3,3,4,4,4,5,4,6,5,1),
2 , CASE( MOD( TODAY() - Transaction_Date__c ,7),1,2,2,3,3,3,4,3,5,4,6,5,1),
3 , CASE( MOD( TODAY() - Transaction_Date__c ,7),1,2,2,2,3,2,4,3,5,4,6,5,1),
4 , CASE( MOD( TODAY() - Transaction_Date__c ,7),1,1,2,1,3,2,4,3,5,4,6,5,1),
5 , CASE( MOD( TODAY() - Transaction_Date__c ,7),1,0,2,1,3,2,4,3,5,4,6,5,0),
6 , CASE( MOD( TODAY() - Transaction_Date__c ,7),1,1,2,2,3,3,4,4,5,5,6,5,0),
999)
+
(FLOOR(( TODAY() - Transaction_Date__c )/7)*5)-2


So, This will skips the Saturday, Sunday and gives the No of days.

I have generated Report, when i drop this field on Report it Results the Summerized value. But i want MOst Recent days value. Suppose if the user last Transaction is 14/3/14. then it ll give 3 as the value(Skip saturday,sunday). for that user. (I want most recent). Because same user may have different value in some other record as i said same user can assign to any no of records.



Can we create fields on the user detail that would calculate the ‘Days since’ based on record creation.  We need to find a format where the ‘Days since last’ value is recalculated daily and the new value overwrites the old value (ideally we can capture historic values via field history tracking).
c. User field ‘Days since last Sale’ would be based on number of days since transaction records was created AND assigned to the user.