Create or REPLACE TRIGGER DezaiCN_PR_SPLIT
BEFORE
Insert
ON po_requisitions_interface_all
FOR EACH ROW
begin
If :NEW.interface_source_code = 'MSC' THEN
--处理ASCP释放的PR
IF :NEW.org_id = 106 THEN
:NEW.interface_source_code := 'SPLIT';
END IF;
ELSIF :NEW.interface_source_code = 'SPLITED' THEN
:NEW.interface_source_code := 'MSC';
:NEW.LINE_ATTRIBUTE10 := '1';
END IF;
EXCEPTION
WHEN OTHERS THEN
NULL;
end;
EXCEPTION
WHEN Others THEN
v_error_code := '1';
v_error_message := '提交处理事务处理接口请求失败!' || SUBSTR(SQLERRM, 1, 100);
FND_FILE.PUT_LINE(FND_FILE.LOG, v_error_message);
ROLLBACK;
RETURN;
COMMIT;
说明一下:
1.关于在oracle客户端正确取道PROFILE值的解决办法:fnd_global.APPS_INITIALIZE的说明
USER_ID : The USER_ID number
RESP_ID : The ID number of the responsibility
RESP_APPL_ID : The ID number of the application to which the responsibility belongs
首先找到三个参数的值:
user_id ,resp_id ,resp_appl_id
select user_id from fnd_user where user_name ='yourusername'
select RESPONSIBILITY_ID,APPLICATION_ID from fnd_responsibility where RESPONSIBILITY_KEY=yourrespkey ;
然后:执行
BEGIN
fnd_global.APPS_INITIALIZE(user_id => youruesr_id ,esp_id => yourresp_id,resp_appl_id =>yourresp_appl_id);
END;
这样就可以得到值正确的值了:
select fnd_profile.value('GL_SET_OF_BKS_ID') FROM DUAL;