locked
How to add ntext attribute while create a record? RRS feed

  • Question

  • I am trying to create an record for a custom entity.
    And this entity has a ntext attribute name note_content.

                    TargetCreateDynamic targetCreate = new TargetCreateDynamic();
                    DynamicEntity myEntity = new DynamicEntity();
                    myEntiy.Name = "new_entity";

                    StringProperty myNote = new StringProperty();
                    myNote.Name = "note_content";
                    myNote.Value = inputNode;

                    myEntiy.Properties = new Property[] { myNote};

                    targetCreate.Entity = myEntity;
                    ........

    -------

    My problem is while inputNode is vary large.
    Create will fail.
    Is there anything wrong?
    Friday, August 28, 2009 11:23 AM

Answers

  • Why is it that you are trying to put an image in a character field?  Are you even casting it as character data?

    • Marked as answer by Jim Glass Jr Monday, August 31, 2009 7:17 PM
    Monday, August 31, 2009 6:44 PM

All replies

  • Try setting the timeout on your service to a larger number, like this:

    service.timeout = 10 * 60 * 1000 'Timeout set to 10 minutes
    Friday, August 28, 2009 5:04 PM
  • Thanks for replying.

    But the problem does not service timeout.

    what I am doing is upload an image to my custom entity.

    The file size is only 4k.

    I guess the proplem is in "StringProperty".

    Maybe I should use other class for ntext.

    But I don't know how to do that.
    Saturday, August 29, 2009 9:27 AM
  • Hi,

    do you get a SoapException? Please look at its detail property. It should state more information about the error.
    Maybe your inputNode variable containes more chars, as the specified maximum of note_content
    Sunday, August 30, 2009 11:14 AM
  • Why is it that you are trying to put an image in a character field?  Are you even casting it as character data?

    • Marked as answer by Jim Glass Jr Monday, August 31, 2009 7:17 PM
    Monday, August 31, 2009 6:44 PM