InsertCustomer seems to ignore some of the values I provide

Discussion in 'Developers Forum' started by Frank Carver, Sep 6, 2010.

  1. Frank Carver New Member

    I'm working my way through implementing a client for the KF APIs, and puzzled by some of the detail of what happens. Right now, I'm finding it difficult to write unit tests for GetCustomersModifiedSince because InsertCustomer seems to ignore some of the values I provide.

    The InsertCustomer call requires valid timestamps for "Created" and "Updated", but always seems to overwrite them with the start of the current day when the Customer is stored. This makes it tricky to run typical "extract/modify/load" cycles which put back the same data they took out.

    Is there any way of asking KF to store (and return) the actual provided data without changing it?
  2. DuaneJackson Administrator

    Hi Frank,

    I'm not sure why they are insisting on valid fields when you create a customer. They're read-only fields.

    They're updated/created internally by the system. There's no way for you to manually override them

    Duane
  3. Frank Carver New Member

    Thanks for the prompt reply, Duane. It's always a delight.

    > I'm not sure why they are insisting on valid fields when you create a customer. They're read-only fields.

    This was going to be a further question :) The API for InsertCustomer is quite different from the functionality provided by the KashFlow web application itself. The web app requires only a name (and a code, but that is typically auto-generated in the browser) to create a customer, but the InsertCustomer API requires a whole Customer (with its 28 fields) even though a lot of that information is either optional or will be thrown away as you have described.

    Is there any way that the API documentation could be updated to indicate which valuesare optional, and which will be discarded/overwritten?

    > They're updated/created internally by the system. There's no way for you to manually override them

    OK. Maybe you can help with some suggestions for reliable testing, then.

    My test suite currently starts from an "empty" KF account to ensure that there are no false results due to data lingering about. I'd like to test that my client can call GetCustomersModifiedSince to correctly distinguish between customers modified before and after the supplied timestamp. However, I am currently facing a combination of problems:

    1. I can't create customers with modified dates in the past.
    2. The GetCustomersModifiedSince call seems to ignore the hours, minutes and seconds, and only compare the dates.
    3. The GetCustomersModifiedSince call seems to truncate dates in the future to today.

    The end result is that I (so far) have no way of setting up data in the system which will result in anthing other than all created customers being returned, so I can't be sure that my client and the GetCustomersModifiedSince call are both working correctly.

Share This Page