If you want to remove URL from the Lookup columns in SharePoint, just copy and paste the following code into the page.
<div id="scriptdiv"></div>
<script language="javascript">
var CTXMAX = 5;
function RemoveLookupAfterPageLoad()
{
var table, i=1, ctx;
// Remove lookup links
while(i<=CTXMAX)
{
eval("if(typeof ctx" + i + " != 'undefined') ctx = ctx" + i +"; else ctx = null");
i++;
if(!ctx)
break;
table = document.getElementById(ctx.listName + "-" + ctx.view);
if(table)
{
table = table.parentNode;
table.innerHTML = RemoveLookupLinks(table.innerHTML);
}
}
}
function CreateDynamicFunction()
{
// Create a function "ExpGroupCallServerg_GUID"
var scriptdiv = document.createElement("div");
var i=1, funcExpGroup ="", ctx, val;
if(browseris.ie)
document.getElementById("scriptdiv").appendChild(scriptdiv);
while(i<=CTXMAX)
{
eval("if(typeof ctx" + i + " != 'undefined') ctx = ctx" + i +"; else ctx = null");
i++;
if(!ctx)
break;
funcExpGroup = funcExpGroup + "function ExpGroupCallServerg_{0}(arg, context){\n" +
"globalArg_g_{0} = arg; globalContext_g_{0} = context;\n" +
"setTimeout(\"WebForm_DoCallback('ctl00$m$g_{0}',globalArg_g_{0},Interceptor,globalContext_g_{0},ExpGroupOnError,true)\", 0);\n}\n";
funcExpGroup = funcExpGroup.replace(/\{0\}/g,ctx.view.toLowerCase().replace("{","").replace("}","").replace(/-/g,"_"));
}
scriptdiv.innerHTML = " <script" + " defer>" + funcExpGroup + "</" + "script>";
if(!(browseris.ie))
document.getElementById("scriptdiv").appendChild(scriptdiv);
scriptdiv.style.display="none";
}
CreateDynamicFunction();
//Ajax function interceptor
function Interceptor(htmlToRender, groupName)
{
ExpGroupReceiveData(RemoveLookupLinks(htmlToRender), groupName);
}
//Function which removes links using regex
function RemoveLookupLinks(htmlToRender)
{
return htmlToRender.replace(/<a[^>]*RootFolder=\*[^>]*>([^<]*)<\/a>/gi,"$1");
}
//Queue up the function to execute after page load
_spBodyOnLoadFunctionNames.push("RemoveLookupAfterPageLoad");
</script>
The function “getTagFromIdentifierAndTitle” is used by SharePoint particularly for changing form fields. But it is good enough only if you have straight forward fields. If you have enabled “Fill-in” values, it will not be able to find the correct element. Here is a extended version of this function to get the “Fill-in” enabled field.
function getTagFromIdentifierAndTitle(tagName, identifier, title)
{
var len = identifier.length, colonindex, splittitle, taglen, titlelen = title.length, slen;
var tags = document.getElementsByTagName(tagName);
for (var i=0; i < tags.length; i++)
{
var tempString = tags[i].id;
taglen = tags[i].title.length;
if(taglen<titlelen)
continue;
splittitle = tags[i].title.replace(title,"");
slen = splittitle.length;
if(slen == taglen || (slen > 0 && splittitle.indexOf(":") == -1))
continue;
if ((identifier == "" || tempString.indexOf(identifier) == tempString.length - len))
{
return tags[i];
}
}
return null;
}
I got some hands on experience about Business Productivity Online Suite(BPOS). Its a great tool for small companies who wants to have exchange server, office communicator, sharepoint and live meeting for their business needs. I do have experience with SharePoint and InfoPath but this assignment was quite challenging.
Well, What’s the challenge?
- New assignment requires me to use InfoPath forms to reduce client’s paperwork.
- Many bloggers have written that InfoPath form is not supported in BPOS standard suite.
- Client does not want to invest in buying InfoPath. Many of client users are contractors and client does not want to buy license if they need to.
So how I am going to do?
InfoPath is supported in BPOS standard suite. Even browser enabled InfoPath forms are supported.
So why am I writing review?
Well, even though InfoPath is supported, there are lots of limitations that I want to share with you. Of course, if the client would have got InfoPath license, my life would have been much easier but I love challenges. I had previously not worked with browser enabled form so it was a new concept for me. When I initial though of creating solution, I thought that InfoPath form is backed by .Net power so I don’t need to worry about anything and I will quickly put the solution but I was wrong. Here is a good list of InfoPath 2007 features those are not supported in InfoPath Form Service. This is a limitation of Form Service. On the top of it, there is a limitation of BPOS which cripples how we develop the solution.
Here is a list of limitations of InfoPath form Service and BPOS that I confronted so far.
- I cannot use any kind of .Net code
- I cannot retrieve data from SharePoint List/Web Service (throws evergreen LogID 5566 error. This error occurs because of certificate name – as per support response) using custom views.
- Some of the controls are not supported in browser enabled forms.
- BPOS does not support data connection library in standard suite so I have to manually change the URL while moving forms from staging site to production.
- Browser enabled form does not support mobile view.
Here is a list of what you can do with it?
- I can only use Rules, Conditional formatting and Data Validations.
- You can get all data from the list but not from particular view.
- It supports multiple view. You can even hide view and open it (for example) by clicking on a button.
