Object reference error

Jun 3, 2012 at 1:27 PM
Edited Jun 3, 2012 at 1:28 PM

Hello,

When I tried to generate attributes of a custom entity it throws a null object reference error when it tries to read the tabs of that entity ??

Can you help me on how to solve this issue ?

Thanks

Coordinator
Jun 4, 2012 at 2:55 AM

Hello,

Can you provide your Form XML please so that I can reproduce the issue?

Thanks

Jun 4, 2012 at 6:08 AM

 

<?xml version="1.0" encoding="utf-8" ?>

<JsConfig CrmServer="http://localhost/orgname"          JsDirectory="C:\Project\Scripts"> 

<Entities>   

<Entity EntityName="ims_policy" FileName="Policy.js" >       

</Entity>

  </Entities>

</JsConfig>

Jun 5, 2012 at 12:16 PM

Hello bscarlavai ,

I think I found the problem, this exception is thrown on the function that retrieves the tabs names.

I debugged the code and it was on Notes tab where there is no "name" attribute in the XML form.

This is the code :

from elem in form.Descendants("tabs")  .Descendants("tab")          

   select elem.Attribute("name").Value;

 

I added where condition ( where elem.Attribute("name") !=null  ) and it works now.

Thanks.

Coordinator
Jun 5, 2012 at 4:11 PM

Great, glad you were able to resolve it.  Thanks for the find, I'll update the code.