Skip to content

Question: How to programmatically add item to BagPart #6927

Answered by deanmarcussen
LMSSonos asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, the fields aren't welded on till later, and it won't become an ActivityDateItem (Part) until it gets serialized there and back again, probably.

Try with

activity.Alter<ContentPart>("ActivityDateItem", x => 
{
    x.Alter<TextField>("Description", d => d.Text = "SomeValue");
    ...
};

While hard type parts seem like a useful thing, they were never designed to be that, (they work because of a side effect), so there are a bunch of things that don't necessarily behave how you would expect, and places where you want to use them, but you can't, because they haven't become that yet.

As much as I like my hard typed classes, I've tried them, and gone away from them for the most part, as som…

Replies: 6 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by LMSSonos
Comment options

You must be logged in to vote
2 replies
@deanmarcussen
Comment options

@ns8482e
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #6927 on August 17, 2020 23:38.