You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using recordStorage.GetRecordByUniqueId, the propery RecordFields return the fields in a diffrent order than on the form.
Reproduction
Lets say i have this code in a controler, where i get the record, update a field and update te status to Approved:
viewModel.Entry = _recordStorage.GetRecordByUniqueId(entry ?? Guid.Empty, viewModel.Form);
if (isApproved && viewModel.Entry.State != FormState.Approved)
{
// Update Approve fields
foreach(var approveField in viewModel.ApproveFields)
{
foreach (RecordField recordField in viewModel.Entry.RecordFields.Values)
{
if (recordField.Field.FieldTypeId == approveField.FieldTypeId)
{
recordField.Values.Clear();
recordField.Values.Add(string.Format("{0} at {1} by {2}", DateTime.Now.ToString("d MMMM yyyy", cultureinfo), DateTime.Now.ToString("H:mm"), member.Name));
}
}
}
// Update Record
_recordStorage.UpdateRecord(viewModel.Entry, viewModel.Form);
// Approve Record
_recordService.Approve(viewModel.Entry, viewModel.Form);
Than the problem is that the Razor Mail Workflow in the On Approved section is having random ordered recordfields and send the mail with fields in random order.
Expected result
While Record.RecordSet is a dictonary, which has no particular order, i would expect that RecordFields are returned in the formfield order, like in the On Submit -workflow.
Actual result
Record.RecordSet items are in random ordered.
The text was updated successfully, but these errors were encountered:
Hi - I can see as you say we're using dictionaries here to expose the field data, so it's possible we strictly shouldn't be able to rely on the order. But that said, I'm not able to replicate this trying to set up an analogous test - I've used similar approval code to what you have here and I find the order of the fields on an email send on submit and on approve to be the same.
Could you confirm what version of Forms you are running please?
We're using 8.7.6. We found out that de order where the records are in the UFRecordsFields table is also random. recordStorage.GetRecordByUniqueId reads them in the same order as they are stored in de table.
When using recordStorage.GetRecordByUniqueId, the propery RecordFields return the fields in a diffrent order than on the form.
Reproduction
Lets say i have this code in a controler, where i get the record, update a field and update te status to Approved:
Than the problem is that the Razor Mail Workflow in the On Approved section is having random ordered recordfields and send the mail with fields in random order.
Expected result
While Record.RecordSet is a dictonary, which has no particular order, i would expect that RecordFields are returned in the formfield order, like in the On Submit -workflow.
Actual result
Record.RecordSet items are in random ordered.
The text was updated successfully, but these errors were encountered: