CSOM 2013 error: Unable to cast object of type 'System.Collections.Generic.Dictionary - csom

I'm using this code to loop columns of a SharePoint 2013 List.
currentContext.Load(currentList.Fields);
currentContext.ExecuteQuery();
foreach (Field f in currentList.Fields) {
}
No problem with normal columns. But, when I arrive to a lookup column I have this error:
"Unable to cast object of type
'System.Collections.Generic.Dictionary`2[System.String,System.Object]'
to type 'Microsoft.SharePoint.Client.Field'."
I found for example this discussion

This issue came when we were working with TaxonomyFieldValue fields. For us changing references was not an option. This helped:
TaxonomyItem dummy = new TaxonomyItem(web.Context, null);
It will force program to load adequate libraries forcing correct type in runtime.

I had this same issue and updating the references fixed it for me. This question helped me figure it out.
I went from version 14 of "Microsoft.SharePoint.Client" and "Microsoft.SharePoint.Client.Runtime" to version 16 and no longer had the error.
Latest client download

Related

VBA Run Time error in Excel 2013 that works well in Excel 2010

I have a macro that we were using for years and worked well in Excel 2010. However, now that we upgraded to Excel 2013, it gives a run time error 9.
The following code part is highlighted after debugging it:
Sheets(1).Copy after:=Workbooks(mfname).Sheets(3)
I know already that this error has to do something with the availability of the range. The question is if there is any easy fix to this? The relevant code-snippet:
Workbooks.Add
mfname= ActiveWorkbook.Name
Workbooks.Open template
template_name = ActiveWorkbook.Name
Sheets(1).Copy after:=Workbooks(mfname).Sheets(3)
Workbooks(mfname).Activate
Sheets(1).Delete
Sheets(1).Delete
Sheets(1).Delete
lapok = Sheets.Count
Thank you for the help!
I'm no expert in VBA, but little google searching says error 9 is subscript out of range error.
This likely is from Sheets(3). I also remember excel had 3 sheets open by default in those versions. Maybe that is not the case now, and causing the problem.

BreezeSharp client and the TimeSpan issue

We're unable to re-hydrate the Breeze# client object which has TimeSpan? properties and if prop value is not null
BreezeServer returns the TimeSpan in the ISO 8601 format (eq. "PT8H") but as TimeSpan.Parse() expects different format [ws][-]{ d | [d.]hh:mm[:ss[.ff]] }[ws] a System.FormatException is thrown ("String was not recognized as a valid TimeSpan") in the Breeze.Sharp.JsonEntityConverter while parsing objects.
Is this a known issue? IS there any workaround for it?
Ok, this was a bug and has been fixed in the lastest version on the breeze.sharp GitHub repo, it will also go out in the next release, probably sometime next week. Please confirm whether or not it corrects your issue.

Getting Error Array Type Required

I am trying to run this code:
RichViewEdit1.LineCount[i]:= Cipher.EncryptString(RichViewEdit1.LineCount[i]);
And I keep getting an error: Array Type Required.
Why I'm I getting this error?
More Info:
LineCount is - System.Integer
And TRichViewEdit does not have a "Lines" property.
Because RichViewEdit1.LineCount is not an array.
What it is ? don't know. Look into your sources, we cannot see them here.
PS. There seem to be no .Line*** properties at all: http://www.trichview.com/help/pme_cp_trichviewedit.html
Dunno if that still is relevant - http://www.trichview.com/support/trichview.support.examples/retrievingtext.htm
Also read through http://www.trichview.com/help/idh_rvgettext.html
PPS. since you paid for the component, you're entitled to get their programming examples and their customer support service. Both this and that are available at http://www.trichview.com/support/

SugerCRM Warning: Creating default object from empty value

when i am trying to edit field from sugerCRM editor then i am getting this issue.
even i try to use this patch as well as a solution for this error but still getting this issue.
https://github.com/sugarcrm/sugarcrm_dev/pull/143
( ! ) Warning: Creating default object from empty value in C:\xampp\htdocs\crm\trunk\modules\ModuleBuilder\views\view.modulefield.php on line 151
I found the other answer almost correct but it generated further warnings, this seemed to solve them completely for me:
if(!isset($module->mbvardefs) || is_null($module->mbvardefs)) {
$module->mbvardefs = new stdClass();
}
$module->mbvardefs->vardefs = $dictionary[$objectName];
It is kind of frustrating that SugarCRM comes with bugs like this when using modern versions of PHP..
Thanks friend but this issue is being resolved we just need to replace line number 151 in view.modulefield.php file with
if(!isset($module->mbvardefs) || is_null($module->mbvardefs)) {
$module->mbvardefs = new stdClass();
}
In order for this to work for me, I found that the inserted statement needed to come AFTER the original problem line instead of before it, but big thanks for the solution. This has solved a big headache for me that no-one else seems to have had a pill for!

Update Complex Fields Using Jira Rest Client 1.1-m02

Hello I'm trying to update some complex fields such as Issue Type or Status using Jira Rest Client Library for Java and I'm having some trouble. This is what I've got so far:
Issue issue = client.getIssueClient().getIssue(issueKey, null);
client.getIssueClient().update(
issue,
ImmutableList.of(new FieldInput(IssueFieldId.ISSUE_TYPE_FIELD,
issue.getIssueType())), null);
As you can see I'm only trying to update the issue type using it's own type (just to test it), however I get an Exception:
Exception in thread "main" com.atlassian.jira.rest.client.RestClientException:
org.codehaus.jettison.json.JSONException: Cannot generate value - unknown type for me:
class com.atlassian.jira.rest.client.domain.BasicIssueType
Am I missing something, is there any documentation for this library that I missed?
I managed to achieve what I was trying to do:
Issue issue = client.getIssueClient().getIssue(issueKey, null);
client.getIssueClient().update(
issue,
ImmutableList.of(new FieldInput(IssueFieldId.ISSUE_TYPE_FIELD,
ComplexIssueInputFieldValue.with("id", id))), null);
This will change the type of the issue, hope this will help anyone else who encounters this problem.

Resources