TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Yukesh Kumar
NA
19
1k
Saving data but not redirecting to my main page
May 21 2018 1:19 AM
Dear Friends,
Please help me on this issue.
i have written code with custom save button.
The issue is
My data is saved but its not redirecting to overall list on saving.
function SaveToArchive()
{
createListItem(Old_Comments,Old_Status,Old_CommitedDate_Return,FileId);
}
var clientContext;
var oListItem;
var itemId;
var oList;
function createListItem(Comments,Status,DateOR,FileId) {
clientContext =
new
SP.ClientContext.get_current();
oList = clientContext.get_web().get_lists().getByTitle(
'Archival-Bus PD'
);
var itemCreateInfo =
new
SP.ListItemCreationInformation();
this
.oListItem = oList.addItem(itemCreateInfo);
debugger;
oListItem.set_item(
''
, Comments);
oListItem.set_item(
''
, Status);
oListItem.set_item(
''
, DateOR);
oListItem.set_item(
''
, FileId);
oListItem.update();
clientContext.load(oListItem);
clientContext.executeQueryAsync(
Function.createDelegate(
this
,
this
.onQueryInsertSucceeded),
Function.createDelegate(
this
,
this
.onQueryInsertFailed));
}
function onQueryInsertSucceeded() {
alert(
'Archived Success!'
);
if
(!PreSaveItem())
return
false
;WebForm_DoPostBackWithOptions(
new
WebForm_PostBackOptions(
"ctl00$ctl40$g_dce98914_9b55_4959_a1ce_16d74ab6f672$savebutton2$ctl00$diidIOSaveItem"
,
""
,
true
,
""
,
""
,
false
,
true
))
}
function onQueryInsertFailed() {
alert(
"Archive Failed"
);
}
</
table
>
</
span
>
<
SharePoint:AttachmentUpload
runat
=
"server"
ControlMode
=
"Edit"
/>
<
SharePoint:ItemHiddenVersion
runat
=
"server"
ControlMode
=
"Edit"
/>
</
div
>
</
xsl:template
>
<
xsl:template
name
=
"dvt_1.body"
>
<
xsl:param
name
=
"Rows"
/>
<
tr
>
<
td
class
=
"ms-toolbar"
nowrap
=
"nowrap"
>
</
td
>
</
tr
>
<
tr
>
<
td
class
=
"ms-toolbar"
nowrap
=
"nowrap"
>
<
SharePoint:FormToolBar
runat
=
"server"
ControlMode
=
"Edit"
/>
<
SharePoint:ItemValidationFailedMessage
runat
=
"server"
ControlMode
=
"Edit"
/>
</
td
>
</
tr
>
<
xsl:for-each
select
=
"$Rows"
>
<
xsl:call-template
name
=
"dvt_1.rowedit"
/>
</
xsl:for-each
>
<
tr
>
<
td
class
=
"ms-toolbar"
nowrap
=
"nowrap"
>
<
table
>
<
tr
>
<
td
class
=
"ms-descriptiontext"
nowrap
=
"nowrap"
>
<
SharePoint:CreatedModifiedInfo
ControlMode
=
"Edit"
runat
=
"server"
/>
</
td
>
<
td
width
=
"99%"
class
=
"ms-toolbar"
nowrap
=
"nowrap"
>
<
IMG
SRC
=
"/_layouts/15/images/blank.gif"
width
=
"1"
height
=
"18"
/>
</
td
>
<
td
class
=
"ms-toolbar"
nowrap
=
"nowrap"
>
<
input
type
=
"button"
id
=
"btnSave"
value
=
"Save"
onclick
=
"SaveToArchive()"
>
</
input
>
DATA GETS SAVED BUT NOT REDIRECTING TO OVERALL LIST.
Reply
Answers (
7
)
Replica of SP online Production Site for Development Purpose
SharePoint to SQL server