.Net DLL Dispatch.EitherField SaveChanges() not working

We are experiencing inconsistent results when saving a new Opportunity record created using a .Net DLL application. The application displays metadata screen panels from the Person, Address and Opportunity entities, all on one form. Pressing Save button inserts to the Company and all related tables down to the new Opportunity. We instantiate a "new Record()" and fill with SetField() methods, e.g.:

Record opportunityRec = new Record("opportunity");

OpportunityGuestCard.Fill(opportunityRec);

opportunityRec.SetField("oppo_stage", OppStage);

opportunityRec.SetField("oppo_numbr", NumBR);

opportunityRec.SetField("oppo_numba", NumBA);

When all fields have been set, we use:

opportunityRec.SaveChanges();

The variables, e.g. OppStage, NumBR, NumBR are all defined using Dispatch.EitherField(), e.g.:


string NumBR = Dispatch.EitherField("oppo_numbr");

string NumBA = Dispatch.EitherField("oppo_numba");

string OppStage = Dispatch.EitherField("oppo_stage");

The values of these fields are captured correctly as I can write them out to the eWare System log. So this LogMessage():

LogMessage("System", "USI: NumBR / NumBA / Traffic / NumParkingSpaces / NumOccupants = " + NumBR + " / " + NumBA + "/" + Traffic + " / " + NumParkingSpaces + " / " + NumOccupants, 5);

produces this output in the log file:

May 11 2017 11:48:26.776 4188 4224 5 USI: NumBR / NumBA / Traffic / NumParkingSpaces / NumOccupants = 3 / 2/Walkin / 2 / 3


Here's the problem: of the 20+ fields on the Opportunity panel, some 6 do not save to the database. So for example, Stage saves but not # BR, # BA. The only patterns I can see are that the fields that don't save are either Selection or Multi-Line text fields, and they're all custom fields. Built-in Selection (e.g. oppo_stage) and Multi-line Text (e.g. oppo_note) all work fine.



This code has worked for years so I'm wondering if something might have changed in CRM 2017 R1?