如何检查日期字段是否为空白。 [英] How do I check if date field is blank.

查看:101
本文介绍了如何检查日期字段是否为空白。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,



我是编程新手,我正在尝试创建以下工作流程的第一个代码(VB或c#)。



我的ERP中有一个日期字段,如果它的空白,它应该给出错误消息不能为空,否则允许用户完成文档。



我们将非常感谢您的帮助...



感谢您

ROSS



我尝试了什么:



我是编程新手,只是试过下面的代码:



如果[DELIVERY_DATE.NewValue] =00:00:00那么

msgbox请输入交货日期

其他

msgbox请求批准

如果

Dear all,

I am new to programming, I am trying my first code (VB or c#) in creating below workflow.

I have a date field in my ERP and if its blank it should give an error message "Cannot be Blank", else allow the user to finalize the document.

Your help will be highly appreciated...

Thanking you
ROSS

What I have tried:

I am new to programming, just tried the code below:

if ["DELIVERY_DATE.NewValue"] = "00:00:00" then
msgbox "Please enter Delivery Date"
Else
msgbox "Queue In for Approval"
End if

推荐答案

结束您必须记住,我们无法看到您的屏幕,无法访问您的硬盘,无法读懂您的想法 - 我们只能 完全 您键入的内容来自。

所以我们不知道你的数据是什么 - 而你似乎也不是!



所以先找出来。使用调试器在此行上设置断点:

You have to remember that we can't see your screen, can't access your HDD, and can't read your mind - we only get exactly what you type to work from.
So we have no idea what is in your data - and it seems neither do you!

So start by finding out. Use the debugger to put a breakpoint on this line:
if ["DELIVERY_DATE.NewValue"] = "00:00:00"

(假设它编译,我不相信它会)并运行你的应用程序。当调试器到达断点时,它将停止并让您控制正在发生的事情 - 包括在代码运行时查看变量内容的能力。

查看字段,直到找到真正空的字段(即数据源中的字段为空),它应该显示要测试的内容。



我们不能为您做到这一点:我们只是无法访问您的数据!

(Assuming it compiles, which I'm not convinced it will) and run your app. When the debugger hits the breakpoint, it will stop and let you take control of what is going on - including the ability to look at variable contents while you code is running.
Look at the field until you find a genuinely empty field (i.e. one in your data source that is empty), and it should show you what to test for.

We can't do that for you: we just don't have access to your data!


这篇关于如何检查日期字段是否为空白。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