function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AmarAmar 

Can i track truncation warnings.

I am a Java developer and using sforce API version 4.0.

While inserting data in salesforce Objects, salesforce automatically truncate the data if its more than the field length. Is there anyway to track the name and number of fields for which values has been truncated.


Thanks,
Amar
EatEat
I don't know how to track truncations, but you can use:
DescribeSObjectResult.getFields()[i].getLength()
to return the length of the field and check it yourself.

That could work, but someone else could have a better idea.
AmarAmar
Thanks Eat,

I don�t want to check the length of every field before inserting them. Salesforce automatically manages extra length values and truncate them. So I don't need to worry about that, I just wanted to check if after truncation sforce API provide any call/object that can track about the truncation warnings.


Can I have more views?

Thanks,

Message Edited by Amar on 01-05-2005 12:16 PM

DevAngelDevAngel

Hi Amar,

The answer to your original question is no.  The update or create returns either a success = true or success = false.  In the case of success = false an error collection (generally a one element collection) is also returned.  In the case of true, no status or warnings are returned.  We return no "warnings" based on system caused changes to the data (such as truncation).

If this is important to you make a feature request case with customer support.