SharePoint - Error: Term Guid Not available in TermStore
Asked By thulasiram G on 02-May-12 07:04 AM
Hi friends....
In my application i'm using managed metada services. While Binding taxonomy field values it throwing error saying that Term Guid Not Available in TermStore.
if any one knows Please let me y its getting??
kalpana aparnathi replied to thulasiram G on 02-May-12 07:09 AM
hi,
like this example:
byte[] fileBytes = sourceItem.File.OpenBinary();
bool overwritedestfile = true;
string destinationUrl = destinationList.RootFolder.Url + "/" + sourceItem.File.Name;
SPFile destinationFile = ((SPDocumentLibrary)destinationList).RootFolder.Files.Add(destinationUrl, fileBytes, overwritedestfile);
Regards,
thulasiram G replied to kalpana aparnathi on 02-May-12 07:18 AM
Hi Kalpana...thanks for your reply... i wil try it and let u know.
thulasiram G replied to kalpana aparnathi on 02-May-12 10:22 AM
Hi...
i tried,but still its getting error...
this is my code: please go throw once and let me know where i did mistake
Code:
Metadata Tag is like this:
Practice.text=Aerospace-AeroEngine-Heat Transfer, Aerodynamics, Internal Flow Analysis, Thermal
; //string i'm passing
TaxonomyFieldValue taxPractice = TaxonomyFieldControl.GetTaxonomyValue(Practice.text);
splistitem["Practice"] = taxPractice; // when i'm trying to bind its throwing error
kalpana aparnathi replied to thulasiram G on 02-May-12 01:51 PM
what error you get? explain it in detail.
thulasiram G replied to kalpana aparnathi on 03-May-12 01:51 AM
Hi kalpana thanks for your response...
Actually i'm integrating silverlight application with my sharepoint site, here i'm using custom taxonomy fields in silverlight application to get metadata. Through silverlight i'm passing values to my application. Metadata values with GUID's are getting perfectly, but when i'm trying to bind values to my list it's throwing error saying that "The Given GUID doesn't exist in the Termstore" (or) "invalid operation due to current state of object".
Please suggest me how to do for that?
thanks in advance....
kalpana aparnathi replied to thulasiram G on 03-May-12 04:50 AM
hi,
Ensure that the TaxonomyField object's SspId is set to the term store's ID. You can do this by:
taxoField.SspId = termStore.Id
taxoField.Update()
And also check your datareader which gives the correct connection .
Hope will helps!!!!!!!!!!!
Regards,
thulasiram G replied to kalpana aparnathi on 03-May-12 05:16 AM
Hi..
Thanks again for your reply....
Is there any Limit of charecters to pass perameters in silverlight application.
kalpana aparnathi replied to thulasiram G on 03-May-12 05:23 AM
no it is not limit more characters but you can use UpdatePanel to make your page not to be refreshed when we postback.
if you have any post back problem in your code so check it like this.
if(!ispostback())
{
//code
}
thulasiram G replied to kalpana aparnathi on 03-May-12 05:44 AM
Hi....
while retreaving values , its taking only upto some 400 charecters only after that its not taking ,may be this will be the reason to get this error. i'm almost 10 parameters are passed but its taking some 7 parameters values .
Whats the solution for this problem??
give me some idea??
kalpana aparnathi replied to thulasiram G on 03-May-12 05:50 AM
yours mean that you passes the 10 numbers of parameter and it takes only 7 parameter if so,please check your parameter which have auto increament if it is then you need not pass this parameter .kindly check your connection which all parameter and passing value of it.
thulasiram G replied to kalpana aparnathi on 03-May-12 06:38 AM
Hi...
Again i got new error this time..
Index was outside the bounds of the array.???
kalpana aparnathi replied to thulasiram G on 03-May-12 06:55 AM
check your index which is start with the 0 and also check your range of it.
thulasiram G replied to kalpana aparnathi on 03-May-12 07:37 AM
Hi...
Still i'm unable to resolve the issue. Now its getting same error saying that "Operation is not valid due to the current state of the object ". Why its getting the error. When i'm trying to bind the values to list that time only its showing.
kalpana aparnathi replied to thulasiram G on 03-May-12 07:44 AM
Try adding the following setting in your web.config's <appsettings>
block. in this block you are maximizing the MaxHttpCollection values
this will override the defaults set by .net Framework. you can change
the value accordingly as per your form needs.
<appSettings>
<add key="aspnet:MaxHttpCollectionKeys" value="2001" />
</appSettings>
thulasiram G replied to kalpana aparnathi on 03-May-12 08:10 AM
Hi... still its getting same error only.
thulasiram G replied to kalpana aparnathi on 04-May-12 01:19 AM
Hi kalpana...
Finally the bug was resolved by using this line:
HttpContext.Current = null;
Thanks for helped me out...