Community

Workflow Processing script does not recognize field

I try to assign a value to my field on workflow stage using this script. Field("Section 1\\Field1").Value="value"

But i got this error in my log : System.Runtime.InteropServices.COMException (0x80004005): No field with name 'Section 1\Field1'. 

 

Thank you

 

Was this article helpful?

0 out of 0 found this helpful

Comments

1 comment

  • Avatar
    Permanently deleted user

    A couple things:

    You have the option of doing "Document" or "Batch" level processing. Code will change depending on what level you select. Also, it would be helpful to see your entire code block.

    I will assume you are doing Document level processing in your script. A complete line of code (C#) should look something like this:

    Document.Field("Section 1\\Field1").Text = "value";

    In your document definition, do you have a section named exactly "Section 1"?

    In your document definition, do you have a field in Section 1 named exactly "Field1"?

    Spelling errors will cause issues, and it is case sensitive. I have also seen fields referenced this way where there is only 1 section in the document definition:

    Document.Sections[0].Field("Field1").Text = "value";

    I like this better for code readability when I only have 1 section.

    You can use ".Value" or ".Text" but there is a difference.

    Other things to think about:

    Do you have more than 1 Document Definition?

    Did you make sure to publish your document definition?

    0

Please sign in to leave a comment.