Custom button remaining available in Order Entry if order is closed?

Have added a button to the Order Entry form that when clicked, opens a network file path that includes the Order Date year as well at the Order Number in the path, in windows file explorer…works great. Is there a way to make that button available/active regardless of the order being closed? Right now if the order is closed, all fields on the Order Entry form are disabled.

Is it bound to a field? If it is, you can change the Extended Properties to ReadOnly = false.
Otherwise, you may have to add code to OrderHed.EpiViewNotification to enable the button.

Hmm, no, it’s not bound to a field because it’s just executing the “open explorer” code when clicked.

Like Jason said, add the OrderHed.EpiviewNotification event.
Then when your button is clicked you could check if the dataview as a CurrentDataRow.
someting like

if(edvOrderHed.CurrentDataRow != null)
{
  //do what your click does
string order = edvOrderHed.CurrentDataRow["OrderNum"].ToString();
}

Awesome, thank you both! For future reference, this is what worked (the button is called Attachments_btn):

private void edvOrderHed_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
{
	if(edvOrderHed.CurrentDataRow != null)
	{
		Attachments_btn.ReadOnly = false;
		{
		}
	}
}
1 Like