Date and Time in PeopleCode
Setting a Date to Null in PeopleCode
To set a date to null in PeopleCode either use the SetDefault() function (deprecated) or the SetDefault field method
Using the function:
SetDefault(YOUR_RECORD.DT_FIELD);
Using the field method If you are in the current context:
YOUR_RECORD.DT_FIELD.SetDefault();
Using the field method if you are not in the current context using a field object:
Local Field &fldDateExample;/* Code to set your &fldDateExample object */&fldDateExample.SetDefault();
Not intuitive but it works.
Setting a Date to Null in PeopleCode (Part II - another way!)
There is also another way to set a date to null via PeopleCode! In some cases, using SetDefault() to blank out a field is not what we're after, as there may be a default for the field! The only other way (to my knowledge) is this:
RECNAME.DATE_FIELD.Value = "";
.Value is the KEY here. Not including .Value will throw Syntax errors in App Designer when you try to assign the date field to "" and save your program.
Getting the time in the format HHMMSS from the current time:
Getting time in the format HHMMSS from the current time:
Local &strCurrentTime;&strCurrentTime = Substring(Substitute(String(TimePart(%Datetime)), ".", ""), 1, 6);
This takes the time part of the current date time on the application server, replaces the dot (.) seperators with blanks, and returns only the first 6 characters (hhmmss) ignoring the millisecond part. This returns say a time of 11.52.00.000000 as 115200. I used this in an application to rename a file with a date & time stamp.
Use %DateOut to Get Dates from SQL into a Date Variable
If you are using a date that is returned from SQL and storing it into a date variable, make sure you wrap your date with %DateOut in your SQL, otherwise PeopleSoft will throw an invalid date error.
Date and Time in PeopleCode的更多相关文章
- 一些peoplecode小技巧【一】
1. Get the description of the translate value: No need to write SQLEXEC on PSXLATITEM passing fieldn ...
- PeopleCode 处理压缩文件
PeopleSoft中对文件附件的处理都是单个文件处理的,虽然在8.52版本新增了MAddAttachment(URLDestination, DirAndFilePrefix, Prompts, ...
- JavaScript Date对象
本篇主要介绍 Date 日期和时间对象的操作. 目录 1. 介绍:阐述 Date 对象. 2. 构造函数:介绍 Date 对象的构造函数new Date()几种方式. 3. 实例方法:介绍 Date ...
- ExtJS 4.2 Date组件扩展:添加清除按钮
ExtJS中除了提供丰富的组件外,我们还可以扩展他的组件. 在这里,我们将在Date日期组件上添加一个[清除]按钮,用于此组件已选中值的清除. 目录 1. Date组件介绍 2. 主要代码说明 3. ...
- Java 时间类-Calendar、Date、LocalDate/LocalTime
1.Date 类 java.util.Date是一个"万能接口",它包含日期.时间,还有毫秒数,如果你只想用java.util.Date存储日期,或者只存储时间,那么,只有你知道哪 ...
- 为什么你SQL Server的数据库文件的Date modified没有变化呢?
在SQL Server数据库中,数据文件与事务日志文件的修改日期(Date Modified)是会变化的,但是有时候你会发现你的数据文件或日志文件的修改日期(Date Modified)几个月甚至是半 ...
- mysql5.x升级至mysql5.7后导入之前数据库date出错的解决方法!
mysql5.x升级至mysql5.7后导入之前数据库date出错的解决方法! 修改mysql5.7的配置文件即可解决,方法如下: linux版:找到mysql的安装路径进入默认的为/usr/shar ...
- date命令
GNU的date提供+%s(小写s), 能打印出自1970-01-01 00:00:00到当前时间的秒数. 这可能大家都不陌生,但有两点需要注意: 1. %s存在于GNU扩展版本.像在solaris等 ...
- 【Spring】SpringMVC中浅析Date类型数据的传递
在控制器中加入如下代码: @InitBinder public void initBinder(ServletRequestDataBinder bin){ SimpleDateFormat sdf ...
随机推荐
- SQL Server 2005 不允许远程连接解决方法
刚刚安装的数据库系统,按照默认安装的话,很可能在进行远程连接时报错,通常是错误:“在连接到 SQL Server 2005 时,在默认的设 置下 SQL Server 不允许进行远程连接可能会导致此失 ...
- SQL递归查询
WITH cte AS ( AS lvl FROM Department UNION all FROM cte c inner join Department d ON c.Pid = d.Id ) ...
- 立体匹配:关于理解middlebury提供的立体匹配代码后的精减
Middlebury立体匹配源码总结 优化方法 图像可否预处理 代价计算可否采用BT方式 可选代价计算方法 可否代价聚合 可否MinFilter优化原始代价 WTA-Box 可以 可以 AD/SD 可 ...
- MSSQL中的随机函数
随机函数:rand()在查询分析器中执行:select rand(),可以看到结果会是类似于这样的随机小数:0.36361513486289558,像这样的小数在实际应用中用得不多,一般要取随机数都会 ...
- .NET类型转换的常用方式
第一.隐式转换 byte, short, int, long, fload, double 等,根据这个排列顺序,各种类型的值依次可以向后自动进行转换 如果需要逆转换,则需要进行强制转化.同时考虑溢出 ...
- [C# 基础知识系列]C#中易混淆的知识点
一.引言 今天在论坛中看到一位朋友提出这样的一个问题,问题大致(问题的链接为:http://social.msdn.microsoft.com/Forums/zh-CN/52e6c11f-ad28-4 ...
- Android常用知识笔记
1. 安卓图片自适应 android从1.6和更高,Google为了方便开发者对于各种分辨率机型的移植而增加了自动适配的功能 <supports-screens android:largeS ...
- Python面试里面的那些问题
Q:Python里面的数据结构都有哪些? 答:str,list,tuple,set,frozenset,dict,以上是Python默认的数据结构,还有容器类型collections,其中包含:Cou ...
- 接口自动化的根基--HTTP协议
点击标题下「蓝色微信名」可快速关注 坚持的是分享,搬运的是知识,图的是大家的进步,没有收费的培训,没有虚度的吹水,喜欢就关注.转发(免费帮助更多伙伴)等来交流,想了解的知识请留言,给你带来更多价值,是 ...
- 百度校招面试经历及总结(已发offer)
听说发面经可以攒rp,希望早点给我确定的offer通知,也希望看到这个面经的小伙伴能顺利拿到心仪的offer~ 职位:机器学习-数据挖掘工程师 9.15 上午11点 一面 1.介绍项目 2.考研意向, ...