How to add epiShape buttons (for dummies)?

I’d like to add an epiShape button to Sales Order Tracker that appears when a UD field is true, similar to the eshOrderHeld epi shape.

I’ve added it to the Summary panel as eshAIAReqd, set visibility = false and bound it to the OrderHed.AIAReqd_c ud field in the properties. Now I’m confused on what the next step is.

Do I need to add code for an EpiShape Event Wizard on the Load event? Do I need to add a checkbox variable (like @Chris_Conn mentions) & initialize them? Do I need to mess with data views?

I’ve tried to find an example to clone, but haven’t yet. Once I get this working, I’ll clean up the post as a how-to. Thanks for the help!

Some reference posts I’ve been trying to absorb:

Depends on what your intention is.

A single color shape the hides or unhides on certain conditions?
A shape that is always visible but changes color on different conditions?

Chris - Option 1 - single color shape that is hidden by default, but unhides when Orderhed.AIAReqd_c = TRUE. I was planning on using the yellow StatusTypes.Warning somewhere.

But I’d love to learn about Option 2 later, to add to the bag of EpiTricks.

Thanks!

I’m sure someone smarter than me has figured it out, but I’ve never been able to get a custom EpiShape behaving exactly as I’d like. Each time I’ve tried I ended up using a regular textbox instead, which seems much easier to paint / hide exactly as desired.

I use epiShapes all the time. With what you’re wanting to do with it, you might want to put code in the EpiViewNotification routine. Such as:

private void edvOrderHed_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
{
  // ** Argument Properties and Uses **
  // view.dataView[args.Row]["FieldName"]
  // args.Row, args.Column, args.Sender, args.NotifyType
  // NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
  if ((args.NotifyType == EpiTransaction.NotifyType.Initialize))
  {
    if (args.Row >= -1)
    {
      shpCustom.Visible = true;
      if ( (bool)view.dataView[args.Row]["FieldName"] == true )
      {
        shpCustom.EnabledCaption = "Everyone is happy";
        shpCustom.Status = StatusTypes.OK;
      }
      else
      {
        shpCustom.EnabledCaption = "Everyone is sad";
        shpCustom.Status = StatusTypes.Error;
      }
    }
    else
    {
      shpCustom.Visible = false;
    }
  }
}
1 Like