| 
                                                                        
                                                                         
                                                                            
                                                                                ben-devotion.com
                                                                            - 
                                                                                10/10/2012 6:18:34 PM
                                                                            
                                                                         
                                                                         
                                                                            
                                                                        
                                                                        
                                                                         
                                                                        
                                                                        
                                                                        
                                                                        
                                                                        
                                                                         
                                                                        
                                                                            v7 BizForm code
                                                                        
                                                                            I ported some simple v6 BizForm code over to a new v7 project and have run in to an issue. The code is virtually the same as here: http://devnet.kentico.com/docs/7_0/devguide/index.html?api_bizforms_creating_a_new_record.htm
  The error is that this line is now deprecated: BizFormItem formRecord = new BizFormItem(dci.ClassName, bProvider);
  The constructor now does not take any parameters. There is a warning but it allows compilation: warning CS0618: 'CMS.FormEngine.BizFormItem.BizFormItem()' is obsolete: 'This constructor is meant for system purposes, it shouldn't be used directly.'
  I can set bProvider later but the 2 ClassName type fields are read only. 
  When I try to call:
  formRecord.SetValue(fieldName,'fieldValue');
  I get 'Object reference not set to an instance of an object.' which I assume is because there is no actual BizForm set for the new record so the check against the fieldname breaks.
  I am running v7 unpatched. I ran through the doco for the fixes in KIM for 7.0.1 and 7.0.2 and there is no mention of a BizForm fix there.
  Am I missing something simple?
                                                                         
                                                                        
                                                                            
                                                                         
                                                                        
                                                                         
                                                                        
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                         
                                                                        
                                                                            
                                                                            
                                                                            
                                                                            
                                                                         
                                                                        
                                                                         
                                                                     |