WinApi::shellExecute를 사용하여 외부 프로그램을 실행할 수 있습니다. 아래 샘플코드는 인터넷 익스플로러를 실행시키면서 시작페이지로 네이버를 지정한 예입니다. 

static void shellExecute(Args _args)
{
    #WinAPI

    WinApi::shellExecute("C:\\Program Files\\Internet Explorer\\iexplore.exe",
                                "http://www.naver.com");   // 실행파일의 경로를 정확히 알고 있는 경우

    WinApi::shellExecute(strfmt("%1\\Internet Explorer\\iexplore.exe",
                                WinApi::getFolderPath(#CSIDL_PROGRAM_FILES)),
                                "http://www.naver.com");
}


 

Posted by Isaac Lee
다음 소스코드를 사용하면 Dynamics AX의 Alert를 만들수 있습니다. 특정사용자 혹은 여러 사용자에게 동시에 메세지를 보내고 싶을 때나 Dynamics AX의 기본 Alert 기능으로는 핸들링 하지 못하는 이벤트에서 메세지를 보내고 싶을 때 사용할 수 있습니다.
static void sendAlert(Args _args)
{
    EventInbox inbox;
    EventInboxId inboxId;

    inboxId = EventInbox::nextEventId();

    inbox.initValue();
    inbox.ShowPopup = NoYes::Yes;
    inbox.Subject = "Happy DAXing!!";    // 제목
    inbox.Message = "http://www.dynamicsax.kr";  // 내용
    inbox.SendEmail = false;
    inbox.UserId = curUserID();  // 수신인 ID

    inbox.InboxId = inboxId;

    inbox.AlertCreatedDate = systemdateget();
    inbox.AlertCreateTime = timeNow();

    inbox.insert();
}
Posted by Isaac Lee
여러가지 다양한 문자를 포함하는 문자열에서 숫자만 남기고 모두 제거하는 방법입니다. 아래 구문을 Job에서 테스트 해보시면 "2343@#$asdf25^&&가나다라" 가 숫자인 "234325" 만 출력됩니다.
.NET 함수를 Dynamics AX에서 사용했으며 Dynamics AX 2009에서도 동작합니다.

static void methodTest1(Args _args)
{
    str strTmp = "2343@#$asdf25^&&가나다라";
    strTmp = System.Text.RegularExpressions.Regex::Replace(strTmp,@"\D","");
    print strTmp;
    pause;
}

Posted by Isaac Lee