Manipulating Data on a Grid: Scroll PeopleCode

本文介绍了一种在网格中清除不想要的数据并填充所需数据集的简单步骤。首先定义一个Rowset对象,然后实例化该对象以从当前网格获取数据。接着使用Flush方法清除所有数据行,最后选择特定条件下的数据填充网格。
When you have a grid that is filled with data; data that you don't want. How do you clear it out and then fill it with the data set that you do want? Well, here are the simple steps to do just that.

Lets say we have a Grid on a page and the main record on the grid is called COMPETENCIES. Well we would first want to define a Rowset object to manipulate. The code for this would look as follows:

Local Rowset &COMPETENCIES;

Next we will want to instantiate the object. Instantiate just means to represent by an instance. If you notice, I am not creating a new Rowset. I am getting the Rowset from the current grid called competencies, using the GetRowSet function. And, I am defining the Grid object as a Rowset.

&COMPETENCIES = &REVIEW(CurrentRowNumber(1)).GetRowset(Scroll.COMPETENCIES);

Once that is complete, I want to remove all rows of data from the Grid. To do that I simply use the Flush method.


&COMPETENCIES.Flush();


Now lets fill the grid with new data that we really want.


&COMPETENCIES.Select(Record.COMPETENCIES,"WHERE EMPLID = :1 AND EVALUATION_ID = :2 AND COMPETENCY IN " | &IN | " AND EFFDT = %DATEIN(:3)", &EMPLID, &EVALUATION_ID, &REVIEW_DT);

What I am doing in the above line of code is selecting the data that I want to use to fill the grid. By selecting the record I am in essence asking to select all the fields that are on the grid from the COMPETENCIES table with the where clause.

Thats it! It's that simple.

If you want to learn more about Object Scroll PeopleCode, check out the book called "A Guide to Programming Object Scroll PeopleCode."

Happy Coding...

转载于:https://www.cnblogs.com/GoDevil/archive/2008/08/08/1263904.html

内容概要:本文详细介绍了一个基于Java与Vue的食品安全溯源与智能分析系统的设计与实现,涵盖项目背景、目标意义、面临挑战及解决方案,并阐述了系统的整体架构与核心技术模块。系统通过集成物联网设备实现全流程数据采集,采用分布式数据库保障大数据存储与高效访问,结合机器学习算法进行风险预测与智能预警,同时利用可视化技术呈现溯源链路与分析结果,实现了食品从生产到销售全过程的透明化、智能化管理。文中还提供了关键模块的代码示例,如数据清洗、特征提取、决策树模型训练与预测、溯源接口开发等,增强了项目的可实施性与参考价值。; 适合人群:具备Java开发基础、熟悉Spring Boot和Vue框架,有一定前后端开发经验的软件工程师或计算机专业学生,尤其适合从事食品安全、物联网、大数据分析等相关领域技术研发的人员; 使用场景及目标:①构建食品全链条溯源体系,提升企业对食品安全事件的快速响应能力;②实现生产流程数字化管理,支持政府监管与消费者透明查询;③应用机器学习进行风险建模与智能预警,推动食品行业智能化转型; 阅读建议:建议结合文中提供的模型描述与代码示例,深入理解各模块设计逻辑,重点关注数据处理流程、算法实现与前后端交互机制,可基于该项目进行二次开发或拓展应用于其他行业的溯源系统建设。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值