IT/Nexacro 17

[NEXACRO 17] RAISERROR를 통한 에러, 넥사크로 화면에서 ALERT시키기

Dev. Sean 2022. 6. 27. 09:34
반응형

기본적인 넥사크로 transaction 메소드

Application 영역에 정의된 Dataset의 데이터를 갱신하기 위한 서비스를 호출하고,

트랜잭션이 완료되면 콜백함수를 실행하는 메소드이다.

 

this.transaction(strSvcId, strURL, strInDatasets,
	strArgument,strCallbackFunc[,bAsync[,nData Type[,bCompress]]])

 

이런식으로 트랜잭션을 보내주고 완료되면 다음 콜백함수를 실행한다.

this.callbackFunction = function(strSvcID, nErrorCode, strErrorMsg){
	if(nErrorCode < 0){
		if(strErrorMsg.lastIndexOf("@@") > 0){
			var errorMsg = strErrorMsg.split("@@");
			this.alert(errorMsg[1]);
		}
		else{
			this.alert("에러발생!!! 에러코드 : " + nErrorCode + "\n" + strErrorMsg);
		}
		return;
	}
    
	if(strSvcID == "saveInfo"){
		this.alert(strErrorMsg);
		this.fn_search();
		return;
	}
};

에러가 안뜬다면 아래 if 절을 통해 저장 완료 메세지가 뜬다.

반응형