2
創建columnField在SharePoint從代碼 添加的內容類型到SharePointXmlConvert和SharePoint內部字段不等於
While getting the field name from the Sharepoint i get the following:
PD_FILE_PART_x002e_PD_POPEN_DATE_x003b_DOCSADM_x002e_PD_FILE_PART_x002e_SYSTEM_ID
while setting the same field from the Code using:
Here **strContentTypeField** passed parameter from another function.
SPWeb web = null;
try
{
web = DEUtilityInternal.CreateSPWebObject(siteUrl);
SPList spList = web.Lists.GetList(new Guid(strListName), false);
if (spList.ContentTypes.Count > 0)
{
for (int i = 0; i < fieldsToBeAdded.Count; i++)
{
string strContentTypeField = fieldsToBeAdded[i];
if (spList.ContentTypes[contentTypeName].FieldLinks[strContentTypeField] != null) continue;
if (!spList.Fields.ContainsField(strContentTypeField))
{
if (!spList.Fields.ContainsField(XmlConvert.EncodeName(strContentTypeField)))
continue;
else
strContentTypeField = XmlConvert.EncodeName(strContentTypeField);
}
}
}
}
這裏 XmlConvert.EncodeName(strContentTypeField)得到以下輸出:
PD_FILE_PART_x002e_PD_POPEN_DATE_x003B_DOCSADM_x002e_PD_FILE_PART_x002e_SYSTEM_ID
so while comparing the field I cannot return the value true.
What can I do for getting the value equal??
Thanx提前
謝謝,Binayacharya :)最後我爲我工作 – Adhikari
是@Binayachary ...它也適用於我!我完全按照你所說的去做了......它的工作原理與我想要的一樣! – MrClan