BAQ Dataview subscribe not refreshing with publisher change

I’m hoping this is a simple one. I setup a BAQDV on Inventory Transfer for the express purpose of looking up a specific value in the PkgControlHeader table. Basically, I am using the PkgControlBoolean01 field to toggle whether we are going to allow the PCID to be used. This is obviously tied to the PCID value.

So my BAQDV seems to work as you’d expect for the first result you pull up. But if you enter a new PCID, it doesn’t refresh the EpiDataView associated to the BAQDV. Am I missing an obvious step? I did setup a pub/sub in the initial BAQDV creation. Here’s the code I used for that.

	public void CreatePCIDHeaderDV()
	{
		PCIDHeaderDV = new BAQDataView("BAQDV_PCIDClosed");
        oTrans.Add("PCIDClosed", PCIDHeaderDV);
        string pub1Binding = "view.PCID";
        IPublisher pub1 = oTrans.GetPublisher(pub1Binding);
        if (pub1 == null)
        {
            string pubName = Guid.NewGuid().ToString();
            oTrans.PublishColumnChange(pub1Binding, pubName);
            pub1 = oTrans.GetPublisher(pub1Binding);
        }
        if (pub1 != null)
            PCIDHeaderDV.SubscribeToPublisher(pub1.PublishName, "PkgControlHeader_PCID");

	}

My BAQ literally consists of two columns, PCID and PkgControlBoolean01.

The only time I’ve seen something like this is if the Binding isn’t correct. Are you sure that “view.PCID” is the right binding?

Also are you sure you spelled the column name correctly in the SubscribeToPublisher bit?

Is there something in Inventory Transfer that doesn’t function like a normal form when you go between PCIDs/parts? Can I force a publish when the PCID field is changed on the form? When I clear the form, and enter a PCID, it works properly. It only doesn’t work if I jump between two that I have opened.

There are three views in that form with PCID in it. view.PCID is what the field is bound to on the form. Part.PCID also seems to work (on initial PCID). PkgControlSearch.PCID does not work.

OK. I’ve narrowed it down. If I load multiple records and navigate using the play button at the top, it updates my field properly. If I just type in the PCID box it does not. Maybe that’s normal behavior? But I’ve never noticed that on other forms…

The inventory transfer screen is goofy when it comes to the data views.

1 Like

I’m trying to force something… I thought if I create an event on the textbox that looks for the value to change, I’d be able to manually Notify the system of the change to the row. Am I looking to notify the EDV? Which one? And is there a logical event that is the “last” event to trigger on?

Try using

yearPub .PublishInitialValue("5672258",true);

Where “yearPub” is pub1 (in your case) you’ll have to make it a global variable to call it later.

1 Like

Am I adding to the CreatePCIDHeaderDV() function? Or am I adding it on my Event for text value change? Or somewhere in between?

I figured it out. That worked like a charm. I stuck it in my EpiViewNotification for the view EDV and set it like this:

pub1.PublishInitialValue(view.dataView[args.Row]["PCID"].ToString(), true);

THANKS @josecgomez

2 Likes