搜索表格 - 执行查询 - 当找到详细记录然后消息时
我有一个搜索sales_orders/payment_details表格...
我正在通过Enter and Execute查询搜索记录,但是在某些情况下找不到详细记录,
例如:输入销售订单和执行付款记录,但尚未付款...
然后...然后我想提供消息(“找不到记录”)。.
请指导我触发器及其执行水平,
谢谢 javed
I have a search sales_orders/payment_details form ...
I am searching record through enter and execute query but in some cases detail record is not found
For Example: Enter Sales Order and Execute Payment record but there is no payment made yet...
then i would like to give message ('No record found')..
please guide me the trigger and its level of execution
Thanks
Javed
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那是一种主详细信息。我建议您以这种方式创建它,并让表格担心默认数据处理(查询,插入,删除) - 使用数据块向导,它将竭尽所能,并创建数量的触发器,这些触发器将强制执行主尾关系。
完成后,一切都将只是工作 - 您不必编写一行代码。
由于我没有您的表格,我使用了Scott的
Dept
(Master)和EMP
(详细信息)。如果您熟悉该模式,您会知道部门10、20和30中有一些员工,但是在部门40中没有人工作。因此,您想在查询部门40时显示一些消息。在部门10上执行查询的输出端是输出的;右边是我们真正想要的(部门40,没有员工):
如何做?导航到对象导航器中的“程序单位”,并编辑
query_master_details
触发 - 它是数据块向导创建的那些对象之一。编辑其代码并添加一些行,以检查是否存在细节行;如果没有,请显示一条消息(请参阅第20行):
为简单起见,我使用了两个连续的
消息
调用,然后像警报一样起作用(否则,该消息将显示在状态行中在窗户的底部)。如果需要,可以使用“真实”警报;我把它留给你。That's a master-detail form. I suggest you create it that way and let Forms worry about default data handling (querying, inserting, deleting) - use Data Block Wizard, it'll do everything right and create number of triggers which will enforce the master-detail relationship.
Once you're done, everything will just work - you don't have to write a single line of code.
As I don't have your tables, I used Scott's
dept
(master) andemp
(detail). If you're familiar with that schema, you know that there are some employees in departments 10, 20 and 30, but nobody works in department 40.Therefore, you'd want to display some message when you query department 40. On the left hand side is output for executing query on department 10; on the right is what we actually want (department 40, no employees there):
How to do that? Navigate to "Program units" in Object Navigator and edit the
QUERY_MASTER_DETAILS
trigger - it is one of those objects created by the Data Block Wizard.Edit its code and add a few lines which will check whether detail rows exist; if not, display a message (see line #20):
For simplicity, I used two consecutive
message
calls which then act as if it were an alert (otherwise, that message would be displayed in the status line at the bottom of the window). If you want, you can use "real" alert; I'll leave it to you.