Error creating a tableset

This is my first attempt at trying to call a BO from code in a BPM. After hunting around, this seems to be the approximate skeleton, but I’m getting the error below simply trying to create the tableset. I have no idea what other assembly or using statement to add, aside from Erp.Contracts.BO.BomSearch, which I have already added.

The type or namespace name ‘BomSearchTableset’ could not be found (are you missing a using directive or an assembly reference?)

// Assemblies:
//  Erp.Contracts.BO.BomSearch
//
using (var bomTran = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.BomSearchSvcContract>(Db))
{
    string      vPartNum        = "MYPARTNUM";
    string      vRevision       = "A03";
    
    //var ds = new Erp.Tablesets.BomSearchTableset();

    Erp.Tablesets.BomSearchTableset ds = new BomSearchTableset();

    //bomTran.GetDatasetForTree(ref ds, vPartNum, vRevision, "", true, DateTime.Today, true);
    //ds.GetDatasetForTree(vPartNum, vRevision, "", true, DateTime.Today, true);
   /**
    if (ds != null)
    {
        foreach (var row in ds.Tables[0].Rows) 
        {
            // todo
        }
    }
    else
    {
        //
    }
    **/
}

In your line here:

Erp.Tablesets.BomSearchTableset ds = new BomSearchTableset();

You correctly use the full namespace for the left side of the assignment, but not the right. Either:

  1. Add Erp.Tablesets to your using statements and not worry about it again.
  2. Add Erp.Tablesets before BomSearchTableset every time you use it.

Ah thank you! Option 2 fixed it. For some reason, option 1 did not make any difference.

This doesn’t work?

Hmm, it is working now. I must have mistyped it. Thanks!