Click here to Skip to main content
15,881,588 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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
Posted
Updated 7-May-18 22:02pm
Comments
Richard MacCutchan 8-May-18 3:16am    
You have tagged this question C# and VB, so which is it? And what is DELIVERY_DATE.NewValue supposed to be, as it looks like a simple string from here?
Member 13816603 8-May-18 3:28am    
code can be either in VB or C#.
DELIVERY_DATE is the field in schema.
Member 13816603 8-May-18 3:35am    
Data type of Date is system.DateTime format for each user.

1 solution

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:
VB
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!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900