您好,登錄后才能下訂單哦!
本篇內容介紹了“C4C和CRM里怎么獲取Organization Unit信息”的有關知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領大家學習一下如何處理這些情況吧!希望大家仔細閱讀,能夠學有所成!
如何查看某個用戶分配的組織單元ID:
在Employee的Organization Data區域內看到分配的組織名稱,如下圖紅色下劃線所示:
現在的需求就是使用ABSL獲取當前登錄用戶分配的Organization Unit信息,例如用WANGJERRY37登錄,則取出下圖顯示的Department name PMLS:
具體實現:新建一個custom BO,使用字段DepartmentName存儲這個待取的值:
然后創建AfterLoading script file,使用如下代碼:
import ABSL; import AP.PC.IdentityManagement.Global; import AP.FO.BusinessPartner.Global; var queryByIdentityUUID = Identity.QueryByElements; var queryByIdentityUUIDParameter = queryByIdentityUUID.CreateSelectionParams(); var queryByEmployeeBPUUID = Employee.QueryByIdentification; var queryByEmployeeBPUUIDParameter = queryByEmployeeBPUUID.CreateSelectionParams(); if ( this.DepartmentName.IsInitial()){ var id = Context.GetCurrentIdentityUUID().content; queryByIdentityUUIDParameter.Add( queryByIdentityUUID.UUID.content, "I", "EQ", id.ToString() ); var result = queryByIdentityUUID.Execute(queryByIdentityUUIDParameter); var first = result.GetFirst(); // points to identity instance var person = first.Person; var bpUUId = person.UUID.content; queryByEmployeeBPUUIDParameter.Add( queryByEmployeeBPUUID.UUID.content, "I", "EQ", bpUUId.ToString()); var employeeQueryResult = queryByEmployeeBPUUID.Execute(queryByEmployeeBPUUIDParameter); var EmployeeQueryResultCurrent = employeeQueryResult.GetFirst(); var assignedOrg = EmployeeQueryResultCurrent.OrganisationalUnitAssignment.GetFirst(); var org = assignedOrg.ToRoot; // readOnly in AfterLoading event this.DepartmentName = org.NameAndAddress.AddressSnapshot.NameSuitableForLogonLanguage.GetFirst().Name.SecondLineName; }
假設Jerry Wang分配的Organization Unit ID為50000732,使用下列report打印出這個ID:
PARAMETERS: id TYPE but000-partner OBLIGATORY DEFAULT '4031140'. DATA: lo_core TYPE REF TO cl_crm_bol_core, lo_collection TYPE REF TO if_bol_entity_col, lo_root_entity TYPE REF TO cl_crm_bol_entity, lv_query_name TYPE crmt_ext_obj_name, lt_selection_parameter TYPE genilt_selection_parameter_tab, ls_selection_parameter TYPE genilt_selection_parameter, ls_query_parameters TYPE genilt_query_parameters, lv_size TYPE i. START-OF-SELECTION. ls_selection_parameter-attr_name = 'PARTNER'. ls_selection_parameter-option = 'EQ'. ls_selection_parameter-sign = 'I'. ls_selection_parameter-low = id. APPEND ls_selection_parameter TO lt_selection_parameter. ls_query_parameters-max_hits = 1. lo_core = cl_crm_bol_core=>get_instance( ). lo_core->load_component_set( 'PROD_ALL' ). lv_query_name = 'BuilEmpAdvancedSearch'. lo_collection = lo_core->dquery( iv_query_name = lv_query_name it_selection_parameters = lt_selection_parameter is_query_parameters = ls_query_parameters ). DATA(lo_result) = lo_collection->get_first( ). ASSERT lo_result IS NOT INITIAL. WRITE: / 'Org unit id: ', lo_result->get_property_as_string( 'ORGEH' ) COLOR COL_NEGATIVE.
最終調用的是這個function module:
“C4C和CRM里怎么獲取Organization Unit信息”的內容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業相關的知識可以關注億速云網站,小編將為大家輸出更多高質量的實用文章!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。