Issue

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.

Workaround

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).   

Example

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

Image

Image

Image

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.  

Image

View1 uses SmartObject1 as the primary data source. 

Image

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:

Image

A rule exists on Form1 that opens View1 (when the button is clicked) and executes the Create method.

Image

The configuration of the rule contains a mapping between the list control and Field1 of SmartObject1 used in View1

Image

In this scenario, View1 is edited and the value of the data source of the list control is changed to Field2.

Image

Field1 is then removed from SmartObject3.  

Image

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

Image

Click on the error to see the details of the error.

Image

Opening Form1 and navigating to the rule shows that there are no errors and the rule is using SmartObject1 instead of SmartObject3

Image

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. 

Image

Edit View1 again and set the Value field back to Field2. Save the view.

Image

Create the package again and the error no longer occurs.

Image