01-14-2019 06:32 AM
After moving to the .NET library using version 21 update 5. the attached code broke. Now setting a opportunity field throws an unexpected and unclear exception.
The main offender is the following.
opportunity.OpportunityFields["Quote Number", FieldNameType.Alias] = quoteIDFormatted;
The file attached is a quick program that can be run which isolates the issue. This was the best way to diagnose the problem since debugging is broken in the latest version (I know there is a way around it by attaching after it logs in but that is just as annoying as writing test programs and using print statements).
This is clearly a bug since there should never be an exception throw from string.format unless I was to call it directly. This could be an error when trying to create an exception message about the real cause of the error. Either way it hinders the ability to develop using this platform.
In some of the comments were some experimentation done of other ways to set these fields. It should be noted that the connect is correct. I can see all of the fields and writing to a custom field that does not exist does throw an exception with a clear description of why it fails. Tried some weird things too like setting the FieldNameType.Display and Real and Alias with the alias name, and the real name and the same thing happens.
Any hint/hack/bugfix/workaround/explaination would be greatly appreciated.
02-14-2019 06:38 AM
I was using v21 update 5 when testing (release December last year). I was not able to attach the debugger until after 'LogOn' was that patch.
There is still (I believe) a bug in the library which impends me from setting a custom field which is the core issue. A debugger doesn't help me in this case as I managed to isolate it to an issue inside the Act! framework dll.
02-14-2019 07:03 AM
02-14-2019 07:06 AM
It is throwing a null reference exception.
The last method in the stack is string.Format. My thoughts it may be another error thrown but when trying to catch it and rethrow it and creating an error message inside the act dll it tries to format the error and the devs didn't handle that properly. So it is hidding the root cause of the error. or it is the bug itself. That only happends on the line below.