UD Fields not being updated by standard business methods

Has anyone else had this issue?
I’ve created UD field (ShiftPattern_c) on the table ResourceCal, created a EpiCombo control on the App.ResourceGroupEntry.CalendarForm that binds to the ResourceCal.ShiftPattern_c field. Looking at the trace, I see the custom field value IS passed to the Erp.ResourceGroup.UpdateResourceCal method, but it is never updated in the database.
My understanding is that the standard methods should also update the UD columns… Am I wrong about this?
I can add a post-processing BPM to the UpdateResourceCal to update the UD fields, but this shouldn’t be required, should it?

As long as the control on the form is bound to the field, it should update. I haven’t had to do any additional coding for UD fields. I would carefully look at the trace and see if it’s being changed anywhere. I recently had a process where my update was in the dataset, but when it went through the process it was getting cleared.

That’s what I thought. This is the last method call in the trace and I see the new value there:


I even tried creating a post process on the UpdateResourceCal method to show the data in the tt table and the updated value is there also.
For now, the following is working as a post process of the method, but I’m pretty sure this shouldn’t be required:

using (var txscope = IceDataContext.CreateDefaultTransactionScope())
{

foreach( var ttrecord in ttResourceCal.Where(r=> r.SysRowID.ToString() != “00000000-0000-0000-0000-000000000000”) )
{
//this.PublishInfoMessage("RowID " + ttrecord.SysRowID.ToString() + " Date " + ttrecord.SpecialDay.ToString() + " RowMod: " + ttrecord.RowMod + " Currently " + ttrecord.UDField<System.String>(“ShiftPattern_c”), Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, “”, “”);

var RowForUpdate = Db.ResourceCal.FirstOrDefault(r=> r.SysRowID == ttrecord.SysRowID);
this.PublishInfoMessage("Lets update from " + RowForUpdate.UDField<System.String>("ShiftPattern_c") + " to: " +  ttrecord.UDField<System.String>("ShiftPattern_c"), Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "ResourceGroup", "UpdateResourceCal");
if ( RowForUpdate != null)
{
  RowForUpdate.SetUDField<System.String>("ShiftPattern_c", ttrecord.UDField<System.String>("ShiftPattern_c"));
  Db.Validate();
}

}
txscope.Complete();
}

Anyone know an efficient way to cycle through all the custom columns for an update like this so I don’t have to list them individually?

So if you do a BAQ on this, the update data isn’t in the database?

I do a database query directly:
select * from erp.ResourceCal_ud
Or using the view created:
select * from ResourceCal
The same thing… the ShiftPattern_c column is blank no matter what is set in the method dataset.

I recreated the scenario that you laid out and I get the exact same thing. I attach the label in the CalendarForm, everything else is recorded except the UD entry.

       <ResourceCal>
          <Company>F002</Company>
          <ResourceGrpID>Test</ResourceGrpID>
          <ResourceID>Test1</ResourceID>
          <SpecialDay>2021-03-16T00:00:00-04:00</SpecialDay>
          <ProdHour01>true</ProdHour01>
          <ProdHour02>true</ProdHour02>
          <ProdHour03>true</ProdHour03>
          <ProdHour04>true</ProdHour04>
          <ProdHour05>true</ProdHour05>
          <ProdHour06>true</ProdHour06>
          <ProdHour07>true</ProdHour07>
          <ProdHour08>true</ProdHour08>
          <ProdHour09>true</ProdHour09>
          <ProdHour10>true</ProdHour10>
          <ProdHour11>true</ProdHour11>
          <ProdHour12>true</ProdHour12>
          <ProdHour13>true</ProdHour13>
          <ProdHour14>true</ProdHour14>
          <ProdHour15>true</ProdHour15>
          <ProdHour16>true</ProdHour16>
          <ProdHour17>true</ProdHour17>
          <ProdHour18>true</ProdHour18>
          <ProdHour19>true</ProdHour19>
          <ProdHour20>true</ProdHour20>
          <ProdHour21>true</ProdHour21>
          <ProdHour22>true</ProdHour22>
          <ProdHour23>true</ProdHour23>
          <ProdHour24>true</ProdHour24>
          <SysRevID>0</SysRevID>
          <SysRowID>bf3b47f7-fa8c-4233-9090-f5f7fcf0cded</SysRowID>
          <ExceptionLabel>T</ExceptionLabel>
          <BitFlag>0</BitFlag>
          <RowMod></RowMod>
          <ShiftPattern_c>T</ShiftPattern_c>
        </ResourceCal>

image

1 Like

Thanks for testing. I wonder how support/development will feel about this and whether it’s considered a bug.

I’ve shown where setting a single created variable in a BPM can corrupt data on the incoming dataset. They would not address it. You could try submitting a support case, but you may just have to deal with the workaround.

Yeah, that’s what I suspect. Was hoping that it was something unique to my version or I was doing something silly.
We’ll see what support have to say. Don’t imagine it would be fixed in the current version anyway.