Question

Price List Inquiry

  • 7 February 2022
  • 1 reply
  • 195 views

How can i set it so that anytime a user is looking up a price for a customer in price list inquiry and the part# is discontinued/ inactive they get a warning or pop up stating the part # is inactive or discontinued. Tried going the BPM route, but couldnt figure it out. This is because price list inquiry uses the part DB Field

 

 

 


1 reply

I did this with the help of someone else. We did a customization on the form to add an epishape named shpInactiveFlag and change its visibility based on the following Script. The epishape is set with Visible as False, a BackColor of yellow and a EnabledCaption of Inactive. The Script makes the epishape visible if the Part entered on the Price List Inquiry criteria form is Inactive.

 

// **************************************************
// Custom code for PriceListInquiryForm
// Created: 9/26/2017 8:42:20 AM
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Erp.Adapters;
using Erp.UI;
using Ice.Lib;
using Ice.Adapters;
using Ice.Lib.Customization;
using Ice.Lib.ExtendedProps;
using Ice.Lib.Framework;
using Ice.Lib.Searches;
using Ice.UI.FormFunctions;

public class Script
{
    // ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
    // Begin Wizard Added Module Level Variables **

    private EpiDataView edvPart;
    // End Wizard Added Module Level Variables **

    // Add Custom Module Level Variables Here **

    public void InitializeCustomCode()
    {
        // ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
        // Begin Wizard Added Variable Initialization

        this.edvPart = ((EpiDataView)(this.oTrans.EpiDataViews["Part"]));
        this.edvPart.EpiViewNotification += new EpiViewNotification(this.edvPart_EpiViewNotification);
        // End Wizard Added Variable Initialization

        // Begin Wizard Added Custom Method Calls

        // End Wizard Added Custom Method Calls
        shpInactiveFlag.EnabledCaption = "Inactive";
        shpInactiveFlag.DisabledCaption = "";
        shpInactiveFlag.Enabled = false;
        shpInactiveFlag.Visible = false;
        shpInactiveFlag.Status = StatusTypes.Warning;
                
    }

    public void DestroyCustomCode()
    {
        // ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
        // Begin Wizard Added Object Disposal

        this.edvPart.EpiViewNotification -= new EpiViewNotification(this.edvPart_EpiViewNotification);
        this.edvPart = null;
        // End Wizard Added Object Disposal

        // Begin Custom Code Disposal

        // End Custom Code Disposal
    }

    private void edvPart_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.AddRow))
        {
            if ((args.Row > -1))
            {
                bool bInactive = (bool) view.dataView[args.Row]["Inactive"];
                shpInactiveFlag.Enabled = bInactive;
                shpInactiveFlag.Visible = bInactive;
                
            }
            else
            {
                shpInactiveFlag.Enabled = false;
                shpInactiveFlag.Visible = false;
            }

        }
    }
}
 

Reply