After deploying package from one environment to another the save and cancel buttons are disappearing from the new item form used in the library.
This library uses a custom document set content type. The two environments dev and test mirror each other in terms of this sharepoint library, so there are no inconsistencies that could be causing the issue. Sometimes when deploying the first time we will still see the save and cancel buttons but, other times it will cause those buttons to disappear. These controls are on a default sharepoint form and not a K2 SmartForm. When adding a custom document set content type the default form for new will automatically set to the sharepoint form, K2 will not let you use a smartform in the form settings. One of the main triggers is to only have the custom document set content type show on the sharepoint library and then do a deployment. Issue only occurs after K2 deployment so there is something K2 is doing to this sharepoint form and it's settings.
This issue is occurring because for the Document Set content type we reset the NewFormUrl to empty instead of “_layouts/15/NewDocSet.aspx” which is the default value that SP assigns when we click 'Delete All' on the K2 Artifacts page from a sharepoint list.
This value can be changed by opening the Library in Sharepoint Designer or the Sharepoint manager application. Upon opening the library in designer, navigate to the custom document content type under the 'Content Types' pane. After clicking on the custom document set it will navigate to a new page where we can see the settings for this content type. Off to the right there is a forms pane. In here we need to repopulate the 'New Form' value to "_layouts/15/NewDocSet.aspx". Now save the changes that we have made and reload the Library. Upon adding a new entry we will see the correct form with the save and cancel buttons present.
The alternate workaround for this solution was to run a powershell script that manipulates the Library. This powershell script in essence will create a new Content Type B on the library that mirrors the custom content type. The present custom content type can be named "A" in this case. The script will basically take each item and change it's association from content type A to Content type B. After all items have been changed the content type A will be eliminated leaving a copy created of the content type but also fixing the New Form URL because a new content type has been created and this fills in the new form URL.