PowerShell simple casting error - sharepoint

$mlField = [SPFieldMultiLineText]$field
I have a field, it is of type field but I want to cast it as SPFieldMultiLineText (I can confirm that this is a valid cast, I'm assuming my syntax is bad).
The error I'm getting:
Unable to find type [SPFieldMultiLineText]: make sure that the assembly containing this type is loaded.
This is a SharePoint Management Console so all relevant SharePoint assemblies are loaded - this is not the issue.
Any pointers in the right direction of making this cast without an error?
Thanks a lot.
EDIT: For a bit more context, this is ultimately what I'm trying to achieve:
http://blogs.msdn.com/b/pavankumar/archive/2008/11/17/how-to-change-a-multi-line-text-field-to-allow-unlimited-length-in-a-document-library.aspx

Try with full type name:
$mlField = [Microsoft.SharePoint.SPFieldMultiLineText]$field

Related

How to use DocuementReference with class-transformer?

I'm using ClassSerializerInterceptor in my NestJS application to apply instanceToPlain when I return objects on incoming requests. I also use firestore as my main database. Some of my entities contains DocumentReference which I want to directly return without applying every time #Transform on it. When I do so, I got following error in my console:
ERROR [ExceptionsHandler] Value for argument "documentPath" is not a
valid resource path. Path must be a non-empty string. Error: Value for
argument "documentPath" is not a valid resource path. Path must be a
non-empty string.
I was trying to fix this by myself and found package class-transformer-firestore which seems to be potential solution, but it use prototype and have no readme at all, so I have no idea how to use it. I tried just to install it with no success.
Maybe someone faced the same issue and have solution to this.
Please check original repo again, seems like author updated it 👌🏻

How to fix 'Error: Enum value' in strapi content type?

I'm creating a new content type in Strapi, and I set a duplicate enum value in a type called Promotion. first value is 'fixed discount' second value is 'percentage discount'.
this error has frozen my local installation, and I don't know how fix this issue. Any help in directing me to the proper resource where I might find the answer to fix this? This is my first time working with database, content types or code in general, so any help would be appreciated.
I've tried looking in the strapi Github threads, but my problem doesn't seem to be answered in a way that I understand. This is a local installation on my new Mac, which is running Node and NPM, and all the Strapi plugins are activated
I'm receiving an error message that reads:
[2019-08-07T22:47:48.212Z] debug ⛔️ Server wasn't able to start properly.
[2019-08-07T22:47:48.213Z] error Error: Enum value "ENUM_PROMOTION_TYPE.discount" can only be defined once.
I would like to be able to start strapi and fix the error, or at least avoid this in the future
it seems like if you uninstall GraphQL, and run 'strapi build' it removes the dependancies and resets the database without the error.
You don't have to use spaces un an enum value.
The correct usage is to set "keys" that match displayed string in your front end application.
You don't have to set the value you will display.
So for example:
fixed as enum value has to match Fixed discount in your front end application
percentage as enum value has to match Percentage discount
We fixed it in develop branch (for the next release) to allow only ^[A-Za-z][_0-9A-Za-z]*$

How to use "AsEnumerable()" on datatable in Azure function?

After getting the details from the DB in a [data-table], I am trying to convert it to Enumerable using "AsEnumerable()" though getting an error message.
I think I added all the assemblies required. Following is the error I am getting. Not able to find anything, any help will be appreciated.
Try referencing both "System.Data" and "System.Data.DataSetExtensions" (no need to reference Linq too).

"$ ./propellor --list-fields" yields "propellor: Prelude.read: no parse"

I am trying to specify a private field using Haskell's Propellor deployment library.
As context: the field in question is a file whose content I want to encrypt and have propellor place on the destination server during deployment. However, I haven't gotten nearly that far; before even attempting to set the field, I have run into an error while attempting to simply view propellor's current private fields.
Specifically, when I run the command to view fields, $ ./propellor --list-fields, it asks for my gpg key, prints some gpg key information, and then the following:
Currently set data:
Field Context Used by
----- ------- -------
propellor: Prelude.read: no parse
There should be some fields present which were set previously, but somehow they are not displayed here and instead I get only the propellor: Prelude.read: no parse error message. I have not yet attempted to add my own field.
It seems that propellor is having an issue trying to parse something, but I do not know what that could be. I realize this is not a lot to go on but am not sure what else to do. Has anyone run into a similar error with Haskell's propellor before or know what the issue could be?
Your self-answer is correct; here I will just look at the issue in a different light.
The error you got points to the read function in Prelude. read is an example of a partial function: its type...
read :: Read a => String -> a
... says that it can convert Strings into a value of any type a with a Read instance; however, we known that this does not work for all Strings, as the parsing might fail. To put it more dramatically, the type of read is a lie.
It is generally a good idea to avoid partial functions, not only because more often than not they are bugs waiting to happen (e.g. you assume the parse will never fail due to some precondition in your business logic, and then the precondition changes), but also because they tend to give extremely uninformative error messages (as you just noticed). In the case of read, for instance, a nicer alternative is readMaybe, which returns Nothing if the parsing fails. That gives an opportunity to react to the failure. In dfferent situations you might, for instance, find it appropriate to ask the user to retry, supply a default value or, if there is no other recourse, terminate the program with an error message that explains what went wrong in terms of what you are trying to do.
Sorry this question was so vague, but there was very little to go on from the error message. The issue is now resolved and here is an explanation in case it is helpful to anyone who comes across it while facing a similar error.
The code contained an instance of a configuration data type defined not in a module, but in a text file being read in via the Read class. In short, the issue was that I had altered the data type without comprehensively updating the text-defined configuration instance to accomodate the type change.
In the long-form version of the explanation the issue is sneakier, involving merging the data type change over a change to the text-configuration which was not recognized as in conflict due to no line conflicts.
But essentially the error was failure to read in a data type instance defined in text-form.
I have plans to define the configuration data instance in a module rather than reading it in from text, which should be caught by the compiler and give a more meaningful error message should a similar error arise.

WinRT - Windows Store - WinRT Originate Error - How do decipher such an error?

I'm working on a Windows Store app and I'm getting a WinRT error that doesn't really give me any information so I would like to know how to understand these sorts of errors.
Basically I get the error on the following line which is called inside OnPointerPressed:
m_gestureRecognizer->ProcessDownEvent(args->GetCurrentPoint(nullptr));
The error is:
First-chance exception at 0x76F54B32 (KernelBase.dll) in DXAML2.exe: 0x40080201: WinRT originate error (parameters: 0x80070057, 0x00000044, 0x03CEE72C).
This error didn't used to appear, the only thing I've changed is that this line is now wrapped in an if clause which tests if the current pointer's PointerId is the same as one I've stored just using == such as:
if(args->GetCurrentPoint(nullptr)->PointerId == m_UIPointerID)
I have no idea why this has started happening.
So my question is in two parts:
More generally, how do I understand what an error such as the above means?
And does anyone know this error has suddenly started happening now that I check the pointerId?
Thanks for your time.
P.S. I guess another thing that has changed is that there will already be 2 pointers on the screen (the one that gets pushed into this GestureRecognizer) as well as another one, hence the PointerId check.
"How to Decipher such an error"...
For any WinRT originate error, you can take the third address in the parameters list (in your example, 0x03CEE72C), and find a description of your error in the memory window.
While debugging, break when your error is thrown and open the memory window via Debug -> Windows -> Memory -> Memory 1
Copy and paste the address to get your "easy-to-find" error message.
As Raman said - it's good to look up the hex values shown. The first one is the memory location which won't tell you much without the symbols/source, which in this case is reported directly by Windows. Perhaps the public symbols can shed some more light on where the error came from, but the error code lookups are more helpful.
If you Bing for 0x80070057 you will find an MSDN article on Common HRESULT Values which lists
E_INVALIDARG : One or more arguments are not valid : 0x80070057
It doesn't give you all the details of course, so you're off to theorize. Perhaps you can only call args->GetCurrentPoint(nullptr) once and you should store/reuse the value? Maybe gesture recognizer is not configured correctly? Maybe the app window is not visible at the time the exception is thrown or the thread is wrong. Maybe some expected calls to gesture recognizer were missed due to filtering those out with these "if" statements.

Resources