Disable export from view/search

Hi,

is there a way to prevent the export of the data and document from the view/search?

best, uros

Parents
  • You can hide or disable built-in commands such as "Export" with a UI extension.

    Sample code (no support or guarantee of functionality given):

    "use strict";
    
    function OnNewShellUI( shellUI ) {
    	/// <summary>The entry point of ShellUI module.</summary>
    	/// <param name="shellUI" type="MFiles.ShellUI">The new shell UI object.</param> 
    
    	// Register to listen new shell frame creation event.
    	shellUI.Events.Register( Event_NewNormalShellFrame, newShellFrameHandler );
    }
    
    function newShellFrameHandler( shellFrame ) {
    	/// <summary>Handles the OnNewShellFrame event.</summary>
    	/// <param name="shellFrame" type="MFiles.ShellFrame">The new shell frame object.</param> 
    
    	// Register to listen the started event.
    	shellFrame.Events.Register( Event_Started, getShellFrameStartedHandler( shellFrame ) );
    }
    
    function getShellFrameStartedHandler( shellFrame ) {
    	/// <summary>Gets a function to handle the Started event for shell frame.</summary>
    	/// <param name="shellFrame" type="MFiles.ShellFrame">The current shell frame object.</param> 
    	/// <returns type="MFiles.Events.OnStarted">The event handler.</returns>
    
    	// Return the handler function for Started event.
    	return function() {
    	
    		// Hide export objects command
    		shellFrame.Commands.SetCommandState(
    			BuiltinCommand_ExportObjects,
    			CommandLocation_All,
    			CommandState_Hidden
    		);
    		
    		// Hide export search bar conditions command
    		shellFrame.Commands.SetCommandState(
    			BuiltinCommand_ExportSearchBarConditions,
    			CommandLocation_All,
    			CommandState_Hidden
    		);
    
    	};
    }

Reply
  • You can hide or disable built-in commands such as "Export" with a UI extension.

    Sample code (no support or guarantee of functionality given):

    "use strict";
    
    function OnNewShellUI( shellUI ) {
    	/// <summary>The entry point of ShellUI module.</summary>
    	/// <param name="shellUI" type="MFiles.ShellUI">The new shell UI object.</param> 
    
    	// Register to listen new shell frame creation event.
    	shellUI.Events.Register( Event_NewNormalShellFrame, newShellFrameHandler );
    }
    
    function newShellFrameHandler( shellFrame ) {
    	/// <summary>Handles the OnNewShellFrame event.</summary>
    	/// <param name="shellFrame" type="MFiles.ShellFrame">The new shell frame object.</param> 
    
    	// Register to listen the started event.
    	shellFrame.Events.Register( Event_Started, getShellFrameStartedHandler( shellFrame ) );
    }
    
    function getShellFrameStartedHandler( shellFrame ) {
    	/// <summary>Gets a function to handle the Started event for shell frame.</summary>
    	/// <param name="shellFrame" type="MFiles.ShellFrame">The current shell frame object.</param> 
    	/// <returns type="MFiles.Events.OnStarted">The event handler.</returns>
    
    	// Return the handler function for Started event.
    	return function() {
    	
    		// Hide export objects command
    		shellFrame.Commands.SetCommandState(
    			BuiltinCommand_ExportObjects,
    			CommandLocation_All,
    			CommandState_Hidden
    		);
    		
    		// Hide export search bar conditions command
    		shellFrame.Commands.SetCommandState(
    			BuiltinCommand_ExportSearchBarConditions,
    			CommandLocation_All,
    			CommandState_Hidden
    		);
    
    	};
    }

Children
No Data