Personalize the 'Standard', 'Fresh', and 'Modify' aspx widget devoid of Share Point or Infopath integration

As I work on developing a Sharepoint 2010 page to meet my team's needs, I am faced with restrictions on using Sharepoint Designer and InfoPath. This means I am unable to customize the default form for adding, editing, or viewing items on my individual Sharepoint site within my working area.

To address this, I have linked my MS Access table with Sharepoint, which contains over 20 fields. However, displaying all fields when opening a list item is unnecessary for all users at all times.

My current requirements are as follows:

  1. Customize the fields displayed on the form to show only specific fields
  2. Create a Submit or Save button that captures the current system time
  3. Lock certain fields to prevent accidental or intentional edits by users

The solution can be implemented in either VBA (.vbs) or Javascript (.Js) file.

Any assistance with this issue would be greatly appreciated...

Answer №1

Setting the Visibility Properties of SPField Objects

Each SPField object contains properties that determine if it should appear in the default new, edit, and display forms.

There are various methods to configure these properties, some of which are outlined below.

1. Custom Server-side Solution (C# or VB.net) developed by a programmer

Some organizations create a simple custom SharePoint solution using Visual Studio, providing an interface accessible from the List Settings menu to toggle the ShowInNewForm, ShowInEditForm, and ShowInDisplayForm properties on fields within any list.

This method empowers end users to control field visibility without coding or special tools once set up.

However, it demands significant upfront investment from your organization's SharePoint developers, if available.

2. PowerShell execution by a server administrator

Your SharePoint administrators have the option to manually set these properties using PowerShell from any web front end server in your SharePoint farm for one-time fixes.

$web = get-spweb "http://your/web/url"
$list =  $web.lists["Your List Title"]
$field = $list.fields["Your Field Title"]
$field.ShowInNewForm = $false
$field.ShowInEditForm = $true
$field.ShowInDisplayForm = $true
$field.Update()
$web.Dispose()

4. JavaScript execution by a site owner

You also possess the ability to modify these properties using JavaScript, executable from the console tab in the F12 developer tools.

By updating the SchemaXml property of the SPField object, you can define these properties after retrieving and adding them to the XML as shown below.

SP.SOD.executeFunc('sp.js','SP.ClientContext');
var listName = "Your List Title";
var fieldName = "Your Field Name";
var clientContext = new SP.ClientContext();
var field = clientContext.get_web().get_lists().getByTitle(listName).get_fields().getByInternalNameOrTitle(fieldName);
clientContext.load(field);
clientContext.executeQueryAsync(
    function(){
        var schemaXml = field.get_schemaXml();
        schemaXml = schemaXml.substring(0,schemaXml.length-2) 
          + 'ShowInNewForm="FALSE" ShowInEditForm="FALSE" ShowInDisplayForm="TRUE" />';
        field.set_schemaXml(schemaXml);
        field.update();
        clientContext.executeQueryAsync();
    },
    function(sender,args){
        alert(args.get_message());
    }
);

These properties are absent in the schema XML by default and need to be specified explicitly. Checking the current XML string before modification is essential for accurate adjustments.

Alternate Method

Modifying Forms with JavaScript/HTML/CSS/jQuery

If you open the form in a separate window and not a modal dialog box, you can manipulate the page contents by inserting web parts directly onto it.

Including a content editor web part beneath the existing list form web part grants the freedom to incorporate HTML, JavaScript, and CSS for further customization.

To safeguard against SharePoint altering JavaScript and correcting HTML/CSS, embed your code snippet in a text file, upload it to a document library, then link the content editor web part to the uploaded file's URL.

Answer №2

To proceed, you must submit a formal request to your IT department. An application needs to be developed, and based on my previous professional involvement, you will require an Excel file linked to a SharePoint list for content creation, reading, updating, and deleting. This is a substantial project, as it took me approximately 2 months to complete when I undertook it around 5 years ago. If you lack familiarity with SharePoint lists, VBA, or programming in general, brace yourself for a challenging journey.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

"Caution: Refs cannot be assigned to function components" message encountered when utilizing a custom component in Next.js

I created a component called HeaderIcon with the following code: function HeaderIcon({ inactiveIcon, activeIcon }) { const [isActive, setIsActive] = useState(false); return ( <div onClick={() => setIsActive(!isActive)}> {isActive ? ...

Unable to access account due to login function malfunctioning

I've created a login button with this function code, but I keep getting the error message "Login unsuccessful, Please try again..." Thank you in advance. I wasn't entirely sure what you needed, so I included most of the code because I've b ...

Unclear when notifying div content

After creating a PHP page, I encountered an issue while trying to select the inner text of a div and alert it with jQuery. Instead of getting the expected result, it keeps alerting "undefined." What could possibly be causing this? Here is the code snippet ...

If I click on the datalist link option during an ajax append, I would like to be redirected

When I try to link after clicking an option in the appended AJAX, it does not seem to work as expected: More details: $('#input-friends').on('input', function () { var id = $('#input-friends').val(); $.ajax({ ...

How can I integrate data pulled from another website onto my HTML webpage with Vue.js?

I have successfully extracted data from an API website and can display it in the console. However, I am facing issues with displaying the data on the webpage itself. Can someone assist me in this matter? Specifically, I am trying to display the id element ...

Concentrate on implementing Cross-domain Ajax functionality in Opera browser

For a unique and interesting browsing experience, try using Opera 9.62 to explore the nuances of cross-sub-domain JavaScript calls with Ajax. To understand this better, follow these instructions by placing three simple files on appropriate domains. foo.ht ...

What are some techniques for concealing a CSS transition beneath another element in both directions?

Witness the magic in action! By clicking on the black box below, a larger black box will gracefully emerge from beneath the sidebar. While it may not be as clear in jsfiddle, rest assured that this effect is more pronounced in browsers. Thanks to some clev ...

Guidance on changing the user's path within the same domain using a button click in express

Currently, I am working on a basic web application where I need to implement a feature that redirects users to different paths within my project upon clicking a button. My project consists of two versions - one in English and the other in Polish. I am util ...

Ensure that a select input, dynamically generated, is marked as 'required' only when other inputs have been filled out

Displayed below is a snapshot of a page I'm developing that allows users to input details about various rooms in a property. Users have the ability to 'add' multiple rooms, triggering javascript/jQuery to dynamically create additional input ...

My Vue.js modal component isn't functioning as expected

I have a Vue JS modal component that is supposed to display all the names typed in the form, but it isn't working. As a newcomer to Vue JS, I'm having trouble understanding why it's not functioning properly. Additionally, I am unable to use ...

By implementing Async.parallel, I ensure that the lifetime of my parameter does not exceed the duration of the asynchronous calls in NodeJS when working with MongoDB

After analyzing the code and its asynchronous behavior, it appears that the 'recipeData' array may not persist long enough to handle the asynchronous callbacks. To mitigate this, I created a copy of the data in a global array. However, I am encou ...

What is the process of using an if statement in jQuery to verify the existence of a property in a JSON file?

I am working on a task to incorporate an if statement that checks for the existence of a specific property in a JSON file. If the property exists, I need to display its value within HTML tags <div class='titleHolder'> and "<div class=&ap ...

Accessing the window variable within a Jquery selector in Javascript

I'm encountering some issues while attempting to optimize code. The following lines execute without errors: Array.prototype.forEach.call( $('ZA1 .stat'), function( td ) {//ExcuteCode} Array.prototype.forEach.call( $('ZA2 .stat'), ...

Ways to utilize built-in features from a Java library that has been incorporated

I have embarked on a project to create a Nativescript wrapper for a Java library in order to harness its functionalities for a Nativescript application. Despite the lack of detailed articles on this topic, I have decided to turn this into a plugin wrapper ...

Failure of the controller in a different module

Hello, I'm currently facing an issue with setting up my child controller. I have developed two modules - one for managing directives and controllers, and another for handling Gmail functionalities. //js file 1 var gmailMod = angular.module('gm ...

Incorporate the AngularJS controller into your JavaScript code

I am facing an issue with my jQuery UI dialog that contains a dynamic <select> populated with Angular and AJAX. The problem is that the AngularJS script still runs even when the dialog is not visible. To solve this, I added a condition to stop the s ...

Does Internet Explorer 10 support the FormData object?

I've developed a JavaScript app that enables me to upload images asynchronously, and it works seamlessly in most browsers. However, the infamous Internet Explorer is causing some trouble... To address this issue, I devised a workaround for IE9- versi ...

How does ng-repeat determine the presence of duplicates within an array of objects?

angular.module("myApp",[]) .controller("myCtrl",function($scope) { $scope.persons = [{name:"teja",age:11}, {name:"Ash",age:12}, {name:"teja",age:11}]; }); In ...

Submitting requests in Node.js Express

Can a request for a specific route be dropped using Node.js and express? For example, not returning an HTTP status or any headers, but simply closing the connection? app.get('/drop', function(req, res) { //What is the method to drop the requ ...

Querying Access 2013 SQL to find instances of colon in a specific cell

I need help crafting a SQL statement for updating an Access 2013 database. I have two tables that look like this: T1: ticketID endResult 1 2 T2: ticketID Description 1 Return: other text 2 some description ...