Symptoms
When trying to edit a form or view in the K2 Smartforms Designer, the following error is shown:
Value cannot be null.Parameter name: s,
SourceCode.HostServerLib, at SourceCode.Hosting.Client.BaseAPI.BaseAPIConnection.RemoteCall(String TypeName, String MethodName, Objectt] Parameters, Booleann] NullList, MarshalMessageType CallType) at SourceCode.Hosting.Client.BaseAPI.BaseAPI.RemoteCall(String TypeName, String MethodName, Objectt] Parameters, Booleann] NullList, MarshalMessageType CallType) at SourceCode.SmartObjects.Client.SmartObjectClientServer.GetSmartObject(Guid guid) at SourceCode.Forms.Utilities.RuleHelper.GetSmartObjectDetails(Guid guid) at SourceCode.Forms.Utilities.RuleHelper.BuildContext(Action action) at SourceCode.Forms.Utilities.RuleHelper.ValidateRuleConditionsAndAction(Event event) at SourceCode.Forms.Utilities.RuleHelper.GetEventFriendlyName(Event ev) at SourceCode.Forms.Views.PartialPage.Page_Load(Object sender, EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Diagnoses
Usually this error is related to the underlying smartobjects on the form vs. what the smartobject or underlying system it connects to looks like. For example, one method or property can be referenced in a form or view that either no longer exists after a smartform has been edited, or the service object has been changed or deleted that the smartobject connects to.
Resolution
Resolving or recreating the underlying service object information, or recreating/rolling back changes made to the smartobject should usually correct the issue and allow the view to be edited. This ensures that the smartobject configuration that the smartform or view is then present.
Note: it is always a good idea to delete a smartobject rule or action that references a changed smartobject item (whether it be a method, property or service object change) to ensure that this error does not occur. Obviously this is not the desired behavior, and the following feature request has been logged for this item to be released in the near future:
TFS 460414: K2Designer SmartObjects Methods - Cannot edit View or Form if SmartObject and ServiceObject is out of sync
The feature request would make it available to open the form or view to see which rule or action is causing a problem (would be indicated some way in the rule designer) and then work backward from there on identifying the underlying cause if you are not already aware of the smartobject causing the issue.