Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
Warning about DAPI.UpdateNode()
Robert_Davies_(unlondonadmin_-_(deleted))
Hi.If you're wanting to change the extended data of a node and write it back with DAPI.UpdateNode() be warned that you actually seem to have to doAssoc exdata = item.pExtendedDataexdata.(key) = valueitem.pExtendedData = exdataDAPI.UpdateNode()rather thanitem.pExtendedData.(key)=valueDAPI.UpdateNode()In the latter case DAPI.UpdateNode() will return zero which according to the documentation means "no error." However it doesn't actually update anything...Maybe this is a case for an FAQ..?Best regards/matt.
Find more posts tagged with
Comments
Marie_Lindsay_(MLindsay_(Delete)_15608)
I think this is happening because pExtendedData is dynamically typed, and "item.pExtendedData.(key)=value" could be interpreted as other than an Assoc. Blatantly declaring it as an Assoc is definitely the way to go.The examples in the training course manual do declare an assoc, then populate it, but maybe we can make this more "obvious". I wondered--it looks like you're not using an LLNode's NodeCreateSubclassPre() method to help you handle this transaction. Is this on purpose? (Just curious.)
Mike_Oliver_(ollie_(Delete)_137504)
As a general practice the Dynamic data type should only be used where you specifically need to assign two types of values to one variable(and even that is not a good idea, i.e. this problem) Most data types can accept the native type data and error codes and do not need the Dynamic data type.
Robert_Davies_(unlondonadmin_-_(deleted))
Hi Marie.Thanks for the info.To answer your question. My reason for not using NodeCreateSubClassPre() is that it's not actually my nodes that I'm messing with.My code is run from a WebNodeAction and fiddles with with existing Discussion topics & replies to do thing like Mark unread and edit subject/body.Best regards/matt.