I have a web part that updates a list item. User can also update the item from the screen. I use SPListItem.Update method.
I have event handlers attached with the list.
In the item updated/updating method ... is there a way to know whether the user has updated the listitem from the screen or from my web part?
Thanks.
Can you add a column to your list and updated the value in your code when the list is updated from the webpart.
Related
When deleting records within the platform, this action is not reversible via the front end. Is there a way to allow users to remove a record from their view without actually deleting the record?
You can simulate recycle bin functionality within Archer GRC by adding a record permission field that grants read access to "Everyone". If read access is no longer required then an editor of the record can go in and change "Everyone" to a group called "Recycle Bin."
Please note that if there are other record permission fields in the application, users or groups may still have access if they are selected in those fields. Perhaps You can set up a dropdown status field for the user to select "Recycle Bin" and use this condition for automatic record permissions to revoke permission to the record depending on the requirements or workflow of the application.
Solution shared by Igritte might be somewhat confusing for end users.
End user will see greyed out "Delete" button in the top toolbar, but he has to select "Recycle Bin" in the form. This solution was not accepted by my business owner at some point.
As a work around for "Soft delete", I wrote a custom object overriding "Delete" button functionality.
1. User doesn't have delete access to the record, so JavaScript code will make "Delete" button look like active and available.
2. Once the button is clicked, custom object will populate value in the
hidden value list and simulate the click on the "Save" button.
Update: Note that Custom object needs to hide the value list first once the page is loaded. Here you will need to use a JavaScript and do the following: [a] locate the value list DOM object and [b] set display attribute to none. I used jQuery library to do both. This way your value list is not displayed, but you still can use it to control data driven events.
3. With hidden value populated and submitted, record permission will hide this record from the end user.
Note that custom object hides one value list on the layout as well.
If for some reason JavaScript doesn't load properly, user simply will not be able to click on the grayed out "Delete" button.
Update: Hidden value list can be populated by custom object using JavaScript code as well. You need to identify the form tag "input" in HTML code of the page and set attribute "value" to the desired state. I used jQuery library to do this as well.
I have this solution in production working fine with IE11, FF and Chrome.
I can't share the code, but with WC3Schools JavaScript guides and 4 hours you can write and test it yourself with very little JavaScript skills.
Sometimes you have to use custom objects when you want to get a user-friendly solution of not available functionality.
Good luck!
I'd like to know how to show a non-editable id when a user adds an item to a list. I was thinking about a workflow but i don't know how to approach this issue. It must show the ID in the form that creates the new item.
Thank you.
It's not possible as SharePoint item is created when is saved into database and his ID is generated within the save operation. In the new item form (typically newForm.aspx) is not accessible.
I have a requirement where I want to add a button called approve on the bottom of read item list page. This is something when I click on approve button should change the status of list using whatever (javascript, workflow).
Please suggest how can I do this with the existing list. I have attached the screenshot below
I'll be very grateful for all of your advise
If you open a list in SharePoint designer. There is a section called Forms. You can use it to edit existing (add/edit/view) form or add a new one.
I have a view for create/ edit data, in my view contains a dropdownlist control and two textboxes and two buttons [Create, Done Modifications], and my requirement is like below.
User should be able to select his/her name from dropdownlist which contains list user names. By default create button is visible and ‘Done Modifications’ button should be invisible.
Based on the dropdownlist item selection, if the record is already exists then show up his/ her data in DOB, Location textboxes then invisible Create button and able to update to the database by Done Modifications button.
Data population, edit, create, delete logic should be implement in Controller classes.
Above things should be happen in asynchronously, I don’t want to allow post backs on any events.
Thanks for your time!
Sridhar Goshika
What is the hourly rate you are going to pay for this?
This is a list of specifications given to you, that you pass on to us; It does not show any research, any code showing what you have done and where you are at. Moreover, there is no question there.
submit() method will submit the form by dropdownlist item selection
#Html.DropDownList("ProdID", null, new {#onchange="submit()" })
Is it possible to create an Alert which should only fire when certain field value is blank or something like that ? I don't find any reference for the same anywhere.
If your alert criteria can be expressed in a view, you can then do this through the UI without code. Create the view on the list with your criteria. Then set an alert for the list. In the section for set alerts for these changes, select the someone changes an item that appears in this view and select your view from the dropdown list.
This option is not easily discovered in 2010 as the option only appears after a custom view exists for the list (except for the task list, which has a number of views included by default).
You can create a workflow through SharePoint designer to achieve this functionality.