Hey there,
I have the following code connecting a BAQ to a grid in UD106:
public class Script
{
...
public void InitializeCustomCode()
{
private static BAQDataView _edvBAQQuoteOrderDisplay;
...
public void setQuoteOrderDisplayView()
{
_edvBAQQuoteOrderDisplay = new BAQDataView ("TCF_ChangeOrderQOLookup"); // name of BAQ
oTrans.Add("BAQQuoteOrderDisplayView", _edvBAQQuoteOrderDisplay); // creates dataview
// publish 1
string pubBinding = "UD106.Key1"; // publishes name in UD106 for dataview from BAQ
IPublisher pub = oTrans.GetPublisher(pubBinding);
if (pub == null)
{
oTrans.PublishColumnChange (pubBinding, "MyCustomPublish");
pub = oTrans.GetPublisher (pubBinding);
}
if (pub != null)
{
_edvBAQQuoteOrderDisplay.SubscribeToPublisher(pub.PublishName, "Calculated_TypeQuote"); // subscribes to UD106 dv based on baq type order
}
// publish 2
pubBinding = "UD106.QuoteOrderNum_c";
IPublisher pub2 = oTrans.GetPublisher(pubBinding);
if(pub2==null)
{
oTrans.PublishColumnChange(pubBinding, "MyCustomPublish2");
pub2 = oTrans.GetPublisher(pubBinding);
}
if(pub2 != null)
_edvBAQQuoteOrderDisplay.SubscribeToPublisher(pub2.PublishName, "QuoteHed_QuoteNum");
}
The baq dataview is connected to a grid in the grid’s epibinding.
It works fine on the very first record loaded after opening the form. It displays data from the BAQ corresponding to the current data row.
But it never changes after that. It leaves the original record in the grid even when I navigate through the open record list in the tree or choose new records the search button.
If I clear the form or create a new record, the baq data stays displayed until I load a new record and then the grid is empty and never populates until I close and reopen the form.
I have a couple of baq dataviews like this in the form and they both show the same behavior.
I saw a piece of code originating from Jose Gomez and put this version of it in an epidataview notification:
(using System.Reflection;)
MethodInfo mi = _edvBAQQuoteOrderDisplay.GetType().GetMethod("invokeExecute", BindingFlags.Instance | BindingFlags.NonPublic); mi.Invoke(_edvBAQQuoteOrderDisplay, new object[]{ true });
It didn’t error, but didn’t refresh the baq dataview, either.
Any thoughts?
Thanks,
Joe