Sunday, 15 January 2012

c# - How to assign value to custom field on AddItem -



c# - How to assign value to custom field on AddItem -

i have custom field written in c#. custom field inherits spfieldtext. work well, until want add together info splist , assign value on powershell.

my ps code:

... $newitem = $splist.additem() ... $newitem["customfield"] = $value --> error $newitem.update() object reference not set instance of object. + $newitem["customfield"] = $value + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + categoryinfo : operationstopped: (:) [], nullreferenceexception + fullyqualifiederrorid : system.nullreferenceexception

all other (native) column types work well, can´t assign custom field type. checked if column present. is.

$newitem.fields.containsfield["customfield"] returns true.

then checked xmlscheme , custom inherited field there.

could please suggest option, how handle - assign value custom fields?

c# list powershell sharepoint sharepoint-2013

No comments:

Post a Comment