Error while inserting data in custom module.

Posted by Community Admin on 04-Aug-2018 10:40

Error while inserting data in custom module.

All Replies

Posted by Community Admin on 27-Dec-2012 00:00

Hello

I have create my own custom module named StudentsModule following the steps as specified in products module. Module is installed but when i try to create record from the backend of the module. I get the following exception:


System.NullReferenceException: Object reference not set to an instance of an object.

   at OpenAccessRuntime.Relational.metadata.RelationalTable.createPkEqualsParamExp(SelectExp se)
   at OpenAccessRuntime.Relational.RelationalStorageManager.getGetStateFetchSpec(FetchPlanIF fPlan, Boolean includeSubclasses, OID oid)
   at OpenAccessRuntime.Relational.RelationalStorageManager.getStateImp(RelationalOID oid, FetchPlanIF fPlan, Boolean forUpdate, StateContainer container, RelationalClass relationalClass)
   at OpenAccessRuntime.Relational.RelationalStorageManager.getState(OID oid, FetchPlanIF fPlan, StateContainer container)
   at OpenAccessRuntime.Relational.RelationalStorageManager.fetch(ApplicationContext context, OID oid, State current, FetchPlanIF fPlan, FieldMetaData triggerField)



I have sdk of SF version 5.2 so i have set the open access target path as  

 <OpenAccessPath>C:\Program Files\Telerik\Sitefinity 5.2\SDK\Content\Common\Dependencies</OpenAccessPath>

but the sitefinity application is built in sitefinity version 5.1. Is the error coming because of this version difference?

Posted by Community Admin on 01-Jan-2013 00:00

Hello,

The stack trace of the error indicates a problem in metadata which is an inication that the module is not enhanced

at OpenAccessRuntime.Relational.metadata.RelationalTable.createPkEqualsParamExp(SelectExp se)

In the .csproj file of the module make sure you have the end of the .cspro file like this:

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <ProjectExtensions>
    <VisualStudio>
      <UserProperties OpenAccess_ConfigFile="App.config" OpenAccess_ConnectionId="DatabaseConnection1" OpenAccess_Enhancing="True" OpenAccess_UpdateDatabase="False" OpenAccess_EnhancementOutputLevel="1" />
    </VisualStudio>
  </ProjectExtensions>
  <PropertyGroup>
    <PostBuildEvent>
    </PostBuildEvent>
    <PreBuildEvent>
    </PreBuildEvent>
  </PropertyGroup>
  <PropertyGroup>
<!-- enter the path here -->
    <OpenAccessPath>C:\Program Files\Telerik\Sitefinity 5.2\SDK\Content\Common\Dependencies</OpenAccessPath>
  </PropertyGroup>
  <Import Condition="Exists('$(OpenAccessPath)\OpenAccess.targets')" Project="$(OpenAccessPath)\OpenAccess.targets" />
</Project>


All the best,
Stanislav Velikov
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed