commit_form:将form上的数据写入数据库,并且会在database提交,即 直接查询表是能够查到结果,在form左下角会得到“FRM-40400:Transaction complete:4 records applied an saved”

post:将form上的数据写入数据库,但是并不在database提交,即 直接查询表是查不到该记录的,在form左下角会得到"FRM-40404:Database apply complete: 4 records applied"

最近遇到一个form需求,需要在form操作过程中,把操作的最后一次记录插入到历史记录表(先插入临时表,最后把满足要求的记录插入历史记录表),

例如:在输入trx quantity时,之前可能已经输入过1--->0.001,2--->0.002,3--->0.003,4--->0.005,

但是最后改成如上图的数据,需求是要求最后把屏幕上的数据记入操作记录表(先插入临时表,最后把满足要求的记录插入操作记录表),其他数据不能插入,又由于此form每次在进入此block时 "trx oper quantity"数据是空白的(此需求说明不能使用常规的明细块逻辑,因为明细块逻辑是每次进入记录时都能从数据库中查询出值),但是"Opr id"的值来源于另一个表,即:第一次进入此block(:system.record_status='NEW')会要求为每个operation id录入新的trx quantity,然后按"BACK"按钮返回时将TRX quantity汇总值返回,以后进入时(:system.record_status<>'NEW')显示当前session已经录入的值

Details "WHEN-BUTTON-PRESS"逻辑代码如下:

IF :system.record_status ='NEW'  then  ---第一次进入到"transfer out details"时 才把数据插入临时表
   DELETE FROM XXWIP_MUCL_TRANSFER_DETAILS WHERE 1=1;----先将临时表中有的数据删除

INSERT INTO XXWIP_MUCL_TRANSFER_DETAILS ---
    (transaction_date,
     organization_id,
     inventory_item_id,

operation_id,
     trx_oper_quantity
     )
  VALUES
    (:transfer_header.transaction_date,
     :transfer_lines_f.organization_id,
     :transfer_lines_f.inventory_item_id,

  a.OPERATION_CODE,----来自于其他table的值
     0 ---

);
   end loop;
END IF;

BACK “WHEN-BUTTON-PRESSED” 代码如下:

declare

ln_operation_quantity_r number;

begin

ln_operation_quantity_r :=0;

first_record;

loop

ln_operation_quantity_r := ln_operation_quantity_r+ nvl(:TRANSFER_DETAILS.TRX_OPER_QUANTITY,0);

EXIT WHEN :system.last_record = 'TRUE';

next_record;

end loop;

post; ----按back按钮时提交数据至临时表,将form上的数据写入数据库,但是并不在database提交,即 直接查询表是查不到该记录的,在form左下角会得到"FRM-40404:Database apply complete: 4 records applied"

---:system.message_level :=25;

---commit_form; ---将form上的数据写入数据库,并且会在database提交,即 直接查询表是能够查到结果,在form左下角会得到“FRM-40400:Transaction complete:4 records applied an saved”

---:system.message_level :=0;

if ln_operation_quantity_r > :TRANSFER_LINES_F.AVAILABLE then

  fnd_message.set_string('Available quantity is not engouh for transaction');

  fnd_message.show;  fnd_message.error;

  RAISE form_trigger_failure; end if;

if ln_operation_quantity_r > 0 then

copy(ln_operation_quantity_r,'TRANSFER_LINES_F.TRANSFER_OUT');

copy('Y','TRANSFER_LINES_F.CHECK_BOX');

--- ln_operation_quantity_r := null;

end if;

go_block('TRANSFER_LINES_F');

hide_window('TRANSFER_DETAILS');

end;

Description

Writes data in the form to the database, but does not perform a database commit. Oracle Forms first validates the form. If there are changes to post to the database, for each block in the form Oracle Forms writes deletes, inserts, and updates to the database.

Any data that you post to the database is committed to the database by the next COMMIT_FORM that executes during the current Runform session. Alternatively, this data can be rolled back by the next CLEAR_FORM.

Syntax

PROCEDURE POST;

Built-in Type restricted procedure

Enter Query Mode no

Parameters

none

Usage Notes

If this form was called via OPEN_FORM with the NO_SESSION parameter specified, then the POST will validate and write the data both in this form and in the calling form.

POST Examples

/*** Built-in: POST and EXIT_FORM

** Example: Leave the called form, without rolling back the

** posted changes so they may be posted and

** committed by the calling form as part of the

** same transaction.

*/

BEGIN

Post;

/*

** Form_Status should be 'QUERY' if all records were

** successfully posted.

*/

IF :System.Form_Status <> 'QUERY' THEN

Message('An error prevented the system from posting changes');

RAISE Form_Trigger_Failure;

END IF;

/*

** By default, Exit_Form asks to commit and performs a

** rollback to savepoint. We've already posted, so we do

** not need to commit, and we don't want the posted changes

** to be rolled back.

*/

Exit_Form(NO_COMMIT, NO_ROLLBACK);

END;

