I understand that the preferred method of loading up an InfoPath form with SmartObject data is to pass the Id of the smart object to the form and have it invoke the SmartObject's 'Load' method to grab the data. That is all well and good, but I had a simpler idea for a very straight-forward, read-only scenario and I can't figure out why it doesn't work. Here is what I am doing:
Drag out a Smart Object event (on a process integrated with an InfoPath form), tie it to the 'Load' method and include the Id parameter. In the return values dialog, associate each return value with the corrisponding value in the InfoPath XML data fields. Seems like a good way to fill the InfoPath data without any code (and keeping the InfoPath form dumb) but it doesn't work - I get an 'Object Reference not set to an instance of an object' error on the event without any further information. I have verified that none of the return values are null, so I can only conclude that for some reason the InfoPath xml field is not instantiated yet? I dunno, I can't figure out why this doesn't work and it would be a real time-saver to do it this way. Anybody have any ideas?