Note: I found an issue where setting up the inactive filtering on the form in the List Lookup control caused the control to break in Nintex Mobile. I've updated the steps so the filtering is now done on the list instead of on the form.
I've been working on a form that contains a dropdown list populated by a lookup list and requires the ability to inactivate items in the lookup list. When an item in the lookup list is inactivated it should no longer be available to select on a new form but still needs to be displayed on previous forms where that value was selected so that historical data is preserved.
I looked through the Nintex Community to find a way of doing this but didn't come across anything. Now that I've completed my solution I thought I would share it in case others are looking for ideas on how to accomplish this.
In my example I will use the scenario of a mobile device request form. The list of mobile devices that can be ordered through our Service Desk is updated regularly. When an older device is no longer available, we would like to remove the device from displaying on new request forms while still displaying that device on older forms where that device had been ordered.
I started by creating my lookup list. I created two columns, a Single Line of Text field for the mobile device description and a Yes/No field to determine whether or not the device is available.
I created a view named Active that only displays records where the Inactive column is set to No.
I now created the list for the request form. I created a Single Line of Text field for the mobile device display name as well as a Single Line of Text field for the mobile device list id.
On the form I added a List Lookup control pointing to the mobile device lookup list with the ID connected to the mobile device list id field and the Text connected to the mobile device display name field.
I set the Source View field to Active so only the records in the Mobile Device Active view are displayed.
I added a rule on the List Lookup control to hide the control when the form is not in either New or Edit mode.
I now added a Calculated Value control to the form and place it over top of the List Lookup control.
I set the Formula field to be set to the Item Properties (not the Named Controls) mobile device display name field. I also set all of the 'Recalculate formula' fields to 'Yes'.
I added a rule on the Calculated Value control to hide the control when the form is not in Display mode.
Now when I open a previous form that had a mobile device selected that has since been inactivated, the mobile device will show on the form in display mode. If I select to edit the form, the inactivated value is no longer available in the dropdown and I am required to select an active value.
As you can see in this screenshot, even though the iPhone4 was displayed on the form when the form is in Edit Mode the iPhone4 is no longer available to select.