Skip to main content
I am seeing some inconsistency when validation rules are being done on standard Account address fields.. 

 

For e.g. 

 

I have a validation rule on the Account object's Shipping Street:

 

OR

 

(

 

REGEX(ShippingStreet, "(.){0,20}"),

 

REGEX(ShippingStreet, "(.){0,20}\r\n(.){0,20}")

 

)  

 

So, basically, I want the Shipping Street to be entered in either one or two lines and that each line must contain a MAX of 20 characters.  When the user enters the third line, it will fail. 

 

Now, this works well, when I do an EDIT by clicking on the main record's EDIT button and saving.

 

But, when I 'inline' edit the record (double click the "Shipping Address" field), the validation rule fails, because for some reason, the Shipping Address field now has the City, State and Zip as the 'third' line!

 

Anyone come across this problem?  TIA
4 Antworten
  1. 22. Juni 2013, 18:22
    I was able to get your validation rule to work as you described the requirement by changing it to this:

     

    NOT(

     

    OR

     

    (

     

    REGEX(ShippingStreet, "(.){0,20}"),

     

    REGEX(ShippingStreet, "(.){0,20}\r\n(.){0,20}")

     

     

    )

     

    There is something going on thought with inline editting vs regular editting.  It is not related to City, State, Zip however because I tested without anything in those fields.  I believe it is how the two forms of editting is checking for new lines.  I don't know what the regedit codes \r\n do and what other options are available, but that is where I suggest you look to get this working in both modes.
0/9000