I am looking for a way to create a vendor entry screen that has the “add new record” functionality disabled. I would like for your users to update existing records, but not create new ones. Is there a quick way to disable this functionality?
The easiest and most future proof way to do this would be to add a pre-processing Method Directive on Vendor.Update() that looks for users in (or not in) a specific security group and and added row, and throw an exception. They won’t be able to add new records then. The downside to that, is that they won’t be stopped until they try to save the record, but your data would at least be protected. You could also add a check on get new to see if they are in the correct group, and that might stop them there. You’ll have to do some testing to make sure it covers all of the scenarios.
Both of these options can be done with widgets only pretty simply.
You could also just remove the tools so they don’t have access to it. This function disables almost everything. you could run this function on form load and adjust it to leave available those you are interested in.
private void HideAllNativeControls()
{
// Hide Native Toolbar Controls
baseToolbarsManager.Tools["NewTool"].SharedProps.Visible=false;
baseToolbarsManager.Tools["RefreshTool"].SharedProps.Visible=false;
baseToolbarsManager.Tools["DeleteTool"].SharedProps.Visible=false;
baseToolbarsManager.Tools["SaveTool"].SharedProps.Visible=false;
baseToolbarsManager.Tools["EditMenu"].SharedProps.Visible=false;
baseToolbarsManager.Tools["HelpMenu"].SharedProps.Visible=false;
baseToolbarsManager.Tools["ToolsMenu"].SharedProps.Visible=false;
baseToolbarsManager.Tools["ActionsMenu"].SharedProps.Visible=false;
baseToolbarsManager.Tools["FileMenu"].SharedProps.Visible=false;
baseToolbarsManager.Tools["AttachmentTool"].SharedProps.Visible=false;
baseToolbarsManager.Tools["ClearTool"].SharedProps.Visible=false;
baseToolbarsManager.Tools["CopyTool"].SharedProps.Visible=false;
baseToolbarsManager.Tools["CutTool"].SharedProps.Visible=false;
baseToolbarsManager.Tools["PasteTool"].SharedProps.Visible=false;
baseToolbarsManager.Tools["UndoTool"].SharedProps.Visible=false;
baseToolbarsManager.Tools["PrimarySearchTool"].SharedProps.Visible=false;
}
The problem with that, is that this won’t upgrade when you do to the kinetic web UI. So in order to not have to do it again later, the BPM’s are more future proof. But yes, it will work. (many ways to skin a cat)
This seems to work except for on the “New” button. Any idea what I need to change to make it disappear?
baseToolbarsManager.Tools[“NewTool”].SharedProps.Visible=false;
That line should be hiding the tool unless the name changed in Kinetic. Sorry, I’m on 10 still so wasn’t aware that the name had changed.
The other option, as others have pointed out, would be to use a BPM. In the BPM you could use a conditional that checks which customization it is coming from i.e.
Change the “Attend” to the name of your customization where you want this to be prevented.
You could put this on the GetNewID an raise an exception if the Customization matches,