• RE: Document Processing - How to import "Replace Text" values

    I'm firmly on the side of the developers with this one.  CSV files are a nightmare because commas show up way to often in live data so I never use commas as delimiters if there's any other option - I usually use a vertical bar but I've had clients that will opt for the ^

    Having said that, it would have been good to know that they were using semi-colons.
  • how to write to null table field using API

    Hi all,

    I'm using a c# web service to write an amount a decimal field in a table and it works great except for when the decimal field has been left blank and is therefore null, in which case it generates an error that says something like "unable to update XML document".  Unfortunately, the whole point of this web service is to give the user the option to leave that field blank so the web service can do a bunch of calculations and fill it in for them - I could default the field to zero and tell the users that they're allowed to leave it as zero, but I'd rather shoot for the more intuitive solution of letting them leave it blank (for the users, seeing a zero in there could cause problems).

    The error occurs at this point in the code:
    //Set for single entry a new price
    				columnIndexFieldAmount.Item = 30m;
    If the field is NULL it throws an error.  Are there some adjustments I can make that will allow it to write to a NULL decimal field?
  • RE: add row to table field with the API (C#)

    Hi Simon,

    I'm as surprised as you, but it's most definitely a Decimal column:

    The problem I ran into is when I tried to pass the value to the field the way I saw it in the kb article, like this:

    DocumentIndexField amountField = DocumentIndexField.Create("GL_AC_AMOUNT", 10);

    If I switch the 10 to having quotes around it (ie. pass it as a string) and use ItemChoiceType.String then it's quite happy.  Interestingly, this does work using ItemChoiceType.Decimal:

    DocumentIndexField amountField = DocumentIndexField.Create("GL_AC_AMOUNT", Convert.ToDecimal("10"));

  • RE: add row to table field with the API (C#)

    Hi Fabian,

    IT WORKS! But it wasn't as simple as that.  Here was the rest of the journey:

    I changed

    MyDoc = GetDocumentFromSelfRelation();

     to MyDoc = MyDoc.GetDocumentFromSelfRelation(); and didn't get an error but I was still getting the

    "Object reference not set to an instance of an object" error so I went through and commented out all the lines one-by-one until I found that the error was caused by this line:

    DocumentIndexFieldTable tableField = (DocumentIndexFieldTable)MyDoc.Fields.FirstOrDefault(f => f.FieldName == "GL Account Distribution").Item;

    I figured that it must be something to do with the field name because the only name I could find to use in the Configurations->Database Fields was "GL Account Distribution" but that doesn't look like a system name and we're always using a field's system name in web services.  A field's system name is usually visible when you click on the field itself, click on 'more options' and then use the 'Database column' value, but unfortunately table fields don't have that display so I took a guess and put underscores between the words and that got me past the "Object reference not set to an instance of an object" error!

    Unfortunately, I was still getting an error which is "There was an error generating the XML document.".  I commented-out this line and got rid of the error:

    MyDoc.PutToFieldsRelationForDocumentIndexFields(updatedTableIndexFields);

    I thought maybe it had something to do with the data I was writing to the table so I zero'd in on the Amount column as potentially being the problem because we'd already established that even though it's a Decimal datatype it still wanted the value passed as a string.  So I changed the ItemChoiceType setting from ItemChoiceType.Decimal to ItemChoiceType.String and everything worked!

    tldr; even though a column is a Decimal datatype you still have to treat it like a String

    (any chance someone can update the kb article to save others a lot of grief?)

  • RE: add row to table field with the API (C#)

    Hi Simon,
    That helped quite a bit.  Interestingly it didn't like the "MyDoc = GetDocumentFromSelfRelation();" bit at all because it generated an error saying: "CS0103: The name 'GetDocumentFromSelfRelation' does not exist in the current context" so I just commented it out and (after correcting some other errors) it compiles properly.

    A couple of notes about the sample code in the kb article:
    1. It didn't like ItemChoiceType.Text for the table columns that are Text but it does seem to like ItemChoiceType.String
    2. it doesn't like it when you pass the value of a Decimal field without quotations around it

    However, when I run it it says "Object reference not set to an instance of an object." and I've paired the web method back to the basics to see if I can figure out what's going on but I can't, so, much as I hate posting the code itself, I can't think of anything else to do:

    //get the document
                MyDoc = GetDocumentFromFileCabinetById(conn, "<CabinetGUID>", DocId);
            //MyDoc = GetDocumentFromSelfRelation();

                DocumentIndexFieldTable tableField = (DocumentIndexFieldTable)MyDoc.Fields.FirstOrDefault(f => f.FieldName == "GL Account Distribution").Item;


                           //make the code field
                            DocumentIndexField codeField = DocumentIndexField.Create("GL_AC_CODE", "Test Code");
                            codeField.IsNull = false;
                            codeField.ItemElementName = ItemChoiceType.String; //set the itemchoicetype according to what kind of field it is

                            //make the amount field
                            DocumentIndexField amountField = DocumentIndexField.Create("GL_AC_AMOUNT", "10.00");
                            amountField.IsNull = false;
                            amountField.ItemElementName = ItemChoiceType.Decimal; //set the itemchoicetype according to what kind of field it is

                            //make the description field
                            DocumentIndexField descriptionField = DocumentIndexField.Create("GL_AC_DESCRIPTION", "Test Description");
                            descriptionField.IsNull = false;
                            descriptionField.ItemElementName = ItemChoiceType.String; //set the itemchoicetype according to what kind of field it is

                            //creates a new table row and adds the existing field. If you have more than one column, create more fields like the first one and add to this list
                            DocumentIndexFieldTableRow newField = new DocumentIndexFieldTableRow() { ColumnValue = new List<DocumentIndexField>() { codeField, amountField, descriptionField } };
                            // when done with adding fields to the row, add the row to the table field
                            tableField.Row.Add(newField);
                    

            //Due to reference types we can just take the fields list
            //from original provided document object
            DocumentIndexFields updatedTableIndexFields = new DocumentIndexFields()
            {
                Field = MyDoc.Fields
            };
                MyDoc.PutToFieldsRelationForDocumentIndexFields(updatedTableIndexFields);

     
  • RE: Signature Services for Docusign

    Hi Michael, this is the best I've found and it looks fairly comprehensive : KBA-36398
  • RE: add row to table field with the API (C#)

    Update: I just tried it in a vm that has a web service that I know works with table fields (it has several other WebMethods that work with table fields) so I know the dll's are correct and I got the same error.  Here's how I'm declaring tableField:

    MyDoc = GetDocumentFromFileCabinetById(conn, "<cabinetGUID>", DocId);
    DocumentIndexField tableField = MyDoc.Fields.FirstOrDefault(f => f.FieldName == "GL Account Distribution" && f.ItemElementName == ItemChoiceType.Table);
  • RE: add row to table field with the API (C#)

    Hi Simon, thank you for the excellently-commented response.  A couple of questions (if you don't mind):

    1. For multiple columns do I just add them into the list like this: DocumentIndexFieldTableRow newField = new DocumentIndexFieldTableRow() { ColumnValue = new List<DocumentIndexField>() { codeField, amountField, descriptionField } };

    2. When I compile it I get this error: CS1061: 'DocuWare.Platform.ServerClient.DocumentIndexField' does not contain a definition for 'Row' and no extension method 'Row' accepting a first argument of type 'DocuWare.Platform.ServerClient.DocumentIndexField' could be found (are you missing a using directive or an assembly reference?)
    The vm I'm working in was created before table fields existed but I've dealt with that before so I added the updated dll's into the web service's bin folder so they're now version 7.3 [SDK_20200602.3] but that didn't help.
  • RE: Updating a second document

    Hi Steve, it sure is (and I'm fairly sure this functionality was added in version 7.1 or 7.2).  To do this you use a regular 'Assign Data' step and in the first column, Destination Type, you pick 'File Cabinet' and then build the rest of the step from there - in the second column you'll be picking the cabinet and setting the criteria so it updates the proper document in the other cabinet, etc.
  • add row to table field with the API (C#)

    I'm seeing sample code here for updating an existing table row but am wanting to write a new row to the table.  Has anyone done that in c#?