• Terri
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

Hi 
I am using the SOAP API to upsert accounts. The BillingStreet textarea field is giving me problems.
There is a validation rule on the BillingStreet field in SFDC. The validation rule ensures that only 4 address lines are in the field and each line is 40 characters or less. Here is the validation formula:
NOT
(
OR
(
REGEX(BillingStreet, "(.){0,40}"),
REGEX(BillingStreet, "(.){0,40}\r\n(.){0,40}"),
REGEX(BillingStreet, "(.){0,40}\r\n(.){0,40}\r\n(.){0,40}"),
REGEX(BillingStreet, "(.){0,40}\r\n(.){0,40}\r\n(.){0,40}\r\n(.){0,40}")
)
)

The validation works fine when maintaining data in SFDC. It allows up to 4 lines in the field each at 40 characters or less.

I am upserting account data using the SFDC SOAP API and setting the BillingStreet field as follows:
Account.BillingStreet = "123 Main St." (upserts without error with validation rule active)

However, this is what is giving me grief:

Account.BillingStreet = "123 Main St.\r\nPO Box 123"

If I make the validation rule for BillingStreet inactive and upsert the account data, there are no issues. The BillingStreet shows 2 lines in the textarea field as it should.
When the validation rule is active, the upsert fails with the Validation rule error message.

Can anyone tell me how I need to format the BillingStreet value so that it passes the validation rule?

  • October 21, 2010
  • Like
  • 0