• hu yang
  • NEWBIE
  • -1 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 13
    Replies
I have a ReportType,and create a report with this ReportType.
I want to add data criteria when the report is runned in URL.
how can i do that?
  • September 09, 2015
  • Like
  • 0
When i use the sample code that is provided by salesforce,I got a error "System.SecurityException: Invalid Crypto Key".
Who can tell me how to use "Crypto.sign".
Thanks.

The blow is the sample code:
String algorithmName = 'RSA';
String key = 'pkcs8 format private key';
Blob privateKey = EncodingUtil.base64Decode(key);
Blob input = Blob.valueOf('12345qwerty');
Crypto.sign(algorithmName, input,privateKey);

I'm trying to perform a unit test on a query that doesn't debug properly in the console because its not using live data.  In an effort to provide the data in the class itself, I'm still getting nothing.  Do you know why my contact isn't being added to my new list?

 

        Contact newContact1 = new Contact(
    	LastName =  'testvalue',
        AccountId = '001g000000f14cB',
    	//company = 'testervalue',
		Lead__c = leadToConvert.Id
		);
        system.debug(newContact1);
        List<Contact> searchList = [SELECT Id,Lead__c FROM Contact WHERE Lead__c =:leadToConvert.Id];
Hi All,

I have written a trigger to insert a line item in child object(Top Account)  when Top_account__c custom field is checked in account object.

The below trigger is working fine for the the account   that is ceated now and updated now .

Fow few of the account which is already exist in system and when we are updating that account with Top_account__c custom field is checked .

I am geeting two line item when I am checking Top_account__c custom field is checked .

Below is the trigger.Request your help in resolving the issue


trigger Topaccount on Account(After insert, after update) {
  List<Top_Account__c> newTop = new List<Top_Account__c>();
  for (Account acc : Trigger.new) {
  if ((trigger.isInsert || acc.Top_Account__c != trigger.oldMap.get(acc.Id).Top_Account__c) && acc.Top_Account__c == True)
  {
    Top_Account__c tp = new Top_Account__c();
    tp.Name = acc.Name;
    tp.releted_acc__c = acc.Id; // Use the trigger record's ID
    newTop .add(tp);
  }
  }
  insert newTop ;
  }
I have this formula working in the Sandbox on a fieldupdae
DATETIMEVALUE(TEXT(YEAR(PeopleCloud1__Date_First_Interview__c ))+"-" +TEXT(MONTH(PeopleCloud1__Date_First_Interview__c))+"-" +TEXT(DAY(PeopleCloud1__Date_First_Interview__c))+" "+TEXT( Hour1stInterview__c-10 )+":"+ TEXT( Minutes1stInterview__c )+":00")

But in Production I am getting the error
Computed an invalid date, such as February 29th on a non-leap year. Please contact your administrator; formula fields can cause such errors.

I am entering the values from a date field which is saved and therefore has to be valid and 2 numbers one for Hours and one for Minutes which are both valid

As mentioned it works in the sandbox but not in production

Any ideas?