Custom NewDocumentPath in user contributions

Ali Heristchian asked on June 2, 2015 09:34

Hi,
I want to conditionally control the new documents path in contribution list. I have a check box in document type and while that was checked I want to change the path to something else.
How can I access the special field data in SetupControl() method of user contribution?
I tried OnBeforeSave but that doesn't work because somehow the cycle of saving newDocumentPath in ViewState is after OnBeforeSave.
Thanks

Recent Answers


Brenden Kehren answered on June 2, 2015 13:45

If you find that is not working then create a global event handler for it. This will allow you more flexibility by allowing you to maybe define those path combinations in a custom table. Then you can check before your insert if it is that specific page type and path, then use the other path that was specified.

System event reference, use the DocumentEvents.Insert.Before event.

0 votesVote for this answer Mark as a Correct answer

Ali Heristchian answered on June 7, 2015 07:58

Thank you Brenden,
But how can I fetch form custom field value in DocumentEvents.Insert.Before and then change NewDocumentPath?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on June 8, 2015 13:47

You should be able to simply state string myValue = yourNodeObject.GetValue("YourCustomField")

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.