Name cannot begin with the '\"' character, hexadecimal value 0x22

I am trying to create Calculated Column in SharePoint Document Library using Client Object Model.
However getting following error while executing FieldSchema:
Name cannot begin with the '\"' character, hexadecimal value 0x22
Code:
 var calculated = "Calculated";
 var displayName = "Effective Date";
 var internalName = "Effective Date";
 var formula = "=IF(ISBLANK(Col_DocumentEffectiveDate),\"\",TEXT(Col_DocumentEffectiveDate,\"DD-Mmm-YYYY\"))";
 List lib = clientContext.Web.Lists.GetByTitle(docLibName);
 clientContext.Load(lib);
 clientContext.ExecuteQuery();
string fieldSchema = "<Field Type=\"" + calculated + "\" DisplayName=\"" + displayName + "\" Name=\"" +internalName+ "\" Formula=\"" + formula + "\"
/>";
lib.Fields.AddFieldAsXml(fieldSchema, true, AddFieldOptions.AddFieldInternalNameHint);
clientContext.ExecuteQuery();
Code does't work if i replace quotation marks("\) in Formula with "&quot;"
Could someone help with issue?

Hi,
I suggest you take the code below which works in my environment to do the test again:
ClientContext clientContext = new ClientContext("http://sp/");
List list = clientContext.Web.Lists.GetByTitle("List2");
FieldCollection fields = list.Fields;
clientContext.Load(fields);
clientContext.ExecuteQuery();
var displayName = "Cal2";
var formula = "=IF(ISBLANK([Created]), \"\" , TEXT([Created], \"DD-Mmm-YYYY\"))";
var fieldSchema = "<Field Type='Calculated' DisplayName='" + displayName + "' ResultType='Text'><Formula>" + formula + "</Formula></Field>";
fields.AddFieldAsXml(fieldSchema, true, AddFieldOptions.DefaultValue);
clientContext.ExecuteQuery();
Feel free to reply if the issue still exists.
Best regards
Patrick Liang
TechNet Community Support