[Form Builder]POST 与 commit_form 的区别的更多相关文章

  1. Oracle EBS Form Builder使用Java beans创建窗体

    最近有个项目,需要研究一下Oracle的E-Business Sutie(EBS),对于以前没接触此套件的我来说,简直太痛苦了.在网上找了一堆资料,试着进行Form二次开发,也遇到各类奇葩问题.目前遇 ...

  2. 使用Form Builder创建Form具体步骤

    使用Oracle Form Builder创建Form具体步骤 (Data Source为Table) 说明:当Block使用的Data Source为Table时,Form会自动Insert,Upd ...

  3. [Form Builder]Oracle Form系统变量中文版总结大全

    转:http://yedward.net/?id=57 Form中的系统变量,它存在于一个Form的整个运行时期的会话之中,变量包含了有关Form相关属性的字节信息.有些变量标明了当前状态,还有些变量 ...

  4. [Form Builder]NAME_IN()与COPY()

    NAME_IN和COPY实际是间接引用,类似指针传递,而不是值传递... IF :VAR1 IS NULL ...  direct referenceIF NAME_IN ( :VAR1 ) IS N ...

  5. [Form builder]:about SYSTEM.MESSAGE_LEVEL

    If you want to suppress error messages then you have to set a system variable :system.message_level. ...

  6. 【转】HTTP请求中的form data和request payload的区别

    jQuery的ajax方法和post方法分别发送请求,在后台Servlet进行处理时结果是不一样的,比如用$.ajax方法发送请求时(data参数是一个JSON.stringify()处理后的字符串, ...

  7. WordPress Plugin Contact Form Builder [CSRF → LFI]

    # Exploit Title: Contact Form Builder [CSRF → LFI]# Date: 2019-03-17# Exploit Author: Panagiotis Vag ...

  8. [转]HTTP请求中的form data和request payload的区别

    本文转自:http://www.cnblogs.com/btgyoyo/p/6141480.html jQuery的ajax方法和post方法分别发送请求,在后台Servlet进行处理时结果是不一样的 ...

  9. Oracle Form Builder

    Oracle Form Builder 是Oracle的一个开发工具,可以针对Oracle公司的E-Business Suit的ERP系统开发的.对应的还有reports builder. Oracl ...

随机推荐

  1. 确保客户端可以接收到服务端的异常serviceDebug includeExceptionDetailInFaults="true"

    1.为了确保客户端可以接收到服务端反馈的异常 在服务端的配置文件中需要有 <system.serviceModel> <behaviors> <serviceBehavi ...

  2. Eclipse设置、问题解决方案

    Eclipse设置: 1.如何把eclipse关闭提示调出来? 可以这样打开这个提示:选择 Windows --Preferences,在左边树上选择“General” --“Startup and ...

  3. BZOJ_1626_[Usaco2007_Dec]_Building_Roads_修建道路_(Kruskal)

    描述 http://www.lydsy.com/JudgeOnline/problem.php?id=1626 给出\(n\)个点的坐标,其中一些点已经连通,现在要把所有点连通,求修路的最小长度. 分 ...

  4. 抽离CodeIgniter的数据库访问类 可以独立使用

    好吧,因为组织需要,最近又开始转战php了,业务逻辑都还好说,主要是老大要求在数据访问层上加上登录态验证.其实这种要求也是合理的,互联网服务要求上层保护下层,但下层不能完全相信上层.但是问题也就来了, ...

  5. 获得设备型号(含iPhone6 , iPhone 6+)

    //获得设备型号 + (NSString *)getCurrentDeviceModel:(UIViewController *)controller { int mib[2]; size_t len ...

  6. MVC3.0 中Razor 学习

    随着MVC3.0RTM版本的发布,最近将公司的项目从MVC2.0升级到MVC3.0.同时打算在MVC3中全面使用Razor模板引擎.现将Razor学习拿出来和大家分享,如果存在不足的地方欢迎您指出. ...

  7. 基于WebForm+EasyUI的业务管理系统形成之旅 -- 施工计划安排(Ⅶ)

    上篇<基于WebForm+EasyUI的业务管理系统形成之旅 -- 首页Portal界面拖拽>,主要介绍首页随客户喜好安排区块位置,更好的实现用户体验. 这两天将项目中施工计划管理归纳总结 ...

  8. Failed to load unit 'PATM' (VERR_SSM_FIELD_NOT_CONSECUTIVE)

    今天打开虚拟机启动的时候报错:Failed to load unit 'PATM' (VERR_SSM_FIELD_NOT_CONSECUTIVE) 后来发现虚机处于休眠状态,所以在虚机上右键,然后清 ...

  9. 怎样从官网下载Spring的jar包

    第一种,简单粗暴直接http://repo.springsource.org/libs-release-local/org/springframework/spring/3.2.4.RELEASE/s ...

  10. Java笔记(二十九)……网络编程

    概述 网络模型 网络通讯的要素 ip地址:网络中设备的标识符 端口:用于标识同一台设备上不同的进程,有效端口:0~65535,其中0~1024是系统使用端口或者保留端口 TCP与UDP UDP特点: ...