카테고리 없음

테코에서 Static Method cannot be invoked through object instance 뜰때

으농농이 2023. 2. 19. 22:39

[참조문서]

https://developer.salesforce.com/forums/?id=906F00000009gv4IAA 

 

DeveloperForce

Welcome to Support! Search for an answer or ask a question of the zone or Customer Support. Need help? Dismiss + Start a Discussion

dfc-org-production.my.site.com

 

Hi rov,
find the code below


@isTest(seealldata = true)
Private class Util_FormatDateTimeTest {

static testmethod void unitTest(){
      DateTime dt = system.now();
        test.startTest();
      
        Util_FormatDateTime mdt = new Util_FormatDateTime();
      
        DateTime dt = datetime.now();
           
        mdt.getTimeZoneValue();
        //  mdt.getLocalDateTime(dt); //  이렇게 하지말고 
      Util_FormatDateTime.getLocalDateTime(dt); // class 에서 직접 메소드 선언해서 하면 해결됨
        test.stopTest();
}

}