Similar Messages

  • XmlException on ExecuteQuery - Name cannot begin with the ' ' character, hexadecimal value 0x20. Line 78, position 36.

    I'm getting XmlException when trying to call ExecuteQuery of the ClientContext.
    I'm getting this no matter what I'm trying to load and no matter what site I'm trying to connect to.
    This happens when connecting to Office365 site (tried multiple tenants and site collections).
    What's strange I'm getting this on one PC (Windows Server 2008 R2 without SharePoint installed), but not on another VM (Windows Server 2012 with SharePoint 2013 installed).
    This used to work on both in the past.
    Could it be that one of the windows updates broke it?
    Just for reference the test code is very simple and I'm calling it from a console app (same result on .NET 4.0, 4.5 and 4.5.1):
    static void ConnectTest(string username, string password, string url)
    SecureString securePassword = new SecureString();
    foreach (char c in password)
    securePassword.AppendChar(c);
    SharePointOnlineCredentials onlineCredentials = new SharePointOnlineCredentials(username, securePassword);
    using (ClientContext clientContext = new ClientContext(url))
    clientContext.Credentials = onlineCredentials;
    Web site = clientContext.Web;
    clientContext.Load(site);
    clientContext.ExecuteQuery();
     

    I faced with this exeption becouse of OpenDNS.
    You can try the following:
    1. Use another DNS server. (prefered solution)
    or
    2. Add the following in C:\Windows\System32\drivers\etc\hosts:
    157.56.58.43 msoid.YourSharePointName.onmicrosoft.com
    (157.56.58.43 it's a one of msoid.onmicrosoft.com ips you can resolve it yourself)
    for example if you SharePoint online url is org1.sharepoint.com you should add in hosts:
    157.56.58.43 msoid.org1.onmicrosoft.com

  • The project file could not be loaded. name cannot begin with the '3' character hexadecimal value

    Hi, I get this error when I want to create a custom project (from Autodesk 3ds Max SDK 2014). I really dont understand the error, I dont use any '3' character in my project name

    Hi MegaJuzwa,
    Based on your description, it seems that it is not the VS IDE usage issue, am I right? If so, I'm afriad that it is not the correct forum for this issue.
    >>Autodesk 3ds Max SDK 2014
    It seems that it is the third party tool, if so, sorry for that it is really is out of support range of VS General forum. But I found that it also has his own support site. I suggest you post this issue to this forum:
    http://forums.autodesk.com/t5/3ds-max/ct-p/area-c1
    I also found the simliar thread in above site:
    http://forums.autodesk.com/t5/programming/getting-started-problems/td-p/4265618
    If I have misunderstood this issue, please feel free to let me know.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Sharepoint 2007 list error - The '}' character, hexadecimal value 0x7D, cannot be included in a name. Line 1, position 440.

    Hi Everyone,
    We have a sharepoint 2007 deployment which in general has been fine since it was built.  
    Version is 12.0.0.6421 (MOSS 2007 SP2 (KB953334 & KB953338))
    on a Windows 2003 R2 SP2 server.
    We created a list a while back to store information for our servers but for some reason it now has an error.
    the symptoms are:
    1) Navigating to the list and choosing any view (a few custom views), we can see the data fine
    2)  Creating new items or modifying existing items brings up:
    An unexpected error has occurred.
    3) Trying to access the list settings brings up:
    An unexpected error has occurred.
    4) Using "view all site content" and clicking on the list brings up:
    The '}' character, hexadecimal value 0x7D, cannot be included in a name. Line 1, position 440.
    I've attempted to search for the error online but the error doesn't bring back anything specific to Sharepoint.
    My gut feeling is either a corruption of the list or a user has entered an invalid character in one of the list entries, but I cannot amend the list in any way.
    Ordinarily I would advise the user to re-create the list and enter the information from scratch, however this list contains alot of information and is crucial to the server teams documentation.
    Does anyone have any ideas on where I should be focusing my search efforts?  I did check the logs and couldn't see any obvious entries for this list.
    Any assistance would be greatly appreciated.
    Cheers,
    Carl

    Posted this a few weeks back - would appreciate any suggestions?
    Thanks,
    Carl

  • The '\' character, hexadecimal value 0x5C, cannot be included in a name. Line 1, position 29.

    Hi,
     Please guide i sve username="kpsoft/mahemd". It has write suceesfully but when try to read, this error raised "The '\' character, hexadecimal value 0x5C, cannot be included in a name. Line 1, position 29.". Please guide me. 

    Hi,
    I suggest you provide more information(likethe code) for further research.
    If the question is not relate to SharePoint, you can post it to a suitable Forum, you will get more help and confirmed answers from there.
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Error while running Configuration Wizard in SharePoint 2013: Exception in RefreshCache. Exception message :The '?' character, hexadecimal value 0x43A0, cannot be included in a name. Line 1, position 5694.

    Hi Friends,
    I was trying to run configuration wizard in SharePoint 2013 Central Administration and I got below error:
    Exception in RefreshCache. Exception message :The '?' character, hexadecimal value 0x43A0, cannot be included in a name. Line 1, position 5694.
    Yesterday my SharePoint server was running fine and today when I try to update a SharePoint solution (wsp) I got same error. Even if I try to do any operation
    in Central administration like adding new WSP, Updating WSP , I get same error.
    Does any one have any Idea?
    Regards
    Gireesh Painuly

    Posted this a few weeks back - would appreciate any suggestions?
    Thanks,
    Carl

  • The package name The Gallbladder-4.itmsp contains an invalid character(s).  The valid characters are: A-Z, a-z, 0-9, dash, period, underscore, but the name cannot start with a dash, period, or underscore

    I have an iBook on itunes and I am trying to upload a new version of the book. I am following the workflow through iBooks Author and when I fell out all of the infromation for the package on iTunes producer i then hit the deliver button and I get the following error message:
    The package name The Gallbladder-4.itmsp contains an invalid character(s).  The valid characters are: A-Z, a-z, 0-9, dash, period, underscore, but the name cannot start with a dash, period, or underscore.
    As far as I can tell the file that is being referenced does not meet the criteria axpressed in the erro message and in fact that file has been created by iBooks Author so one would think there shouldnt be an error.
    I also get the following to error messages:
    Apple's web service operation was not successful
            Unable to authenticate the package: The Gallbladder-4.itmsp
    Would ove any help.
    Thanks,
    Jeff

    Thank you so much for your help.
    For anyone that would like to check out this book it can be downloaded at:
    https://itunes.apple.com/us/book/the-gallbladder/id598317335?ls=1
    Please check out our free medical education blog by Jeffrey Eakin using iBooks Author at:
    http://free-medical-education-ibooks-author.blogspot.com

  • Hi - When I go into Contacts and type a letter in the search bar to get to last names that begin with that letter I get a list of random names that don't correlate to the letter. My settings are fine.  Help ?

    Hi. When I go into my contacts and type a letter in the saerch bar to get to a list of last names that begin with that letter I get a list of random names that don't begin or end with the letter.  My Settings appear fine.  Any insights would be greatly appreciated.  Cheers Bill

    The search bar is not designed to take you to names beginning with the letter you put in. If you want to do that, use the letters down the side. In the search bar, the device will return results for all contacts that have that have that letter in them. If you type a couple of letters of the name, you'll find what you want faster. Once you get used to how it works, it's quite efficient.
    Best of luck.

  • ITunes can't find artists beginning with THE

    My music collection was getting too large for my internal hard drive so I changed the location of my iTunes folder to my external drive, where there was already a back up of all my music. This I create by directly copying the itunes music folder every so often. Keep itunes organised is checked. When I changed the folder location, it did updating library, then asked if I wanted to organise the folder which I did.
    However now, it won't find certain tracks/albums, says the orignal file location cannot be found do I want to locate...
    It appears that itunes can't find any track whose artist begins with the word THE, although they are in folders called "The...." in the correct music folder.
    I just updated to the latest version of itunes.
    Does anyone know what might be going on???

    Something similar happened to me. iTunes could not find any music that had the track number at the beginning of the name (an option in Advanced->Import section). My purchased music also had track numbers, but I don't know if Apple did that, or if my own iTunes did it.
    At some point, I had turned off this option, so all the songs I imported after that were found just fine. When I deleted the track numbers from the file names, iTunes found them just fine. I have way too many files to change all the name manually however. Changing the naming option in the iTunes preferences did not make a difference to the problem.

  • "User names cannot start with a number" error while adding a user

    Is it possible to use WL Portal 7.0 admin framework to manage users with all numeric
    user id ?
    I got an error "User names cannot start with a number" while trying to add users
    with all numeric user ids. I am using "portalAppTools" web app provided with WL
    7.0 out of the box.
    What "out the box" functionality do I need to change to make this happen ? Thanks
    Shah

    The problem is that when we have user groups starting with a number, then the search
    feature doesn't work for user groups (case # 466837 with BEA).
    So, which brings me to the following question:
    a. Should the search feature work?
    b. What is the limitation? I mean, it is designed not to allow user groups starting
    with a number. So, there must be a reason for this. So, if we change "disallowFirstCharDigit",
    will it have any impacts on Portal?
    As an aside, it seems somewhat strange that the Portals can start with a number!
    Thanks in advance
    Venkatesh
    "Ture Hoefner" <replyto@newsgroup> wrote:
    Hello Shah,
    Search your tools web app for the UsermgmtTools.properties file. In
    my
    installation, it is at:
    D:\bea70sp1\weblogic700\samples\portal\sampleportalDomain\beaApps\sampleport
    al\tools\WEB-INF\classes\com\bea\jsptools\p13n\usermgmt\servlets\jsp
    It starts with this:
    # Messages and other properties used by usermgmt jsp tools
    # Name properties - UserBean and GroupBean
    disallowedCharacters: ~`!$%^&-*() {}[]|\\/?<>,:;+="'
    disallowFirstCharDigit: true
    Ture Hoefner
    BEA Systems, Inc.
    www.bea.com
    "Shah Sidi" <[email protected]> wrote in message
    news:3db0a001$[email protected]..
    Is it possible to use WL Portal 7.0 admin framework to manage userswith
    all numeric
    user id ?
    I got an error "User names cannot start with a number" while tryingto add
    users
    with all numeric user ids. I am using "portalAppTools" web app providedwith WL
    7.0 out of the box.
    What "out the box" functionality do I need to change to make this happen?
    Thanks
    Shah

  • "the ipod 'name' cannot be updated. the required file could not be found."

    PLEASE can someone help me out on a problem that is infuriating me?? i've not long had my 30GB 5th generation video ipod, and i can't get any photos or video to transfer onto it! when i connect my ipod and itunes opens up, an error message appears saying "the ipod 'name' cannot be updated. the required file could not be found". however, it updates my music no problem..
    i've reset my ipod, restored it and wiped all my music off and then transferred it all back on, downloaded the new ipod updater 28-06-2006 and made sure my ipod has the most recent software etc on there, but still no joy!
    i never had a problem transferring photos onto my old colour photo ipod (4th generation?), so it's really annoying that i have a supposed 'better' ipod now that won't do this for me!
    any help guys? please note, i am no techie - please put any advice in simple terms!
    Packard Bell desktop   Windows XP  
    Packard Bell desktop   Windows XP  

    Hello WGT52,
    It sounds like this error message is preventing you from syncing your content to the iPod. I would recommend the troubleshooting steps in the following article:
    iTunes: Troubleshooting issues with third-party iTunes plug-ins
    Thank you for using Apple Support Communities.
    Take care,
    Sterling

  • How can you get OS Lion back if you already downloaded Mavericks?  I CANNOT live with the battery life of 2 hours!!  HELP

    How can you get OS Lion back if you already downloaded Mavericks?  I CANNOT live with the battery life of 2 hours!!  HELP

    Kappy wrote:
    Don't downgrade OS X without first erasing the drive. You cannot restore a Time Machine backup of Lion directly on top of a later version of OS X such as Mountain Lion or Mavericks.
    When you "Restore from a Time Machine Backup.", the drive will be erased for you, but yes, won't hurt to:
    Boot into Recovery (hold ⌘R on boot)
    Utility->Disk Utility->Erase Macintosh HD, then Repair Macintosh HD
    Quit Disk Utility
    Then Select: Restore from a Time Machine Backup.

  • Jabber for Mac 9.2.1 Cannot communicate with the server

    Hi All,
    I'm using Webex and the Jabber for Mac 9.2.1 client that was automatically pushed.  I see "Cannot communicate with the server" when I attempt to login. 
    The same credentials work correctly when using the 8.6.5 client version.  I've attached the problem report file.
    I would appreciate some guidance on what I need to do to get this to work.
    Cheers,
    Steve

    We've seen this with a few of our users as well. All started noticing having issues Friday morning. As this is a hosted service for us via webex we had our engineers call in to Jabber support. Cisco performed a modification to their account and they were able to connect again. No SRV records were messed with.
    ***EDIT*** - This appears to have been caused by a certificate issue. The Trusted Root Certificate for QuoVadis expired and was not renewed on some machines. 
    Go here: https://www.quovadisglobal.com/QVRepository/DownloadRootsAndCRL.aspx
    Install the Cert for : QuoVadis Root CA2 (in windows, download as DER>right click file>install)
    Jabber should connect now. The issue was in SSL validation with the appropriate hosted servers.

  • I installed adobe digital editions but when I want to authorize a device (an e-reader) it doesn't work, I receive an error message that digital editions cannot connect with the activation server. what can I do?

    I installed adobe digital editions but when I want to authorize a device (an e-reader) it doesn't work, I receive an error message that digital editions cannot connect with the activation server. what can I do?

    Please quote the exact error message, word-for-word, verbatim.
    What is your operating system?
    What version of Lightroom?

  • GL account balance not matching with the total stock value

    Hi,
    The GL account balance is not matching with the total stock value in report RM07MBSTfor stock in transit, Can anyone please let me know, where should, I look into to verify the reason for difference.
    Quick response will be appreciated.
    Thanks & Regards

    I am able to solve this issue. My client has a customized report, which helped me to look into the details of stock in tranisit account. Stock in transit account actually include PPV and TPV alongwith standard cost.

Maybe you are looking for

  • How can I add a new message(custom text message) to the holiday approval em

    How can I add a new message(custom text message) to the holiday approval email-notification sent to the manager? TIA

  • 8.1.5 query execution problem

    Hello, I am using the following: Oracle database ver 8i Oracle spatial Ver 8.1.5 windows 2000 server I have a Polygon fatured layer in the db , exported from the Java SDO-sample programs 'sampleshapefileToSDO.java'. when I run the "desc MJM_Parcel" I

  • Problem viewing all_tab_columns from a package

    I have a cursor within a package that refers to all_tab_columns. When I run the select in SQL Plus I get the desired results. However when I run it as part of the package it returns no rows. The select is: SELECT atc1.column_name column_name FROM all

  • New iPad and Gmail as Exchange

    I tried setting my gmail up using the Exchange method that works on all other iOS devices. It allows you to save the account and gives you check marks however it constantly says connection to server failed. I have deleted and re-added the account and

  • Retreving the selected substring records from existing records.

    Hi all, SQL> select * from temp; C1 C2 1 abcdef 2 efbcda 3 axyz 4 abedcd I would like to retrieve only the records which have substring 'CD' from the available records.. Any help. Regards, ~ sri