Hi, am attaching to the BeforePublsh to set a property value of a document type. It works fine, but now I want to check if the user has entered a value before attempting to set it programatically. Here' what I have:
//Always LOG Log.Add(LogTypes.Custom, sender.Id, "Attempting to set the expiration date of CLASSIFIED AD: " + sender.Text);
if (sender.ContentType.Alias == "ClassifiedAd") { DateTime dt = DateTime.Now; if (sender.getProperty("adExpirationDate").Value == null) sender.getProperty("adExpirationDate").Value = dt.AddDays(21); }
Log.Add(LogTypes.Custom, sender.Id, "Expiration set successfully: " + sender.Text);
When the date has been left blank, the Value is not null. How can I check if it is empty?
Checking if proprty is null OR empty
Hi, am attaching to the BeforePublsh to set a property value of a document type. It works fine, but now I want to check if the user has entered a value before attempting to set it programatically. Here' what I have:
When the date has been left blank, the Value is not null. How can I check if it is empty?
Thanks,
Nik
Does that work??
Awesome, should have thought of that. Thanks!
You could possibly also do this (just to shorten it down a bit):
is working on a reply...