0

We use SOAP-API and Perl to transmit data from our web shop to Salesforce and Financial Force. To save invoices and related line items we use FF objects c2g__codaInvoice__c and c2g__codaInvoiceLineItem__c. I added new field Cost_Price__c to c2g__codaInvoiceLineItem__c. Field type is Number (9,2). In SOAP WSDL it is defined as xsd:double (like all other price fields). When I try to transmit a line item with a decimal value for Cost_Price__c following error occurs:

    {
        'success' => 'false',
        'errors' => {
            'fields' => 'Cost_Price__c',
            'statusCode' => 'INVALID_TYPE_ON_FIELD_IN_RECORD',
            'message' => 'Cost Price: value not of required type: 10.740658'
    }

The line item:

    {
        'FF_Flat_fee__c' => 'false',
        'c2g__Product__c' => '01t90000001TRETAA4',
        'Discount__c' => '0.00',
        'c2g__DeriveUnitPriceFromProduct__c' => 'false',
        'Cost_Price__c' => '10.74',
        'c2g__TaxCode1__c' => 'a1d90000000ulx6AAA',
        'c2g__Quantity__c' => 1,
        'c2g__UnitPrice__c' => '15.24',
        'c2g__Invoice__c' => 'a0zN0000001eUEIIA2',
        'FF_Price_Before_Discount__c' => '15.24',
        'CurrencyIsoCode' => 'USD',
        'c2g__SetTaxCode1ToDefault__c' => 'false',
        'c2g__CalculateTaxValue1FromRate__c' => 'true',
        'c2g__LineDescription__c' => '2 Official TNUs'
    }

Why I can't store value 10.74 to a field of type Number (9,2)?

7
  • Leaving the quotes didn't help either. Other values work with quotes too.
    – Obi_77
    Dec 5, 2016 at 15:17
  • Odd. Is there any reason why it's sending 10.740658 instead of just 10.74? I'm wondering if the four extra numbers are causing a problem.
    – Dan Jones
    Dec 5, 2016 at 15:27
  • Also, as you're using SOAP, is the Cost_Price__c field defined in the WSDL file?
    – Dan Jones
    Dec 5, 2016 at 15:34
  • yes, as xsd:double
    – Obi_77
    Dec 5, 2016 at 15:37
  • Sorry, I misread that part of your question!
    – Dan Jones
    Dec 5, 2016 at 15:45

1 Answer 1

0

"Why I can't store value 10.74 to a field of type Number (9,2)?"

Because the field type is Number (9,2) and you're sending 10.740658. That is Number(2,6)

Maybe a trigger is turning 10.74 to 10.740658

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .