Can you add a field to a grid with BPM using only widgets (no code)?

Like the title says. Can you do this just using widgets? I/we have it working with a custom code widget, I was just wondering if it could be done with a ‘Update Table’ widget or something like that. Is there any way to do this without writing code? Just trying to not write code unless I have to, and maybe these are better.

In the Method Tracker, material list, we would like to show the Part.NonStock field of the material part.

So I tried using an ‘Update Table’ widget, created a query joining result.PartMtl and Part on Company and PartNum and then tried to configure the mapping. But it doesn’t seem to see the new field. I did add the field to the grid in app studio.

Any suggestions?

1 Like

No.

And the code way is just a bonus. It was not designed that way, and would not have worked with classic.

1 Like

Hmm.. ok thanks

Here is the code by the way:

if(result.PartMtl.Count < 1)
{
    return;
}

string company = result.PartMtl[0].Company;

var partinfo =
 Db.Part
 .Where(p => string.Equals(p.Company, company))
 .Select(p => new {p.PartNum, p.NonStock}).ToList();

 foreach(var row in result.PartMtl)
 {
    string part = row.MtlPartNum;

    var partDtl = partinfo.FirstOrDefault(p => string.Equals(p.PartNum, part));

    row["NonStock"]= partDtl.NonStock;

 }
1 Like

Ok I got it to work, sort of. I used an ‘Update Table by Query’ widget and configured the mapping so that the NonStock value from the designed query maps to the ‘SalvagePartNumTrackSerialNum’ field - which we don’t use. If I then show this field in the grid, it has the correct NonStock values and works. So it’s not a perfect solution by any means, I just wanted to see if it was possible. It seems you can’t add a field/column to the result.PartMtl table without code. I’m not against using code, I just wanted to see if it was possible without, possibly making it easier for someone to maintain in the future.

2 Likes