This project has moved. For the latest updates, please go here.

Making field readonly/editable in another list

May 24, 2012 at 6:28 PM

Hi! Do you know how to make a field in another list readonly and editable? I am using SPServices.SPUpdateMultipleListItems on the Edit form of a list called "Functional Area" which is updating a field called "COLS Level" in a list called "Base Reporting" based on the "COLS Level" field set on the "Functional Area" list's Edit form. On the Edit form of the "Base Reporting" list, there is code for making the "COLS Level" field readonly using SPUtility. Is there a way to make the "COLS Level" field editable in the "Base Reporting" list, update the field using SPUpdateMultipleListItems which is on the "Functional Area" list, then make the "COLS Level" field in the "Base Reporting" list readonly again please?

Peace and Blessings,

 Nikki

Coordinator
May 25, 2012 at 12:48 AM

Definitely sounds like something you can get working!

  1. You could start with the "COLS Level" field editable or call MakeEditable on the SPField (see here for a list of functions).
  2. Do the updates with SPServices
  3. Then call MakeReadOnly on the SPField

I'm not really sure how you want to initiate these steps (button? field change?) but you'd probably just put these steps in a JavaScript function to call.

May 25, 2012 at 3:06 PM

Hey! I don't think I explained what I am trying to do well so I am going to take another stab at it (I have been up for over 24 hours so I hope I am coherent... LOL). I have 2 lists, one named "Functional Area" and another named "Base Reporting". On the Edit Form of the Functional Area list I have the code for UpdateMultipleListItems (available on CodePlex). This code takes the COLS Level field on the Functional Area list's Edit Form and saves it to the COLS Level field in the Base Reporting list where the Functional Area in the Functional Area list is equal to the Functional Area in the Base Reporting. On the Base Reporting list's Edit Form the is code for making readonly fields using SPUtility. I found that The SPUpdateMultipleListItems was not working for me intially because when it tried to access that item in the Base Reporting list from the Functional Area Edit Form it was being blocked. When I commented out that part of the code on the Base Reporting Edit Form then I was able to update. My question is it possible to make a field in list (Base Reporting) readonly through another list (Functional Area)?

Peace and Blessings,

Nikkia Carter