Application Studio Help!

@Pgilbert I was just going to tell you how this worked in classic and hope it worked the same, but I took the opportunity to do the process in Kinetic since I had not before and it was very close to classic.

I added a field called volume_c to the SugPODtl table and then regenerated the data model. Reopened Epicor and the field showed in the data section @jwphillips showed above and was available to add to the grid in application studio. I added a NetVolume to the top part in my list and reopened the screen and got a calculation.

image

/* calc */


foreach (var ttSugPoDtlRow in result.SugPoDtl)
{

    var netVolume = Db.Part.Where(x=>x.Company == CompanyID && x.PartNum ==  ttSugPoDtlRow.PartNum).Select(x=>x.NetVolume).FirstOrDefault();
    
    if(netVolume != null && netVolume != 0)
    {
      var volume = netVolume * ttSugPoDtlRow.XRelQty;

      ttSugPoDtlRow.SetUDField<Decimal>("volume_c",volume);

      Ice.Diagnostics.Log.WriteEntry($"Part {ttSugPoDtlRow.PartNum} volume {volume}");

    }  
}
2 Likes