Symptoms
The client created a document library that makes use of Enterprise Keywords for each document. They created a SmartObject and generated the "New", "Edit", and "Display" forms using the K2 App in SharePoint 2013. When they edit the properties on a document in the library and try to assign or find enterprise keywords they saw the following error...
Cannot invoke method or retrieve property from null object. Object returned by the following call stack is null. "GetTermSet GetByID TermStores Microsoft.SharePoint.Taxonomy.TaxonomySession.GetTaxonomySession"
Diagnoses
When you "Appify" a list the magic that happens should get the needed GUIDS and populate these in the Smartforms we generate as inputs to execute the SMO, this is failing and the TermSetID is sen through with a value of "00000000-0000-0000-0000-000000000000"
Resolution
There is a workaround for this item by editing the "Edit Item" form in SharePoint:
--------------------
Start by going to the app on your list/library and edit the smartforms we generated, in this case edit the “Edit Document” View > Navigate to the Rules for the View > the enterprise keywords field will be represented by a Lookup control, and the rule “When ‘Keyword’ Picker is Resolving” needs to be changed.
Edit the Rule and on the “asynchronously populate ‘Keyword Picker’ List control with data” click configure.
You'll see the “TermSetID” is populated with in valid GUID (0000-0000000-000…..). We need to replace this with the actual TermSetID (GUID).
To get the GUID go to the SP term store (https://oyoursite]/_layouts/15/termstoremanager.aspx) > Click on the termSet for this Keyword created and on the right at the bottom you’ll see the “Unique Identifier” use this GUID in the View and deploy it. At this point it should work properly.