1

I have javascript to update the item title which loads while displaying the form(display form), the item is updating fine but till I refresh the page only, not while loading the view item

Here is the written code

var clientContext = SP.ClientContext.get_current();
var oList = clientContext.get_web().get_lists().getByTitle('Test_Versioning');

var oListItem = oList.getItemById(itemID);
oListItem.set_item('Title', 'My Updated Title New1');
oListItem.set_item('Editor', userid);
oListItem.update();
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
}

function onQuerySucceeded() {
    alert('Item updated!');
}

function onQueryFailed(sender, args) {
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}
0

try to using this fuction, all your code will be execute after loading

< !--#_

AddPostRenderCallback(ctx, function(){ });

_#-- >

sorry for my last response, i was not read good

  • i changed the response, i wasn't read good, i m sorry – Antonio Bellini Feb 10 '16 at 16:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.