Create New List Item

I am getting an error each time I try to run this code and get the error message "There was a problem submitting your answers. Please try again later."I have looked at this for so long now I am not sure if I am missing something or what. I have referenced SPServices and jquery and it is working correctlyI am trying to make a crossword using some code I found online and I followed it andstill get this error. // Create an object to associate each SharePoint column with the class name used for the input and the user's response for that column
var responses = {
"oneAcross": {
"selector": "one-across",
"column": "OneAcross",
"answer": ""
"oneDown": {
"selector": "one-down",
"column": "OneDown",
"answer": ""
"twoDown": {
"selector": "two-down",
"column": "TwoDown",
"answer": ""
"threeDown": {
"selector": "three-down",
"column": "ThreeDown",
"answer": ""
"fourAcross": {
"selector": "four-across",
"column": "FourAcross",
"answer": ""
// Create the batchCmd variable that will be used to create the new list item
var batchCmd = '<Batch OnError="Continue"><Method ID="1" Cmd="New">';
// Concatenate values of each response input by iterating over the object representing the responses
$.each( responses, function() {
// Cache the current item in the responses object.
var $response = this;
// For each input in the crossword associated with the current response object, get the values and save them in the answer property.
$( '.' + $response.selector ).each( function() {
$response.answer += $( this ).val().toLowerCase();
// Add the response to the batchCmd
batchCmd += '<Field Name="' + $response.column + '"><![CDATA[' + $response.answer + ']]></Field>';//Create a new list item on the destination list using the batchCmd variable
$().SPServices({
operation: "UpdateListItems",
async: true,
webURL: "http://operations.home.blah.com/sites/EIS/SEEIS/SSC/Lists/",
listName: "Crossword",
updates: batchCmd,
completefunc: function( xData, Status ) {
// If the AJAX call could not be completed, alert the user or include your own code to handle errors.
if ( Status !== "success" ) {
alert( "There was a problem submitting your answers. Please try again later." );
else {
// If there was an error creating the list item, alert the user or include your own code to handle errors.
if ( $( xData.responseXML ).find( 'ErrorCode' ).text() !== "0x00000000" ) {
alert( "There was a problem submitting your answers. Please try again later." );
// if the list item was successfully created, alert the user and navigate to the Source parameter in the URL (or to a URL of your choosing).
else {
alert( "Your answers were submitted successfully! Click OK to continue." );
if ( window.location.href.indexOf( "Source=" ) !== -1 ) {
var url = window.location.href.split( "Source=" )[1].split( "&" )[0];
window.location.href = url;
else {
window.location.href = "/";

When I look at the demo on the page it fires the same response as that is part of the error handling because it is a standalone HTML and not on a sharepoint server so I am wondering if something I am missing on the submit.click function or batchcmd. 
I included the entire code for it to see if maybe you can see something I am not.  My crossword is on a Sharepoint Server
$( '#crossword-submit' ).click( function( event ) {
// If you decide to use a hyperlink instead of a button input, this will prevent
//the hyperlink from actually navigating away from the page or to an anchor.
event.preventDefault();
// Disable the button so the user can't click it again and submit the answers more than once.
$( this ).prop( 'disabled', true );
// Prevent submission if the crossword isn't completed.
if ( $( '#crossword' ).find( 'input' ).filter( function() { return $( this ).val() === ""; }).length !== 0 ) {
alert( "You have left some answers blank. Please complete all answers before submitting." );
$( this ).removeProp( 'disabled' );
return false;
// Confirm that the user wants to submit their answers.
var confirmResponse = confirm( "Are you sure you are ready to submit your answers? Once submitted they cannot be changed.\n\nClick OK to continue or Cancel to review your answers." );
if ( confirmResponse === false ) {
$( this ).removeProp( 'disabled' );
return false;
// Create an object to associate each SharePoint column with the class name used for the input and the user's response for that column
var responses = {
"oneAcross": {
"selector": "one-across",
"column": "OneAcross",
"answer": ""
"oneDown": {
"selector": "one-down",
"column": "OneDown",
"answer": ""
"twoDown": {
"selector": "two-down",
"column": "TwoDown",
"answer": ""
"threeDown": {
"selector": "three-down",
"column": "ThreeDown",
"answer": ""
"fiveDown": {
"selector": "five-down",
"column": "FiveDown",
"answer": ""
"sixDown": {
"selector": "six-down",
"column": "SixDown",
"answer": ""
"sevenDown": {
"selector": "seven-down",
"column": "SevenDown",
"answer": ""
"eightDown": {
"selector": "eight-down",
"column": "EightDown",
"answer": ""
"fourAcross": {
"selector": "four-across",
"column": "FourAcross",
"answer": ""
"nineAcross": {
"selector": "nine-across",
"column": "NineAcross",
"answer": ""
"tenAcross": {
"selector": "ten-across",
"column": "TenAcross",
"answer": ""
"elevenAcross": {
"selector": "eleven-across",
"column": "ElevenAcross",
"answer": ""
"twelveAcross": {
"selector": "twelve-across",
"column": "TwelveAcross",
"answer": ""
// Create the batchCmd variable that will be used to create the new list item
var batchCmd = '<Batch OnError="Continue"><Method ID="1" Cmd="New">';
// Concatenate values of each response input by iterating over the object representing the responses
$.each( responses, function() {
// Cache the current item in the responses object.
var $response = this;
// For each input in the crossword associated with the current response object
//, get the values and save them in the answer property.
$( '.' + $response.selector ).each( function() {
$response.answer += $( this ).val().toLowerCase();
// Add the response to the batchCmd
batchCmd += '<Field Name="' + $response.column + '"><![CDATA[' + $response.answer + ']]></Field>';
// Close the batchCmd variable
batchCmd += '</Method></Batch>';
// Create a new list item on the destination list using the batchCmd variable
$().SPServices({
operation: "UpdateListItems",
async: true,
webURL: "http://operations.homestead.abc.com/sites/EIS/SEEIS/SSC/Lists/",
listName: "Crossword",
updates: batchCmd,
completefunc: function( xData, Status ) {
// If the AJAX call could not be completed, alert the user or include your own code to handle errors.
if ( Status !== "success" ) {
alert( "There was a problem submitting your answers. Please try again later." );
else {
// If there was an error creating the list item, alert the user or include your own code to handle errors.
if ( $( xData.responseXML ).find( 'ErrorCode' ).text() !== "0x00000000" ) {
alert( "There was a problem submitting your answers. Please try again later." );
// if the list item was successfully created, alert the user and navigate
//to the Source parameter in the URL (or to a URL of your choosing).
else {
alert( "Your answers were submitted successfully! Click OK to continue." );
if ( window.location.href.indexOf( "Source=" ) !== -1 ) {
var url = window.location.href.split( "Source=" )[1].split( "&" )[0];
window.location.href = url;
else {
window.location.href = "/";
</script>

Similar Messages

  • SharePoint Designer 2013 (2010 Platform Workflow) - How can I create a new list item with a SPECIFIC content type?

    In SharePoint 2010 I created workflows that used the 'Create list Item' Action, which then set the Content Type ID (so I could create documents of various types in a document library). 
    We just switched to the SharePoint 2013 platform, and now the drop down for Content Type ID is blank in all of the workflows that are still using the SharePoint 2010 platform.  Is there any way to create a list item with specific content
    type?  Even if I could just input a string into that field instead of using this blank drop-down.  Please help! 

    Hi Sarah,
    According to your description, my understanding is that you cannot create a new list item with a specific content type using SharePoint 2010 Platform Workflow.
    I tested the same scenario in my environment, and the Create List Item worked fine with the specific content type.
    How did you create the content type?
    Please check if the content type is added to the list/library the workflow associated with.
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Using a newly created Library document to create a list item and attach itself

    I have a workflow that moves a document from one library to another.
    When a document is moved to a certain library I want to create a list item with a link to the document in the list item.  Keep in mind there could be 10 files submitted to the library, so then in my list I would want 10 new list items created for
    each file, with a link to the individual file. or is there a way to attach the document to a newly created list item programmatically?
    is this possible?

    Hi,
    According to your post, my understanding is that you wanted to use a newly created Library document to create a list item and attach itself.
    I recommend to create a workflow assocaited to the second library, and start the workflow automatically when an item is created.
    Then add action as below:
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Reversal FB08 Creating New OPEN ITEM instead of clearing the open item.

    Dear All,
    My user has an issue whenever he does any reversal  Tcode - FB08 in one of the general ledger  "Cash in Transit"  nature "open item" & "Line item"  instead of clearing the open it it  creates a new open line item.
    I have checked in Table BKPF , the reversal number is being updated but this items are still appearing open item in FBL3N and not appearing in F-04 (all reversals) for clearing.
    Can any one share what can be the reason its creating new open item  and how can i solve the issue for clearing the account.
    Thanks & Regards
    Pravin

    hi
    Please check following cases
    - whether this is happening in all the reversal cases of Cash in transit
    - Whether is user is just using FBRA (Onsly resetting) and not going for reversal
    - Chances would be one or two partial clearing may have taken for single document for the offsetting accounts
    Thanks
    Sandeep

  • Can we create a list item as a data block item?

    Hi,
    I have changed a text item to list item on the data block.
    This list item used to get populated when it was control block item, but after i changed it to data block item, it's not getting populated.
    My question is, can we create a list item(poplist) as a data block item?
    Any idea?
    Thanks in advance
    R.G

    Hi
    When you use ctl blocks data dose not fetch from Database. But in data blocks it get fetches when you execute query. So you have to make sure table column values are matching with the List Box values you have given.
    So please check table values.
    Nilaksha.

  • Reconfigure sales BOM deletes line item and creates new line item

    We are having issue with Sales BOM. Once sales BOM is reconfigure, line item is automatically deleted and creates new line item. These changes are not captured by reporting tool. Is it standard SAP behavior? if its not standard behavior, how to fix this issue?

    Hi,
    If i am not wrong, i assume you are using site instead of plant.   If it is plant , then "yes", we can have a order with same material being line item 10 and 20 with different plants.  Reg delivery, if the plants are configured to a same shipping point then you will have one delievery.  if the plants are configured for a different shipping point , then delivery will be split up.
    Reward if it helps,
    Thanks & regards,
    CLN

  • Programatically create new mail item and open - body text lost on subsequent saves

    Hi,
    I have a problem with trying to create new GroupWise mail item from a
    button in a C3PO. I require programmatic access to this via the Object
    API, so it must be a saved draft. This is relativley straight forward to
    do - just create a mail item using the object API, and then use the Token
    API to open this item.
    This worked fine in 6.5.0, however in 6.5.1 and 6.5.2 I have noticed that
    when the user does a subsequent save, the body text of the message
    dissappears in the GUI (it is updated correctly in the draft however) -
    and all subsequent saves cause the body text to dissappear. If you close
    the mail item and open the draft manually you can continue as normal.
    As a test, I also tried to use the Token API to create a new mail item,
    and then again to save the item in the work in progress folder. This
    seems to work fine the very first time you do this, but each subsequent
    time the same behaviour is seen - i.e. the body text of the email is
    deleted from the GUI. Also, another observation here, event though the
    mail item was saved in the WIP folder via the token API command
    ItemSaveMessageDraft, it moves into the users MailBox when the user saves
    it manually.
    I have posted the two snippets of code from my test C3PO project at then
    end.
    This is a major problem, as we need to be able to reliably create new mail
    items from a toolbar button, so any help very much appreciated.
    Regards
    Greg
    Test case 1: Create a new message object in the WIP folder, and then open
    it using Token API...
    Dim sRetString As String
    Dim DraftMail As Object
    Set DraftMail =
    g_C3POManager.ClientState.CurrentAccount.WorkFolde r.Messages.Add
    ("GW.MESSAGE.MAIL", egwDraft)
    g_Commander.Execute "ItemOpen(""" & DraftMail.MessageId & """)", sRetString
    Test case 2: Create a new mail via token API, then use token API to save
    the item in the WIP folder...
    Dim sRetString As String
    ' create the new mail item...
    g_Commander.Execute "NewMail()", sRetString
    ' Get the folder path as a string..
    Dim GWFolder As Object
    Dim sAccount As String
    Dim sFolderPath As String
    sAccount = g_C3POManager.ClientState.CurrentAccount.RootFolde r.Name
    Set GWFolder = g_C3POManager.ClientState.CurrentAccount.WorkFolde r
    sFolderPath = sAccount & "\" & GWFolder.Name
    ' dirty the message so save works...
    g_Commander.Execute "ItemSetText(""X00"";Subject!;"" "")", sRetString
    g_Commander.Execute "ItemSetText(""X00"";Subject!;"""")", sRetString
    ' do the save...
    g_Commander.Execute "ItemSaveMessageDraft(""" & sFolderPath & """)",
    sRetString

    Hi,
    I have a problem with trying to create new GroupWise mail item from a
    button in a C3PO. I require programmatic access to this via the Object
    API, so it must be a saved draft. This is relativley straight forward to
    do - just create a mail item using the object API, and then use the Token
    API to open this item.
    This worked fine in 6.5.0, however in 6.5.1 and 6.5.2 I have noticed that
    when the user does a subsequent save, the body text of the message
    dissappears in the GUI (it is updated correctly in the draft however) -
    and all subsequent saves cause the body text to dissappear. If you close
    the mail item and open the draft manually you can continue as normal.
    As a test, I also tried to use the Token API to create a new mail item,
    and then again to save the item in the work in progress folder. This
    seems to work fine the very first time you do this, but each subsequent
    time the same behaviour is seen - i.e. the body text of the email is
    deleted from the GUI. Also, another observation here, event though the
    mail item was saved in the WIP folder via the token API command
    ItemSaveMessageDraft, it moves into the users MailBox when the user saves
    it manually.
    I have posted the two snippets of code from my test C3PO project at then
    end.
    This is a major problem, as we need to be able to reliably create new mail
    items from a toolbar button, so any help very much appreciated.
    Regards
    Greg
    Test case 1: Create a new message object in the WIP folder, and then open
    it using Token API...
    Dim sRetString As String
    Dim DraftMail As Object
    Set DraftMail =
    g_C3POManager.ClientState.CurrentAccount.WorkFolde r.Messages.Add
    ("GW.MESSAGE.MAIL", egwDraft)
    g_Commander.Execute "ItemOpen(""" & DraftMail.MessageId & """)", sRetString
    Test case 2: Create a new mail via token API, then use token API to save
    the item in the WIP folder...
    Dim sRetString As String
    ' create the new mail item...
    g_Commander.Execute "NewMail()", sRetString
    ' Get the folder path as a string..
    Dim GWFolder As Object
    Dim sAccount As String
    Dim sFolderPath As String
    sAccount = g_C3POManager.ClientState.CurrentAccount.RootFolde r.Name
    Set GWFolder = g_C3POManager.ClientState.CurrentAccount.WorkFolde r
    sFolderPath = sAccount & "\" & GWFolder.Name
    ' dirty the message so save works...
    g_Commander.Execute "ItemSetText(""X00"";Subject!;"" "")", sRetString
    g_Commander.Execute "ItemSetText(""X00"";Subject!;"""")", sRetString
    ' do the save...
    g_Commander.Execute "ItemSaveMessageDraft(""" & sFolderPath & """)",
    sRetString

  • Create new master item by PL/SQL

    Hi All
    I would like to know about concept of create new master item using by PL/SQL
    or any solution to easy.
    thank and regard.

    Hey there,
    In order to create items in master items, via PLSQL you'll need to use oracle API for maintining items - EGO_ITEM_PUB.
    The procedure you'll need is Process_Item.
    Enjoy,
    Aaron

  • I don't have a "create new list" button in the reminder list when i press edit

    I tried to create a new reminder list, I open the reminder app, under Lists, i pressed the 3 bar symbol on the upper right hand corner, then i pressed edit, but there is neither the delete button () nor the  "create new list" button. Can someone tell me how to get the create new list button?

    I had that problem too!
    Do you have a hotmail account that you have connected to?
    Because I do and I couldn't make a new reminder list!!
    But I fixed it by going to settings and going to mail, contacts and calendar and then under "accounts" i went to Mail and then slided the little dot for reminders to off.
    This fixed it for me, hopefully for you too! 

  • I can't create new lists in reminders

    I've recently got an iPhone 4S and I've been trying to add a new list to reminders and edit one of the existing ones but I've been unsuccessful so far. I've followed the instructions from the user's manual and everything seems fine until the very end, I do get to the stage where I can tap the Edit button but then nothing happens when I tap the name of the existing list to edit it. Any ideas how I could resolve this issue are much appreciated! Thanks.

    Hi,
    Thanks for your answer. I can edit the contents just fine, the problem is with creating/editing/deleting lists. Since you mention 'tapping edit then "Create New List"', I think that's where part of the problem lies because I can't create a new list. When I tap 'Edit', I can see my existing (pre-defined) lists but there is no "+" button or a "Create New List" button. I can't tap the lists, nothing happens and no red circle with a horizontal line appears.
    Incidentally, I can't change the names of the pre-defined calendars either but I've sort of managed to bypass that problem by syncing the iPhone with iTunes and importing my calendar from iCal.
    Do you think I should take it back to the shop or is there any other way I could resolve this issue?
    Thanks

  • List data validation failed when creating a new list item but does not fail when editing an existing item

    Dear SharePoint Experts,
    Please help.
    Why does my simple formula work in Excel but not-work in SharePoint?
    Why does this formula...
    =IF([Request Type]="Review",(IF(ISBLANK([Request Date]),FALSE,TRUE)),TRUE)
    ...work in Excel but fail when I try to use it in SharePoint?
    The intent of this formula is the following...
    If the field "Request Type" has the value "Review" and the field "Request Data" is blank then show FALSE, otherwise show TRUE.
    SharePoint saves the formula, but when a list item is saved where the formula is implemented, (under List Settings, List Validation), SharePoint does not, say anything other than that the formula failed.
    Note that the "list data validation failed" error only happens when I am creating a new item-- the formula above works just fine when one is trying to Save on the edit form. 
    Can you help?
    Thanks.
    -- Mark Kamoski

    Dear Jason,
    I appreciate your efforts.
    However, it seems to me that this statement of yours is not correct...
    "If it meet the validation formula, then you can new or edit the item, otherwise, it will throw the 'list data validation failed' error, it is by design".
    I believe this is NOT the answer for the following reasons.
    When I create a new item and click Save, the validation error is "list data validation failed".
    When I edit an existing item and click Save, the validation error is "my custom error message" and this is, I believe, the way it needs to work each time.
    I think, at the core, the error my formula does not handle some condition of null or blank or other default value.
    I tried a forumla that casts the date back to a string, and then checked the string for a default value, but that did not work.
    I tried looking up the Correlation ID in the ULS when "list data validation failed" occurs, but that gave no useful information because, even though logging was set to Verbose, the stack trace in the error log was truncated and did not given any
    good details.
    However, it seems to me that SharePoint 2013 is not well-suited for complex validation rules, because...
    SharePoint 2013 list-level validation (NOT column-level validation) allows only 1 input for all the multi-field validation formulas in a given list-- so, if I had more than 1 multi-field validation rule to implement on a given list, it would need to be packed
    into that single-line-of-code forumla style, like Excel does. That is not practice to write, debug, or maintain.
    SharePoint 2013 list-level validation only allows 1 block of text for all such multi-field validation rules. So that will not work because I would have something like "Validation failed for one or more of the following reasons-- withdrawal cannot exceed
    available balance, date-of-birth cannot be after date-of-death,... etc". That will not work for me.
    The real and awesome solution would simply be enhancing SP 2013 so that column-level validation forumlas are able to reference other columns.
    But, for now, my workaround solution is to use JavaScript and jQuery, hook the onclick handler on the Save button, and that works good. The only problem, is that the jQuery validation rules run before any of the column-level rules created  with OOTB
    SP 2013. So, in some cases, there is an extra click for the enduser.
    Thanks,
    Mark Kamoski
    -- Mark Kamoski

  • Is it possible for a 3rd party program to create a list item in sharepoint online 2013?

    I have limited experience with the online version of sp. I've been asked if it's possible for a 3rd party app that our company is beginning to use, to programmatically add items to a list.    I don't have any details about the program yet,
    but I've been told that a batch would run at night and they would like it to create items in a SP list and pass along several fields of metadata.   
    Is this possible in the online version?   I know that Power Shell can do this, but is it possible for an app to get access to run a PS command?   
    thanks,

    Yes.
    There is something known as the Client Side (?) Object Model or CSOM. This allows you to create list items, lists and even sites with .Net code from a non server machine.
    You could run 'classic' Server Object Model  C#/VB.NET or PowerShell to do the same job and it might be easier as there's alot more material out there on how to do it. On the other hand it's probably going to make your solution more complicated and
    harder to maintain over the long run.
    This article introduces you to the CSOM and how to use it and is applicable to O365 as well as on-premise:
    http://msdn.microsoft.com/en-us/library/office/fp179912%28v=office.15%29.aspx
    As an alternative you can look at the REST API which allows you to use web services to interact with SharePoint.
    http://msdn.microsoft.com/en-us/library/office/fp179912%28v=office.15%29.aspx

  • Create new line item while saving a new order

    I have a requirement to create a new line item with different item category while creating an order.
    i.e
    if the item category is ICT1, then create a new line item like item 1 but with item category ICT2.
    Also in the conditions tab, we need to update the condition type with  different values for both existing and new item.
    All this has to be in VA01 i.e on save.
    I tried to append lines of structure XVBAP at SAVE_DOCUMENT _PREPARE by changing the item no and item caegory. This works fine. But, how can I get other table details like XKOMV(which stores pricing condition details) for the new item?
    Please can you suggest any other exit/subroutine for this?
    or any other alternative solutions

    Hi,
    Try to use this EXIT:
    'EXIT_SAPMM06E_013'     Update Customer's Own Data in Purchasing Document
    The Badi and exit contains same parameter.
    Thanks,
    AMS

  • Read contents of excel and create new List based on excel

    HI,
    I have a excel file, which is uploaded in a document library. I am using C# and VS 2010.
    The excel file contains multiple sheets. I want to read the contents of the excel file and create a new List based on the contents of the excel file.
    How to achieve this programmatically?
    Thanks

    Hi.
    You can user OpenXML SDK to read excel Data.
    http://msdn.microsoft.com/en-us/library/office/bb448854.aspx
    Here an example of use.
    http://zsvipullo.blogspot.it/2011/08/excel-helper-leggere-un-file-xlsx.html
    Regards,
    Bubu
    http://zsvipullo.blogspot.it
    Please mark my answer if it helped you, I would greatly appreciate it.

  • Cant create new list in reminders

    I cannot create a new list in reminders (iphone5).  There are lists for each of my email accounts, but I cannot create a new one.

    What happens when you try? Describe the steps you're taking.

Maybe you are looking for

  • Autotype from XML schema problems

    Hello, I am trying to autotype the following Xml schema: http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-3 My build.xml contains: <target name="autotype" >      <autotype           schemaFile="REL-5-MM7-1-3.xsd"           ta

  • After upgrade to 10.6.5 cannot connect to a port

    Let me apologise upfront - I don't speak the Apple language but need some help. I have upgraded to 10.6.5 (tried update and then also combo). I need to access my work e-mail remotely. This was not a problem before upgrade. It accesses via a port on t

  • EDI inbound in FI; Error handling

    Hi, I am facing a Problem in the EDI connecting the Workflow. Please suggest mesome tips to solve the Issue. The process is something like this:                   The User want to Pull the Error Information when an Idoc is processed related to FI and

  • SSAS cube sync between two servers using analysis service execute DDL task in SSIS

    hi folks:   I have two AS servers: TOBIDW and TOBIDW2. TOBIDW2 is the production server where users use Excel to connect . TOBIDW has been identified as a backup Cube server in case if TOBIDW2 is not available.   My job is to create a SSIS package th

  • Custom cptone questions...

    I'm trying to define and use a custom cptone. But no matter what I do I can't seem to get it to take effect. For testing I'm basically trying to set every possible tone to the equivalent of a dial tone. As far as naming the custom cptone when I'm in