Customization using updatable BAQ in a grid does not allow for editing the updatable BAQ column

I’ve created and tested an updatable BAQ from the BAQ designer. The BAQ is used in a screen customization of to populate a grid using the subscription method. The only column that requires updating is the Task Comment column in the Task Table. The grid row list populates accordingly but does not allow for updating of the target column. When testing the customization the target column field Task.TaskComment remains read only and does allow editing within the grid. I am not sure what else needs to be done.

        // - 12-JUN-2018 - Task > List> tab
	public void CreateTaskListBAQView()
	{

		// Initialize the BAQDataView by giving it the BAQ name that will be used.
		// 30-OCT-2018
		// Changed the BAQ to updatable for the TaskComment field. 
		baqViewTaskList = new BAQDataView("MGA-TEST7");
		//baqViewTaskList = new BAQDataView("MGATaskList-V6");

		// This will add the BAQDataView to the form, so we can bind it to the grid. The DataView will be called "CustTrackershipment".  
		oTrans.Add("MGATaskList",baqViewTaskList);

        //string pubBinding  = "Task.DueDate";  // this is the actual table name from the Task view. 
        string pubBinding2 = "Task.SalesRepCode";  // this is the actual table name from the Task view. 
		//IPublisher pub  = oTrans.GetPublisher(pubBinding); // if the publisher exist, then a publisher name will be returned. 
        IPublisher pub2 = oTrans.GetPublisher(pubBinding2);

		// The following code is only needed if the filter field "Customer.CustID" have NOT been published. In this case I am using a standard column. 
        // Most likely the CustID is published. If this was an uncommon column like a UD field, I would need to check and publish the field. The code in 
		// place will check for this condition. The purpose of the publisher, is everytime the Customer.CustID is changed, the new value becomes available
		// and the BAQ DataView is filtered accordingly. The BAQ DataView will have all the customers in it.  	
				
		//if(pub==null) // if no publisher
		//{
			//MessageBox.Show("if not null".ToString());
		//	oTrans.PublishColumnChange(pubBinding, "MyCustomPublish1");  // publish it
		//	pub = oTrans.GetPublisher(pubBinding); // get a hold of that publisher 
		//}
		if (pub2==null)
		{
			//MessageBox.Show("if not null".ToString());
			oTrans.PublishColumnChange(pubBinding2, "MyCustomPublish2");  // publish it
			pub2 = oTrans.GetPublisher(pubBinding2); // get a hold of that publisher 
        }
		// MessageBox.Show("before if pub != null".ToString());
		//if(pub !=null) // if we have that publisher available then we want to subscribe (filter) the BAQDataView to that publisher
		// Filter on Task_SalesRepCode. 
		//baqViewTaskList.SubscribeToPublisher(pub.PublishName, "Task_DueDate"); // this is the actual column name from the BAQ
		if (pub2 != null)
        baqViewTaskList.SubscribeToPublisher(pub2.PublishName, "Task_SalesRepCode"); // this is the actual column name from the BAQ

// MGA - 18-JUL-2018, make the Task DV the child of the custom MGAtaskList DV
		edvTask = (EpiDataView) oTrans.EpiDataViews["Task"];
		this.edvTask.SetParentView(baqViewTaskList,"Task_Key1", "Key1", "=");
		//this.edvTask.SetParentView(baqViewTaskList,"Task_SalesRepCode", "SalesRepCode", "=");

The BAQDataView was designed as a ReadOnly view and while it is possible to get it to do what you want, it requires a truck load of EpiMagic - far more than is practical to discuss in forum postings.

You are better off embedding an Updateable Dashboard.

4 Likes

Thank you for the prompt suggestion. Just to be clearer so that I can better understand your solution, I would have to create a new tab/sheet with an embedded dashboard that would use the BAQ. This would solve the multiple row update/save issue, but would create many new questions/issues:

  1. Can the dashboard be used as a subscription to the Task dataview SalesRepCode column?

  2. Will I be able to make the existing “Task” dataview a child of the embedded dashboard?

i agree with @Rich on embedding an updatable dashboard, but did not have to do it so far.

Open with Dashboard to active record

the other possible option is to embed a UD table as a child to your UI table, this will give you the functionality of updating/adding any record you want from that UI screen, becouse it will add the UD Contract adapter assembly dll to your UI/BO

Embedded Dashboards can be configured to Subscribe to data published from the UI - so to your question 1, Yes.

On question 2 - perhaps. I don’t understand your need/use case but you can easily configure the Dashboard to have an additional BAQ (filtered by a value from the first BAQ) to get additional data. The embedded DBD can also “Publish” to the UI - not sure that would be useful here but it is a capability.

Extending on Al’s suggestion to use a UD table as a child, you could then add a BPM to the UD table update (conditionally fired only when that specific Customization is doing the Update) that would update the Task Comment from data entered in one of the UD table columns. Kind of a messy solution having multiple parts doing the work, but possible (if you go this route document both sides really well).

Thank you both, The original goal was to replace the TaskList screen, List (dataview)> grid with a BAQ dataview. I was able to achieve this by using the BAQ-dataview which subscribes to the Task dataview SalesRepCode. In this way, the BAQ dataview is filtered on the SalesRepCodeID selected from the TaskList> Detail sheet. But more importantly, when the user clicks on the row of the BAQ dataview, the TaskList Detail> sheet is updated accordingly, this is achieved by making the TaskLIst> List dataview parent-view the BAQ dataview. As a result, the TaskList> Detail fields are updated each time the BAQ dataveiw row is changed/clicked on.

Can anyone verify if the publish subscribe functionality with embedded dashboard assemblies works in any version above 10.2.200.8? If you want a dashboard updatable, you need to use a dashboard assembly. In 10.2.200.8 the subscribe functionality only works with runtime dashboards. I submitted a ticket in the summer and problem indicates it’s fixed in 3.2.400.
If anyone is curious it’s PRB0205098

1 Like

From the code above that Mazin posted. What would need to change to add an updateable dashboard to the grid rather than a BAQ?