Hi All,
I’m trying to set a DateTime field to blank but can’t seem to work out how to do it.
Any ideas?
Here is the code I’ve been working with.
private void UD100Form_BeforeToolClick(object sender, Ice.Lib.Framework.BeforeToolClickEventArgs args)
{
switch (args.Tool.Key)
{
case "PrintTool":
if (this.txtKeyField.Text == string.Empty)
{
EpiMessageBox.Show("You need a Load Number");
return;
}
LaunchFormOptions lfo = new LaunchFormOptions();
lfo.IsModal = false;
lfo.ContextValue = this.txtKeyField.Text;
ProcessCaller.LaunchForm(oTrans, "OMRM001", lfo);
break;
case "ToolBtnUnlockSales":
if (!string.IsNullOrEmpty(edvUD100.dataView[edvUD100.Row]["EstimatedDateMth_c"].ToString()) && ((DateTime?)edvUD100.dataView[edvUD100.Row]["EstimatedStampDate_c"]).HasValue)
{
DialogResult dialogResult = EpiMessageBox.Show("Are you sure you want to unlock Sales? This will clear the information!","Sales Unlock", MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes)
{
edvUD100.dataView.Table.Rows[0]["AcctsConfirm_c"] = false;
edvUD100.dataView.Table.Rows[0]["EstimatedDateMth_c"] = string.Empty;
//edvUD100.dataView.Table.Rows[0]["EstimatedStampDate_c"] = default(DateTime);
edvUD100.dataView.Table.Rows[0]["EstimatedStamp_c"] = string.Empty;
epiShape_SalesOffice.Visible = false;
return;
}
EpiMessageBox.Show ("There is no data for me");
}
break;
I’ve commented it out at the moment as it’s causing massive issues, any thoughts? The field name is EstimatedStampDate_c
but there is others that use Date
format.
Kind regards,
Aaron.