HR 케이스에서 지식 문서를 만들 수 있는 UI 작업 만들기
HR 케이스 양식에 지식 확인란을 추가하는 UI 작업을 생성합니다.
시작하기 전에
개발자 애플리케이션이 인사 관리: 코어로 설정되어 있는지 확인합니다.
프로시저
- 다음으로 이동 모두 > 시스템 UI > UI 작업.
- 새로 만들기를 클릭합니다.
-
다음 필드에 내용을 입력합니다.
표 1. UI 작업 양식 필드 설명 이름 지식 생성 테이블 HR 케이스 작업 이름 create_knowledge - 클라이언트 확인란을 선택합니다.
- 목록 v3 호환 확인란을 선택합니다.
- 양식 버튼 확인란을 선택합니다.
- Onclick 필드에 createKnowledgeClient()를 입력합니다.
- 조건 필드에 gs.getProperty("sn_hr_core.enable_kcs_hr") == 'true' &; new global을 입력합니다. CSMTableMapUtil (current).findMapByName("sn_hr_core.hr_case_kcs_article") &; 새 전역. KBKnowledge().canCreate()를 사용합니다.
-
스크립트 필드에 다음 코드를 입력합니다.
function createKnowledgeClient() { if (g_form.modified) { alert(new GwtMessage().getMessage('You have unsaved changes. Please save them to continue.')); }else{ //Call the UI Action again but skip the 'onclick' function gsftSubmit(null, g_form.getFormElement(), 'create_knowledge'); //MUST call the 'Action name' set in this UI Action } } //Code that runs without 'onclick' //Ensure call to server-side function with no browser errors if (typeof window == 'undefined') CreateKnowledgeServer(); function CreateKnowledgeServer(){ current.update(); var map = new global.CSMTableMapUtil (current); map.findMapByName("sn_hr_core.hr_case_kcs_article"); var targetURL = map.getTargetURL(); var referenceLink = "&sysparm_collection=sn_hr_core_case&sysparm_collectionID="+current.sys_id+"&sysparm_collection_key=task&sysparm_link_collection=m2m_kb_task&sysparm_collection_related_field=kb_knowledge&sysparm_referring_url=sn_hr_core_case.do%3fsys_id%3d"+current.sys_id; if(targetURL) action.setRedirectURL(targetURL[0]+referenceLink); } - 제출을 클릭합니다.