I just spent a few hours troubleshooting something and figured that someone else might benefit from my experience. We have a receipt of goods integration that runs from AP invoices in our ECM system and creates a receipt of goods entry in Sage 100 ERP. I noticed that the integration was failing on some records and not on others on the nWrite method.
The first error I got was "Object reference not set to an instance of object" when attempting to check my retVal object for success or failure. I then put in a null check on that object and tried to grab the last error message of the receipt of goods business object.....got nothing. I checked the last error message of the session object and got the following:
Error #88: Invalid/unknown property name [Extended Error Information: Type mismatch: 'oSession.AsObject' (err/ret=2/0)]
I then proceeded to waste hours of time trying different things to fix this. Finally, I realized that I had put a conditional UDS on save of ROG that will dispaly a warning. I usually put in a UI check, but this time I did not. I added the following to my UDS so that it would only run when a user was physically entering an ROG in Sage 100 ERP, and the issue was resolved:
MASUI = CBool(oScript.UIObj)
IF MASUI THEN
'Code here
END IF
The issue was that the UDS was firing on "nWrite" of our ROG integration and trying to display a message box.