1 Reply Latest reply on Aug 4, 2017 1:13 PM by Don Jensen

    When building a custom filter for PX is it required to create a second builder to get the design nodes for each work request?

    Don Jensen

      I am trying to use the sample code for creating a custom filter in the process manager for Designer Express.  The list builds in the tree view but there are no designs displayed when the work request nodes are expanded.  The designs are displayed when using out of the box filters.  The documentation says that there is a builder object that is called when the nodes are expanded that is separate from the builder used to create the work request node list.  Am I missing some peace of configuration or do I need to build a second builder object?

        • Re: When building a custom filter for PX is it required to create a second builder to get the design nodes for each work request?
          Don Jensen

           

          The sample code that I downloaded was missing a couple of lines.  Kevin Leben tracked them down for me and I have included the AddToList method below along with the missing lines of code.  They have been isolated and the text made bold.  I could not find a highlight button.

           

          private void AddToList(ID8List list)

           

          using (ComReleaser cr = new ComReleaser())

           

          IWorkspace workspace = ((IMMPxApplicationEx2)_PxApp).Workspace;

           

          ITable table = ((IFeatureWorkspace)workspace).OpenTable(_tableName);

           

          IQueryFilter filter = new QueryFilterClass();

           

          .WhereClause = string.Format("NAME LIKE '{0}'", _workOrderName);

           

          ICursor cursor = table.Search(filter, true);

           

          .ManageLifetime(cursor);

           

          List<int> indexes = new List<int>();

           

          .Add(table.FindField("ID"));

           

          .Add(table.FindField("NAME"));

           

           

           

          IMMListBuilder wrBuilder = (IMMListBuilder)new clsWRBuilderClass();

           

          IMMPxListBuilderInit lbInit = (IMMPxListBuilderInit)wrBuilder;

           

           

           

          .PxApplication = _PxApp;

           

          IRow row;

           

          while ((row = cursor.NextRow()) != null)

           

          int nodeID = (int)row.get_Value(indexes[0]);

           

          string name = (string)row.get_Value(indexes[1]);

           

          IMMPxNodeEdit nodeEdit = new MMPxNodeListClass();

           

          .Initialize(_NodeTypeID, _NodeTypeName, nodeID);

           

          .DisplayName = name;

           

          IMMPxNode node = (IMMPxNode)nodeEdit;

           

          IMMPxApplicationEx)_PxApp).HydrateNodeFromDB(node);

           

           

           

          IMMDynamicList)node).BuildObject = wrBuilder;

           

          IMMDynamicList)node).Build(false);

           

           

           

          .Add((ID8ListItem)node);

           

          .ManageLifetime(table);