I am having trouble with binary fields and had to develop a hack to work around it. It's been working, but I'd like to find a proper way to update binary fields.
I have a field called SecurityMask for my CustomerEntity. SecurityMask is a binary 20 field. Here is the code that we use that works:
byte[] bySecurityMask = oCustomer.SecurityMask;
oCustomer.SecurityMask = new byte[]{0};
...
//some code that changes bySecurityMask
...
oCustomer.SecurityMask = bySecurityMask;
adapter.SaveEntity(oCustomer);
Here is the code that doesn't work:
byte[] bySecurityMask = oCustomer.SecurityMask;
...
//some code that changes bySecurityMask
//Technically it's just changing oCustomer.SecurityMask since
//it's a pointer, but we like to seperate out our variables.
...
oCustomer.SecurityMask = bySecurityMask;
adapter.SaveEntity(oCustomer);
For some reason, we have to set our binary fields to a new array, then set the value we want before the change is accepted.
This is for all binary fields on all entity, not just for this particular Entity.
Anyone know what is going on here? Is it because the pointer value is not updating that SecurityMask is not updating when saving? That's the best that I could figure out.