This article has been archived, and/or refers to legacy products, components or features. The content in this article is offered "as is" and will no longer be updated. Archived content is provided for reference purposes only. This content does not infer that the product, component or feature is supported, or that the product, component or feature will continue to function as described herein.
When a field from a view's primary SmartObject is used as an input mapping, when you create a K2 package that includes the view, you may see an indication that the field does not exist. The issue may occur under the following conditions:
1) The mapping uses a control as the source.
2) The control has an associated SmartObject as the data source, which is not the primary data source
3) The SmartObject field from the primary data source has the same name as the field from the secondary data source (the field the control is bound to). This SmartObject field is subsequently removed and the view resaved with a different field set as the data source value.
Manually remap the data source of the control to another value. Save the view and remap the value to the correct value (from the X SmartObject).
Below is an example of a scenario to explain this issue.
In the images below, three SmartObjects exist with associations between two of the SmartObjects. Two SmartObjects have the same properties.
SmartObject1 and SmartObject3 have the same properties and there is an association between SmartObject2 and SmartObject3
The association is as follows. Note that the way in which the association mapping is done has no relevance to the issue, however there must be an association.
View1 uses SmartObject1 as the primary data source.
View1 contains a drop-down list control and a button control. The data source of the list control is to the secondary SmartObject, SmartObject3, and configured to show data from SmartObject2 as follows:
A rule exists on Form1 that opens View1 (when the button is clicked) and executes the Create method.
The configuration of the rule contains a mapping between the list control and Field1 of SmartObject1 used in View1.
In this scenario, View1 is edited and the value of the data source of the list control is changed to Field2.
Field1 is then removed from SmartObject3.
The view definition keeps track of the last value used for the list control’s SmartObject value which is Field1. When creating a K2 package, an issue is raised on Form1 for the missing property because it no longer exists in SmartObject3.
Click on the error to see the details of the error.
Opening Form1 and navigating to the rule shows that there are no errors and the rule is using SmartObject1 instead of SmartObject3.
To fix this issue, you must give the view a valid SmartObject field for its last value configured. To do this, edit View1 and set the Value field to Field3. Save the view.
Edit View1 again and set the Value field back to Field2. Save the view.
Create the package again and the error no longer occurs.