ZipCode validation based on locale

Hello All.
I'm currently developing an application and i kind of ran
into some problems that i'm trying to find a possible solution.
This app will be used for many users spread out into Europe, Asia
and Americas and one requirement is to validate a given zipcode
based on the user's locale.
I've been trying to find examples on any possible web search
engine that you could possible think of and no results so far.
Please, if any examples/questions fell free to write me or
reply to this topic, your help is greatly appreciated.
Thanks
Alvaro Costa
Software Engineer
[email protected]

Here is a macro (sql function) we use for Canadian Postal
Codes. Bear in mind that the data we receive does not have the
normal space between the 3rd and 4th characters. The percentage
sign represents the argument.
returns Y or N to indicate whether postal code is valid CASE
WHEN
SUBSTR(%1,1,1)IN('A','B','C','E','G','H','J','K','L','M','N','P','R','S','T','V','X','Y')A ND
SUBSTR(%1,2,1)IN('0','1','2','3','4','5','6','7','
8','9')AND
SUBSTR(%1,3,1)IN('A','B','C','E','G','H','J','K','L','M','N','P','R','S','T','V','W','X', 'Y','Z')AND
SUBSTR(%1,4,1)IN('0','1','2','3
','4','5','6','7','8','9')AND
SUBSTR(%1,5,1)IN('A','B','C','E','G','H','J','K','L','M','N','P','R','S','T','V','W','X', 'Y','Z')AND
SUBSTR(%1,6,
1)IN('0','1','2','3','4','5','6','7','8','9')THEN 'Y' ELSE
'N' END

Similar Messages

  • Setting validation based on condition on custom list

    Hi,
    I have a custom Image library. I have two custom columns created as part of metadata.
    One is a dropdown choice column, which contains 2 values - "Free", "Paid".
    I also have a datepicker column (date only). 
    I would like to set a validation based on below condition:
    If dropdown selected is "Paid", then date should be mandatory field.
    Can this be achieved OOB or a JSLink is required.
    How to achieve this?
    Thanks 

    Hi Vankatzeus,
    You can achieve this using Javascript. In New and edit forms of your list, add a content editor webpart with the script explained below -
    There is a PreSaveAction() function that you can use to do a custom validation. Before submitting any item, sharepoint first do the validation in PreSaveAction().
    function PreSaveAction() {
      //Step 1 - Read the choice and date fields. 
    // Step 2 - If choice is 'PAID' and 'date' field is blank { alert('Date can't be blank'); return false;} else {return true;}
    In Step 1, write a script that read values from choice and date fields. You can take the script from
    here and modify it just to read choice and date fields.
    Cheers,
    Manvir

  • Change error message based on locale

    HI experts,
    I have 2 applicaions .
    one contains task flow containing 1 jsff having one input text required property set to true.
    other contains page template to switch language based on locale.
    now if I put both page template and input text in one application it works fine with error message in appropriate language.
    but if I import task flow into other application as adf jar file and insert TF as region then it gives error message always in english and ok button in appropriate locale.
    can you suggest some solution for this.
    JDEV - 11.4

    These links may use for you get solution
    Localization
    Localization
    Localization Supported Languages
    JDeveloper 11g - Localization Supported Languages
    How to configure code to ResouceBundle in Localization
    Re: How to configure code to ResouceBundle in Localization

  • Validation based on view attributes

    JDeveloper 11.1.1.x
    What is the best practice to create validations based on a view attribute from a view object that is of a level higher in the hierarchy?
    For example:
         * Use the departments and employees tables from the hr schema.
         * Create an EO for only the employees table, so not for the department table
         * Create VO's for both tables. You should create the Viewlink manually between both views.
         * In the query for the department, add a calculated field in the query.
         For example : availableSalary : 100000 - (select sum(salary) from employees where department_id = Departments.DEPARTMENT_ID) availableSalary
         * I would like to add a validation on the salary field of the employee EO, that says that the new value shouldn't be bigger then the availableSalary field
         Be aware : that when changing an existing salary, only the difference between the old and new salary should be taken into account
         (This removes the "Compare with View Object Attribute" possibility :-()
         * I also want to use some fields from the departments view in my error message on the salary field of the employees EO.
    How can we best tackle these requirements ?
    Thank you in advance.
    Filip Huysmans.

    Filip,
    I think you are trying to avoid the lesser cost of a Department Entity by an extremely expensive way to get to the comparison done. Firstly, you wire a view instance with an entity, which is strange as there is no association between the entity and the View Object. So all you would have is to access a method in the AM Impl method that looks up the VO and returns the current row's information you need. This AM method can be referenced from the entity object using groovy to perform the comparison (you see that even this is kind of awkward as it connects the entity to the AM, producing a tight coupling that makes any of your code reviewers shake heads in disbelieve). Assuming the update of the VO updates the entity (Departments EO you don't have), you could follow an association using Groovy to perform the validation (which I think sounds easier to do (though by the small cost of creating an EO)
    Btw.:
    if you have a ViewLink defined then the transient attribute can be easier calculated using Groovy
    10000 - DetailTargeName.sum('Salary');
    I would think its less expensive then running a SQL query for each department Id
    Frank

  • DateFormat based on Locale

    Hi,
    I have a strange requirement and not sure if it is possible.
    I need the date format based on Locale.
    Eg: If it is US I need the string "MM/dd/yyyy" as an output and I am not expecting "09/12/2007". I need the string MM/dd/yyyy as an output .
    Is there any method I can use?
    Thanks

    System.out.println("The SHORT format is **" + ((SimpleDateFormat)java.text.DateFormat.getDateInstance(java.text.DateFormat.SHORT, l)).toLocalizedPattern());
    System.out.println("The MEDIUM format is **" + ((SimpleDateFormat)java.text.DateFormat.getDateInstance(java.text.DateFormat.MEDIUM, l)).toLocalizedPattern());
    System.out.println("The FULL format is **" + ((SimpleDateFormat)java.text.DateFormat.getDateInstance(java.text.DateFormat.FULL, l)).toLocalizedPattern());Gives:
    The SHORT format is **M/d/yy
    The MEDIUM format is **MMM d, yyyy
    The FULL format is **EEEE, MMMM d, yyyy
    I guess you should use MEDIUM instead of SHORT

  • Validations based on Listing

    Hi Experts,
    We are developing a custom program to upload the Lower and Capacity values for the SKU's in a custom table for every store.
    While uploading the data, we want to put a validation based on the Listing, so that we can put a check while updating the table.
    The reason being, if a particular SKU is not listed for a Store, then we don't want that SKU be updated in the table ( for reduced table value maintenance).
    We are using Listing procedure B3 by default for all SKU's in the article master.
    But I am not sure, how to put a validation check here.
    Could you please help me in this scenario?
    Regards
    Nainar

    Hi Nainar,
    please have a look at function module WLK1_CHECK to integrate that in your custom program. But logic can a little bit difficult as listing conditions are time-dependent (e.g. no longer valid or valid in the future). So you have to decide how to react in which case.
    From your description, it is not clear how often you want to upload your data and how often listing changes occur, etc.
    Hope it helps.
    Regards
    Tobias

  • Validation based on conditions in another table

    Hi All,
    I'm trying to do a before update validation based on a condition. Basically, if the value of table1.columnA is changed to Yes only save when there are no rows in table2 columnX = Yes, otherwise online error.
    I have tried expressions, boolean, etc. and can't quite get the right combination.
    I am looking at something like select Y from dual where count of T2.CX = Yes is >1 otherwise N, and generate error only when Y is returned.
    Any help is appreciated.

    Thanks for the help. I did get it working, but in a way completely opposite than I was thinking it should work.
    FYI -
    The validation is expression 1 is contained in expression 2
    expression one is the p15_task_closed
    expression two is NO
    add a condition Exists (Sql returns a row)
    then do the select from the other table where it is true!
    I guess it says look at the conditions first, if the condition is true check the validation. If the validation is TRUE then no error, if the validation is FALSE (in this case the p15_task_closed = YES) enforce the validation error.

  • Field Validation based on SalesStage

    We have three Sales stages in the Picklist Opportunity Sales Stage, According to these Values one of below fields should be Mandatory. The values are as follows:
    If Sales Stage is
    1.     Closed/Won Then the Reason For Win(Text Field) Should be Mandatory
    2.     Closed/Loss Then the Reason For Loss(Text Field) Should be Mandatory
    3.     Closed/abandoned Then the Reason For abandoned(Text Field) Should be Mandatory.
    Could you please suggest me how to do this. Because we don’t have any field validations on Opportunity Salesstage(It’s a seede one), we can’t edit the things also. my thought’s are to place validation based on Sales stage id, i get the id from Source page and i am trying to validate on Reason for win field by using below query, but it is not working for me:
    IIf((FieldValue('<SalesStageId>')="AHIA-PS3GK" AND [<stReason_for_Win_ITAG>]IS NULL, "Invalid", [<stReason_for_Win_ITAG>])) and how to place combination of all the queries on SalesstageId field.
    Thanks
    Subbu

    Hi you can use another field for validation like Opportunity Name, but you have to mention that this approach only works if you insert a new record, not on update. To workaround this you can have another field that is mandatory and has the salesstages in it. Use a combination of default value and an update workflow for it...

  • How to Create a Validation based on a Z table

    I want to create a validation for t-code FB50 so that for any line item that contains a GL Account listed in a table, the validation would then check to see if the field Trading Partner is populated.
    My question is How do I set up the validation so that the values in the table are referenced?  I don't want to have to continually update the valid GL accounts in a set. I want the table to hold the values.  The business users have a custom t-code to update the values in the Z table.
    The Z table contains the field HKONT (GL Account).  The table contains 1 record (it could contain more) with GL Account 123456.
    My attempt was to create a set (Z_TP_ACCTS) that was based on the Z table and the corresponding field.  I then set up my validation to compare the value entered in FB50 (BSEG-HKONT) to look at the set.  My understanding is that the value would be compared to the values in the table, but my tests are failing.  I did not enter any values in the set.
    Any advice / help would be appreciated.

    Hi
    You will have to use an user exit to call up the Z Table to check for your requirement. There are lot of postings on SDN to use an user exit in FI Validations. The standard module pool provided by SAP is RGGBR000 for FI Validations. You can write a form in this.
    Additionally you also have the option of using a BTE for this. The one I can recollect are 00001011 or 00001085
    Thanks & Regards
    Sanil Bhandari

  • How to load html file based on locale?

    Based on the browser langugae settings / regional settings (locale), we need to display the one of the html pages.
    html content is specific to country and plain text only not using unicode.
    Is there is a way to load using java. It is working for .propeties file.
    Thanks

    If using jsp/jsf place the text in properties files (according to language again) and then display the text using the bundle.

  • FlexField Validation based on Form Status

    Hi ,
    Background :
    I have a Valueset attahced to a segment in DFF, that say, stores a employee ID. My Value set picks up only active employees based on a specific condition. So that, when user enters data, he/she can choose only active ones.
    But as days pass by, the users are end dated. So when I query the Order ( to which this DFF is attached, ) that has an end-dated employee attached to it, the validation fails.
    My Question :
    Is there a way to have the Value set fire only in the Entry Mode and not fre in Query mode?
    Do we have to do this using the FORM.STATUS ( 'NEW','CHANGED') in the valueset query to acheive this? Or is there a simpler way?
    Thanks
    konnektme

    Hi Karthik,
    Instead of making the value set not to validate, you can make the value set to validate as successful. This can be achieved in any of the following ways.
    1) Make the Employee value set to display both Active/Inactive employees. If required the Status column can be displayed in the LOV. Also the list can be ordered by active employees first, then followed by inactive employees. There by user have the option to select the exployees be referring the employee status. This provides a provision to create records based on inactive employees also. If we strictly want to restirct to select only active employees. As said earlier, we can validate in Key-Commit or When validate Record.
    2) Change the value set to return active values always and inactive values only based on condition. Say the condition is (:system.record_status <> 'QUERY' and active_flag = 'y'). In this case only active records will be retreived in the record status is not query, where as if the record status is query, inactive records will also be retreived.
    If you have any solid condition to restrict the records, you can use those instead of record status/form status.
    I would prefer to use Option 1. Which will provide a solid result all the time. Where as option 2 might cause some issues if it is based on record/form status.
    Thanks
    K.Nataraja Suthan,

  • Help setting validation based on route selected

    If the LC form only has one submit button, how do you set a validation on submit based on the route selected when running forms in workspace?
    For example, if users have the option to Approve or Reject a form, can you determine which route they have selected and validate fields accordingly? So that if "reject" is selected we can validate that the reject comment field was completed, and if "approve" is selected we can validate that the form was signed?  Is there some property of the submit button or process field that makes this distiction?
    Thanks for your help!

    You can use a JavaScript if-else statement on the preSubmit event of the button. Do a check to see which of the fields are populated, then perform the required action.
    You could even hide the buttons, then if the user fills in a comment in the reject field, you simply show the reject button and keep the approve button hidden. You could have a pop-up when the form opens informing the user of the document's steps / process.

  • Validation based on items on an page !

    Hi there
    Any pointers greatly appreciated...
    Trying to do :
    If I click on button 1, I wish to check if 4 select lists have a value (!='%'), if they do, complete process. Otherwise, stop, and get user to select something.
    Same for button 2, but different select lists.
    Problem:
    If I click on button 1 or 2, it checks ALL select lists if they are populated i.e. !='%'
    Details
    Following objects :
    Buttons (2)
    --each button has button request value
    Button1 'archive', Button2 'current'
    Select Lists (1...4)
    Select Lists (5..8)
    Each select list - has default value &gt; '%'
    Processes (2) - PL/SQL anonymous block Conditional (after submit)
    --Each process has simple condition, based on button (When Button Pressed (Process After Submit When this Button is Pressed))
    Validation
    --Each select list has type - PL/SQL expression
    :PX_SelectListX !='%' and :PX_ButtonX ='archive' (or 'current')
    Associated Item - validation not associated with item
    Condition - Based on ButtonX
    Condition Type - (tried different combinations) - current - Value of item in expression 1 is not Null, Expression 1 --&gt; PX_SelectListX

    That is wrong. This is why it doesn't work.
    1. Request will never be :P4_Button1 - Request is 'Go'
    2. The value of your select list is not '%'. That is a display value. Look into the select list to see what it has as a null return value. If it is empty than it will be '%null%'
    (You should use something easier to handle as a null return value. Put there 0 or something else) and include that into your validation. It will work for sure.
    I would recommend using two day developer guide to start with the basics.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Date format based on locale

    Hi Gurus,
    I am currently making changes to some of our existing forms so that the dates and quantities will format properly based on the locale. I am passing in the local to the form and using this to set the format. Everything works fine except for the US dates, which is getting formatted as Jan 21, 2015 instead of 01/21/2015. Because of space constraints I need to use the "shortened" version. I currently have the field set as type Date/Time and nothing listed under Patterns. I tried using date.short{} in the pattern field, but ended up with 01/21/15. Date.medium{} and date.default{} gave me the Jan 21, 2015. Does anyone know if there is a way to get the full 4 digit year?
    Thanks!
    Julie

    Hello Julie
    You can create the following pattern
    date(en_US) {MM/DD/YYYY}
    A default date value must conform to the short format for the locale specified for the date field. However, by default, Designer displays the default value in the medium locale format at both design time and run time.
    For example, consider a form with a Date/Time Field set to use the German (Germany) locale. You enter the default value for a date in the short format DD.MM.YY. After you change the focus to another field, the value specified in the field on the page is displayed in the medium format DD.MM.YYYY. The formatted value also appears in the medium format if you view the form in the Preview PDF tab.
    Note: At run time, by default, form fillers must edit the value of date/time fields using the short format for the locale specified for the field. If you specify an Edit Pattern on the Edit tab in the Patterns dialog box (Field tab > Patterns), that pattern overrides the short format, and users must enter data that conforms to the Edit Pattern.
    Adobe&amp;#160;LiveCycle&amp;#160;ES3 * Formatting field values and using patterns
    regards
    sandy

  • Range based Flex field validation based on a Lookup table

    Hi all,
    I am trying to create a validation in one of the flex field under HRMS Application. Table: PAY_ELEMENT_ENTRIES_F
    Validation is pretty simple - but i am struggling to implement.
    Assume there exists two flex fields;
    Field1 contains State Information
    Field2 contains Percentage Information
    The above two values would be entered by the user.
    the validation should be like this.
    Field1 - State code entered by User
    Field2 - We have a seperate Lookup where we have setup lots of State specific information. Assume ATTRIBUTE3 and ATTRIBUTE4 defines the Min and Max range which would be configured during the Setup. User should be entering any percentage value between the ATTRIBUTE3 and ATTRIBUTE4.
    I have created a Table Validaiton with select 1 from dual with the following where clause.
    exists ( select null from fnd_common_lookups l, fnd_sessions sess
    where
    l.lookup_type like 'CUSTOM_US_STATE_RULES'
    and sess.session_id= userenv('sessionid')
    and sess.effective_date between l.start_date_active
    and NVL(l.end_date_active, sess.effective_date)
    *and l.attribute1 ='01' -- consider 01 state alone for the time being*
    and :$FLEX$.ENTRY_INFORMATION4 between to_number(l.attribute4) and to_number(l.attribute5)
    When i compile the flexfileld, it errors out stating invalid reference to ENTRY_INFORMATION4.
    ENTRY_INFORMATION4 is the field where i am going to attach this validation
    How do i validate a value of the flexfield against the range of values available in another table(in this case a lookup table) ?
    Any ideas on how to implement this.
    Edited by: vaibhav468 on Sep 29, 2008 3:05 PM

    Thanks so much for the reply. apparently the solution which you have suggested may not work 100% as the data entry also happens via API. Its mentioned in the doc that the special validations happen only via Forms.
    But I implemented it in a crude way. But it works though !!!!
    Based on the value which i enter in the first Field1, the value set which i am using it in second Field2(its a table based value set)
    I generated all possible percentages and displaying it.
    My table is: (select trim(to_char(rownum/100,'990D99')) pct from fnd_columns a where rownum<=10000) a, fnd_common_lookups l
    My Where clause:
    where l.lookup_type='CUSTOM_US_STATE_RULES'
    and l.attribute1=substr(:ENTRY.USER_ENTRY4,1,2)
    and a.pct between l.attribute4 and l.attribute5
    I generated the set of sequence numbers with the help of rownum from a table which definitely contains more than 10000 rows.
    I was so glad that FND allowed me to use a INLINE view in the Validation Table not restricting the tables available for that application alone.
    thanks again.

Maybe you are looking for

  • Can't find program after downloading

    I just installed Firefox browser a few days ago. Downloaded one music file today - worked fine, went right to my Windows Media player. All I did was click 'download" next to the song. A window popped up in the top corner of my browser showing the set

  • HTTPS over a Proxy!! Set up of username/password

    I am transferring over https to a receving servlet over a Proxy. How do I specify the username and password for the Proxy in my application ,if the proxy server supports this. I have configured my application to send it over a Proxy with: https.proxy

  • Installing CS6 Master Collection (Student Edition)

    Do I have to uninstall the Trial version of CS6 Master Collection before I install the actual software?

  • Default  login password on Storedge 2540 doesn't reply

    Dear my colleagues; I have a new ST 2540 Storedge but I couldn't log in with its default password writing on its documents (kra16wen). Is there another password or should I reset it and how? Can anyone help me about the issue? Thanks.

  • Iwork 9 Trial and converting to Full Version

    Hi, I recently downloaded and installed the iWork 9 Trial, I have then gone out and purchased the CD version of iWork, I then install the CD version to convert the trial to FV, when I am trying to run the program all the comes up is the box to either