Hi,
I am setting value in Inv. Discount Amount Excl. Tax (USD) of sales order from code.

But I am getting below error.
The primary key in the Sales Line table can contain only one field, and its type must be Integer
Here is my codeunit which I am using to update.
salesorderDiscountUpdate.Reset();
salesorderDiscountUpdate.setRange("No.", 'SP000004');
if salesorderDiscountUpdate.FindFirst() then begin
salesorderDiscountUpdate.Validate("Invoice Discount Amount", 2);
salesorderDiscountUpdate.Modify(true);
end;