• David Supuran
  • NEWBIE
  • 25 Points
  • Member since 2012

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 9
    Replies
Hello Helpers There is any Apex API method which can send data(value of a text field for ex ) into clipboard? Best Regards csaba
  • February 29, 2012
  • Like
  • 0
When using Trailhead to 'Verify Step' such as verify fields, etc that are affected by namespace prefixes, then the verification fails with the following error even though all steps have been performed completely:

There was an unhandled exception. Please reference ID: LFCZHEFU. Error: Faraday::Error::ResourceNotFound. Message: NOT_FOUND: The requested resource does not exist 
Note: you may run into errors if you've skipped previous steps.
When using Trailhead to 'Verify Step' such as verify fields, etc that are affected by namespace prefixes, then the verification fails with the following error even though all steps have been performed completely:

There was an unhandled exception. Please reference ID: LFCZHEFU. Error: Faraday::Error::ResourceNotFound. Message: NOT_FOUND: The requested resource does not exist 
Note: you may run into errors if you've skipped previous steps.

hi 

 

I found the solution by searching. For this error

It should delete the schedule.

But I can not delete a schedule.

I wonder if there is another way.

 

thank.

 

 

Hi,

 

Can any body correct the test class.

 

Actual Class

----------------------

 

global public with sharing class OrgExpireQueryBatchable implements Database.Batchable<sObject>, Database.Stateful, Database.AllowsCallouts {


 public OrgExpireQueryBatchable(){
  
 }
 
 global Database.QueryLocator  start(Database.BatchableContext ctx) {
 
   return Database.getQuerylocator('Select Trial_Expiration_Date__c, Name, Master_Password__c, Master_Login__c, Login__c From Test_Org__c where Name like \'IO%\'');  
  
 }
  
 global void execute(Database.BatchableContext ctx, List<sObject> batchRecord) {
    Test_Org__c record =  (Test_Org__c)batchRecord[0];
    System.debug('Master Login' + record.Master_Login__c);
    Id OrgId =  record.Id;
    String loginName;
    String loginPassword;
    loginName = record.Master_Login__c;
    loginPassword = record.Master_Password__c;
    try{ 
        partnerSoapSforceCom.Soap stub = new partnerSoapSforceCom.Soap();
        partnerSoapSforceCom.LoginResult loginResult; 
        
        If(!Test.isRunningTest())
        {
           loginResult = stub.login(loginName,loginPassword);
        }
        stub.SessionHeader =  new partnerSoapSforceCom.SessionHeader_element();
        stub.endpoint_x = loginResult.serverURL;
        stub.SessionHeader.sessionId = loginResult.sessionId;
        string queryStringExpDate ='SELECT Id,TrialExpirationDate   FROM Organization';
        DateTime currentTime = DateTime.now() ;
        DateTime temp =  currentTime.addMinutes(-10);
        String tempStr =  temp.format('yyyy-MM-dd\'T\'kk:mm:ssZ');
        string queryStringLastLogin ='SELECT LoginTime from LoginHistory Where LoginTime < ' +  tempStr + ' order by LoginTime Desc Limit 1';
        partnerSoapSforceCom.QueryResult  qResultExpDate = stub.query(queryStringExpDate );
        partnerSoapSforceCom.QueryResult  qResultLastLogin = stub.query(queryStringLastLogin );
        System.debug('@@@@ query Results: ' + qResultExpDate );
        System.debug('@@@@ query Results.sOject_x: ' + qResultExpDate .records );
        
        DateTime ExpDate=qResultExpDate.records[0].TrialExpirationDate;
        DateTime LastLoginDate = qResultLastLogin.records[0].LoginTime;
        
        // Converting Datetime to Date
        Date dateTemp_ExpDate = Date.newInstance(ExpDate.year(),ExpDate.month(),ExpDate.day());
        Date dateTemp_LastLoginDate  = Date.newInstance(LastLoginDate.year(),LastLoginDate.month(),LastLoginDate.day());
        record.Trial_Expiration_Date__c = dateTemp_ExpDate;
        record.Last_Login_Date__C = dateTemp_LastLoginDate;
        
        update record;
    }catch(CalloutException ex)
    {
        
    }
 
 }
 
 global void finish(Database.BatchableContext ctx) {
    
 }
}

 

 

 

 

Test Class

-----------------

 

@IsTest
public class TestOrgExpireQueryBatchable
{
 
  @IsTest static void TestExecute()
  {
     string loginName='admin@xyz.com';
     string loginPassword= 'test1';
 
    
     Test_Org__c obj=new Test_Org__c();
     obj.Name= 'DEV96';
     obj.Master_Login__c = 'admin@xyz.com';
     obj.Master_Password__c ='test1';
     insert obj;
     
 
     List<SObject> batchobjs = new List<SObject>();
     batchobjs.add(obj);
     
     OrgExpireQueryBatchable objbatch= new OrgExpireQueryBatchable();
     objbatch.start(null);
     objbatch.execute(null, batchobjs );
     partnerSoapSforceCom.Soap stub = new partnerSoapSforceCom.Soap();
     partnerSoapSforceCom.LoginResult loginResult = new partnerSoapSforceCom.LoginResult();
     stub.SessionHeader.sessionId = loginResult.sessionId;
     stub.SessionHeader =  new partnerSoapSforceCom.SessionHeader_element();
     stub.endpoint_x = loginResult.serverURL;
     stub.SessionHeader.sessionId = loginResult.sessionId;
     string queryStringExpDate ='SELECT Id,TrialExpirationDate FROM Organization';
     
     Test_Org__c swbobj=new Test_Org__c();
     Date curdate = Date.today();
     swbobj.Trial_Expiration_Date__c = curdate;
     swbobj.Last_Login_Date__C = curdate.addDays(2);
     insert swbobj;
     
     swbobj.Last_Login_Date__C = curdate.addDays(3);
     update swbobj;
     
    
     System.assertEquals(curdate,swbobj.Trial_Expiration_Date__c);
     System.assertEquals(curdate.addDays(3),swbobj.Last_Login_Date__C);
     
   }

}

 

 

My test class is not covering below lines

 

 stub.SessionHeader.sessionId = loginResult.sessionId;
     stub.SessionHeader =  new partnerSoapSforceCom.SessionHeader_element();
     stub.endpoint_x = loginResult.serverURL;

 

 

Please correct this test case.

We have a few fields on a custom object where field history is tracked.  However, those fields are updated with an Apex trigger.  It does not appear that the fields are tracked when the field is updated with the Apex Trigger.  Is this accurate?  The records could have been created before the fields were tracked, so I can't confirm based on the data alone if the field tracking is respected or not.  Thank you!  

AggregateResult[] groupedResultCall = [SELECT Account_vod__c,count(Id) FROM Call2_vod__c WHERE Call_Date_vod__c >= :QuarterStartDate AND Call_Date_vod__c <= :QuarterEndDate AND Account_Type__c =:accStaticRec.Account_Type__c AND Territory_vod__c = :accStaticRec.Territory__c AND Status_vod__c = 'Submitted_vod' AND (Call_Type_vod__c != 'Call Only' OR Call_Type_vod__c != 'Event Only' OR Call_Type_vod__c != 'Event Detail)
AND Account_vod__c IN :accIdSet

AND Activity_Type__c <> 'Staff'
GROUP BY Account_vod__c ];

AggregateResult[] groupedResultCall = [SELECT Account_vod__c,count(Id) FROM Call2_vod__c WHERE Call_Date_vod__c >= :QuarterStartDate AND Call_Date_vod__c <= :QuarterEndDate AND Account_Type__c =:accStaticRec.Account_Type__c AND Territory_vod__c = :accStaticRec.Territory__c AND Status_vod__c = 'Submitted_vod' AND (Call_Type_vod__c != 'Call Only' AND Call_Type_vod__c != 'Event Only' AND Call_Type_vod__c != 'Event Detail')
AND Account_vod__c IN :accIdSet

AND Activity_Type__c <> 'Staff'
GROUP BY Account_vod__c ];

 

which query is correct.Please correct me

I am having trouble determining how to do this properly.    I have an Apex Class that has a list that is built based on a SOQL query into a custom object that contains Task IDs.  I want to use that list to iterate through the Task object to return the values below to another list object that is then referenced in a Visualforce data table by calling "{!getMyInformedTasks}". 

 

What is below just seems off in how it's constructed.  I am getting the error, "Save error: Variable does not exist: getMyInformedTasks"

 

 

        Id currentUserId = userinfo.getUserId();
	
	List<Task_Informed_Users__c> informedTaskList = [SELECT task_id__c FROM Task_Informed_Users__c WHERE informed_User__c =: currentUserId];
	
	public List<Task> getMyInformedTasks() {
		for(Task_Informed_Users__c tIU : informedTaskList) {
			for(Task t : tIU) {				
				getMyInformedTasks.add(t.Id);
				getMyInformedTasks.add(t.Subject);
				getMyInformedTasks.add(t.Description);
				getMyInformedTasks.add(t.Status);
				getMyInformedTasks.add(t.WhatId);
				getMyInformedTasks.add(t.What.Name);
				getMyInformedTasks.add(t.Owner.Name);
				getMyInformedTasks.add(t.OwnerId);
				getMyInformedTasks.add(t.CreatedBy.Name);
				getMyInformedTasks.add(t.CreatedById);
				getMyInformedTasks.add(t.ActivityDate);
				getMyInformedTasks.add(t.Task_Due_Date__C);							
			}
		}		
		return getMyInformedTasks;		
	}

 

  • August 19, 2013
  • Like
  • 0

Hi,

 

I have field on the object in which users have to enter Time and date manually.Now we want to replace that field with date and time field so that instead of typing  date and time manualy they can select date and time.

 

If we delete this field

 

1) What will happen to the existing data associated to the field.

 

What do you think are my options?What are your sugestions?.How Shall I proceed.

 

Please advise.

Thanks

 

  • August 19, 2013
  • Like
  • 0
Hello Helpers There is any Apex API method which can send data(value of a text field for ex ) into clipboard? Best Regards csaba
  • February 29, 2012
  • Like
  • 0