I know I’m late here, but I’ve created an almost identical customization using the solution @josecgomez provided (here Adding a column to a grid that is not in the collection - #2 by josecgomez), and my custom BAQView on related PO’s in the Project Entry form only works for some projects. I’ve published subscribe to Project.ProjectID, and everything else seems to be correct, but I cannot figure out why it only works on some projects and not others (who definitely have related PO’s)
Anyone have an idea what the issue could be here?
Sorry for necroposting! I just can’t seem to figure this one out.
public class Script
{
// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
// Begin Wizard Added Module Level Variables **
// End Wizard Added Module Level Variables **
// Add Custom Module Level Variables Here **
BAQDataView baqView;
public void InitializeCustomCode()
{
// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
// Begin Wizard Added Variable Initialization
// End Wizard Added Variable Initialization
// Begin Wizard Added Custom Method Calls
// End Wizard Added Custom Method Calls
CreatePOBAQView();
}
public void CreatePOBAQView()
{
baqView = new BAQDataView("md_ProjectEntryPO");
oTrans.Add("md_ProjectEntryPOBAQ",baqView);
string pubBinding = "Project.ProjectID";
IPublisher pub = oTrans.GetPublisher(pubBinding);
if(pub !=null)
baqView.SubscribeToPublisher(pub.PublishName, "PORel_ProjectID");
My BAQ is filtered to only show PO’s with releases that have a Project ID to make the query load efficiently in the form. It works beautifully on some projects, but other projects don’t populate any rows in the grid when there are definitely PO releases associated with those projects.
and you are sure that the BAQ returns results correctly for those Projects? That is if you run the BAQ with one of these project it returns results correctly (if run manualy)?
It doesn’t seem to matter.
I’ve tried searching and typing the Project ID and both ways produce the same result.
I tried completely closing out and relaunching the form and that doesn’t seem to make a difference either.
The user that requested this customization wanted to see what G/L Accounts the PO Releases were going to, so incorporating the TranGLC (using Key1, Key2, & Key3 as relationship criteria with the PO Rel Table’s PO Num, Line, and Release fields) and GLAcctDisp tables caused the BAQ View’s publisher to only grab rows for the associated project that weren’t pulling data from these tables.
This is why it originally worked on only 1/3 of the projects (which was the only project that wasn’t pulling data from these tables).
As soon as I removed these two tables from my query, it works like a charm!
That’s exactly how I had it written!
So in my query, it all worked great and did exactly what I wanted it to.
It included records that had GL Account information and records that did not.
But the fact that it only loaded rows into the grid for a project with related PO’s that had no GL Account details was the telling factor.
I don’t understand why, but as soon as I removed those tables from my query, it works great.