在QBOL中添加和更新销售表单的自定义字段值

I am using V3 QBOL API consolibyte PHP API to sync Data with QBOL Canadian version. I add a custom field in Invoices and Now I want to Add/Update this custom filed value through my PHP code. I fetch this custom field value in PHP code. problem is that, after adding custom field in QBOL, my PHP code for update invoice gives error

10000: [An application error has occurred while processing your request, System Failure Error: java.lang.NumberFormatException: For input string: "{-1}"]

although I don't change any thing in invoice and if I unset the Customfield

$Invoice->unsetCustomField();

then invoice update successfully. My php code to update custome field is

$CustomField = $Invoice->getCustomField('0');
$CustomField->setStringValue('Test value here');

Here first i get custom field object and then set StringValue.

I also try

$Invoice->setCustomField($CustomField);

but in both cases invoice update gives error as shown above.

I think, I am missing some thing that goes wrong. Please try to identify error and guide me.

Thanks

You're using outdated code.

If you grab the latest code from GitHub:

This will work just fine.