【问题标题】:Non database item in a master detail form主详细信息表单中的非数据库项目
【发布时间】:2018-09-02 23:14:44
【问题描述】:

在主明细表单中,它显示帐户是借方还是贷方,并带有 id。我想删除借方和贷方列并添加显示项目以在主表单中显示帐户的关键字借方或贷方。我正在添加一张照片来解释这一点 here

【问题讨论】:

  • 你试过什么?你卡在哪里了?
  • 我不知道怎么做我是 oracle 新手
  • 所以你什么都没试过?没有想法?没有办法?那么也许你应该先买一本书,它可以帮助你理解什么是 oracle,你可以用它做什么以及如何做。
  • 我已经尝试过 if 语句,但它在查询后没有用作触发器

标签: sql oracle forms oracle11g oracleforms


【解决方案1】:

假设您有一个名为 Voucher 的块,其中包含标题为 Voucher 的框架内的项目。

首先,您似乎不想显示debit > 0 or credit >0,那么您需要隐藏这些列。例如,您可以通过在Property PalettePhysical part 中将它们的Canvas 设置为<null> 来隐藏它们。

然后在Voucher的块级定义POST-QUERY触发器

(提供在go_block('voucher'); execute_query; 命令块触发后运行的定义代码)

使用以下代码(假设额外添加的显示项命名为 result ):

begin
   :voucher.result := null;
  if nvl(:voucher.debit,0) >0 then
   :voucher.result := 'Debit   '; 
  end if;

  if nvl(:voucher.credit,0) >0 then
   :voucher.result := :voucher.result||'Credit';
  end if;
end;

【讨论】:

  • 我想隐藏借方和贷方列,在结果中我想比较我在搜索中使用的账户与借方和贷方列,如果它与贷方匹配,结果是贷方,如果不是结果是借记
  • 我在按下搜索按钮时使用此代码 {:voucher.result := null;如果 :voucher.debit = :block7.account_id 那么 :voucher.result := '借方';万一;如果 :voucher.credit = :block7.account_id 然后 :voucher.result := :voucher.result||'Credit';万一; } 结果只出现在第一行
  • @AhmedS.Elsenbawy 不要将代码放入WHEN-BUTTON-PRESSED,而是放入POST-QUERY,它会提供您定义的代码在go_block('voucher'); execute_query; 之后运行。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多