How to allow Apostrophe/quotation marks in Calculated Column - I know that they aren't normally allowed

Hey everyone,

Today I ran across an issue where a user wanted to put a document in a library. They gave it a title that had an apostrophe (using the word It's) When this happened, the title then disappeared completely. To fix this I added a simple manual HTML code in the title to make the quotation appear. 

Is this possible to do on a large scale? 

Maybe within a calculated column in a content type?

Thanks!

I edited the document, by editing the properties.

I went to the title

and added 's

Please let me know if it is possible to allow apostrophes. Or is this simply not possible. Why did adding the html code in the file title work?


August 20th, 2015 10:47pm

Hi Marc Thomas187,

According your description, I could not understand very well. I want to know the blow

1. Do the other libraries have the same problems?

2. When you edited the properties, did you add the whole title or only add ' ?  In other words, do the other characters exist?

For troubleshooting this issue better, please provide some screenshots about this issue. It will make others in the forum easy to find a solution for you.

In addition, please create a new library in the same site, and test in the new library, compare the result.

Also, create a new library in a different site collection, test and compare the result.

Best regards,

Free Windows Admin Tool Kit Click here and download it now
August 21st, 2015 10:06am

hi,

you can create content editor on the same page and write a JQuery code on Ready Function. I haven't tried it yet, but hope it will work.

Write the set of special characters you want to replace and then replace it with desired symbol.

e.g. var specialChar1="#39";

       var replacementChar1="/'/";

  $(document).ready(function() {
        document.title.html().replace(specialChar1, replacementChar1); //not sure about exact syntax.

    });

August 21st, 2015 10:49am

HERE is what I found.

File title is a calculated column. This column is in a content type that is applied to over 150 sites. I just changed the view to apply the OOB columns (name and title). You can see that I have used the real apostrophe instead of using 's. The real apostrophe does not work in the calculated column. It works with the OOB name and titles column which is great. I need to change the code for this calculated column because this column is being applied to over 100 sites. I could do single site changes by changing the views, but this will take forever to do this for 100 sites.

The code for my calculted column is

="<script type='text/javascript'>"&"	var buildURL = '/_layouts/DocIdRedir.aspx?ID="&[Document ID Value]&"';"&"	var target = '_blank';"&"	var innerHTML = '<a href=' + buildURL + ' target=' + target + '>"&Title&"</a>';"&"document.write(innerHTML);"&"</script>"

I hope this clears things up.

Free Windows Admin Tool Kit Click here and download it now
August 21st, 2015 1:50pm

thank you for a resolution Sachin,

however I have already resolved the issue for one page. There are about 100 libraries. I am using a content type for each of them. Can I apply this code to my calculated column in my content type.?

August 21st, 2015 1:51pm

Hi Marc Thomas187,

I am wondering whether you applied the code to the calculated column in one library, then you want to make the modification have an effect on the content type.

Are you having 100+ sites or libraries? Are all sites or libraries in a same site collection?

If you have 100+ libraries, and these library are in a same site collection, you can try to apply the code to the calculation in the site content type via Site content types->[the content type]->[the calculated column]->edit site column, then select Yes for Update all content types inheriting from this content type?.

Best regards,

Free Windows Admin Tool Kit Click here and download it now
August 24th, 2015 5:08am

All sites are within the same site collection.

The calculated column is using this code currently, which is creating the issues with the folders.

="<script type='text/javascript'>"&"	var buildURL = '/_layouts/DocIdRedir.aspx?ID="&[Document ID Value]&"';"&"	var target = '_blank';"&"	var innerHTML = '<a href=' + buildURL + ' target=' + target + '>"&Title&"</a>';"&"document.write(innerHTML);"&"</script>"

All 100 sites are affected. 

Which new code are you referring to Wendy that I should apply to the calculated column?

August 24th, 2015 10:00am

Hi Marc Thomas187,

After I did some tests, I have found a solution to the problem.

You could try the code below

="<a href='/_layouts/DocIdRedir.aspx?ID="&[Document ID Value]&"' target='_blank'>"&Title&"</a>"

Hope it will be helpful to you.

Best regards,

Free Windows Admin Tool Kit Click here and download it now
August 24th, 2015 11:12pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics