Autopopulate field of DOB

Hello

I have a requirement I need to automatically fill in the field when the field DOB is entered in the page of the OFA. Do I need to write code in the controller or AMImpl...?

Thank you

Haja has

Replace the getAge method in your VORowImpl with this:

public Number getAge(){
  //return (Number) getAttributeInternal(AGE);
  Date doB = getDOB();  

  if(doB != null)
  {
  Calendar dob = Calendar.getInstance();
  dob.setTimeInMillis(doB.getValue().getTime());  

  Calendar sysDate = Calendar.getInstance();  

  int age = sysDate.get(Calendar.YEAR) - dob.get(Calendar.YEAR);
  if ((dob.get(Calendar.MONTH) > sysDate.get(Calendar.MONTH))
  ||
  (dob.get(Calendar.MONTH) == sysDate.get(Calendar.MONTH) &&
     dob.get(Calendar.DAY_OF_MONTH) > sysDate.get(Calendar.DAY_OF_MONTH))) {
  age--;
  }
  return new Number(age);
  }
  else {
  return (Number) getAttributeInternal(AGE);
  }
}

Replace getDOB() by the get method correct for the DOB.

See you soon

AJ

Tags: Oracle Applications

Similar Questions

  • How to make a checkbox address autopopulate fields in Acrobat Pro?

    I have created a form where the user would fill in their contact information. (address, phone, e-mail, etc.).

    Then, they will have to fill in their shipping address too.  I would like to have a checkbox so when activated, it would be autopopulate the forwarding address in the fields with the coordinated field entries (copy).

    It seems that I have to add javascript somehow, but nothing I found on the forum has helped so far.

    You will need to write custom JavaScript to perform the task, and you will need to know the exact form field names.

    For the box, you'll need to encode a mouse action run JavaScript and you need to add the JavaScript code. The code must check the value of the check box and fill in the fields or clear fields. Without more details, it is hard to tell you how to program your specific form. If the design of the form, I would have used the names of field Manager for the invoice and shipping fields. So we can have "invoice.company", "invoice.contact", 'invoice.address', 'invoice.city', 'invoice.province', 'invoice.postal', 'invoice.phone', 'invoice.fax' and 'invoice.email'. The fields of the expedition would have a highest level of "shipping" name and the same children field names.

    A possible script could then be:

    var oInvoice = this.getField ("invoice"); get the top-level field;
    var aInvoice = oInvoice.getArray (); make table of child fields;
    order var = this.getField ("shipping");
    var aShipping = oShipping.getArray ();
    Console.println (this.getField (Event.Target.Name) .value);
    If (this.getField (event.target.name) .value == 'Yes') {}
    for {(i in aInvoice)
    Copy children Bill in the fields of shipping;
    aShipping [i] .value = aInvoice [i] .valueAsString;
    }
    oShipping.readonly = true; do shipping readonly;
    } else {}
    oShipping.readonly = false; clear readonly
    this.resetForm ([oShipping.name]) / / reset table shipping fields;
    }

  • Does Autopopulate fields Acrobat other than calculations

    I know that Acrobat 10.0 can perform calculations, but that form can be designed so that when a text field has a selection, another text field will fill based on the information contained in the first field?

    To set the value of a field in the mouse event to the top of a box, do something like this:

    Set the value of a text field to the value of exports of this check box if selected

    var val = event.target.value;

    var f = getField ("Text1");

    If (val! == 'Off') {}

    f.Value = val;

    } else {}

    f.Value = "";

    }

    This code will work with a group of radio buttons, checkbox, drop-down list box (dropdown) and listbox if the value of exports of the box is the value of the key/export in the other field, but the last line should be replaced by:

    f.Value = "Off";

    for check boxes and option buttons and default value for combo boxes and list boxes.

  • Filling of a field of a field of DOB

    I have people to fill in a Date of birth field (which is not formatted), I want to fill in the next field, which is the age. Is this possible?

    If you check the JavaScriptproperties console, you will see the following message is displayed:

    this.getField ("MyDate.string") has no properties
    4:field: calculate

    Use "MyDate.String" as well as the code uses "MyDate.string". Capitalization in JavaScript is very important.

  • Autopopulate fields need

    Hello

    I put a link on the page of the task, which allows you to create a CR.

    There is an account, contact,... on the task and, after using the link, I would like on behalf of fields and contact on the SR I create, will be filled with the same values as in the task.

    If, on my work, the account is a contact 'A' and 'B', when I create an SR through the weblink, fields of the SR 'Account', 'contact' is equal to 'A' and 'B '.

    Could you help me?
    THX
    Jon

    Jon,

    I have a paper on this topic. Send me an email (see profile) and I'll send it to you.

    Good luck
    Thom

  • SUBSTR (to_char (Field))

    You will need to find the age of the employee when joined the company. An employee may come and go a couple of times, for the last time that we just need to age the last time they join.

    Year joined is a numeric field.
    DOB is a field DATE DD/MM/YYYY

    Since I just need to know the year, or the last 4, I thought that I can use this calculation, but it does not work.

    MAX (applied." "" 'Year')-substr (TO_CHAR (Emp.Dob),-4).
    COURSES (PARTITION BY EMP. Emp_id)


    Got a ' inconsistent or invalid data types used in the arithmetic operation.

    Any ideas?

    Thank you

    Andy

    Hello

    Try using:

    MAX (applied." Year') OVER (PARTITION BY EMP. Emp_id) - substr (TO_CHAR (Emp.Dob),-4)
    or

    (TO_DATE ('01 - JAN-' |)) To_char (MAX (applied." Year') OVER (PARTITION BY EMP. (Emp_id), 'fm9999') - Emp.Dob) / 356

    Rod West

  • Script to include a background color change depends on the answer

    I previously got help from a user here to create a script that autopopulates field based on the options selected in two sets of radio buttons:

    var result = this.getField("Consequence").valueAsString;

    probability of var = this.getField("Likelihood").valueAsString;

    If (result == 'Negligible' & & probability == 'Rare') event.value = "Low";

    Else if (result == 'Negligible' & & probability == 'Unlikely') event.value = "Low";

    ElseIf (result == 'Negligible' & & probability == 'Moderate') event.value = "Low";

    Else if (result == 'Negligible' & & probability == 'Probably') event.value = "Low";

    ElseIf (result == 'Negligible' & & probability == "almost certain") event.value = "moderate."

    Else if (result == 'Minor' & & probability == 'Rare') event.value = "Low";

    Else if (result == 'Minor' & & probability == 'Unlikely') event.value = "Low";

    ElseIf (result == 'Minor' & & probability == 'Moderate') event.value = "moderate."

    ElseIf (result == 'Minor' & & probability == 'Probably') event.value = "moderate."

    Else if (result == 'Minor' & & probability == "almost certain") event.value = "high";

    Else if (result == 'Moderate' & & probability == 'Rare') event.value = "Low";

    ElseIf (result == 'Moderate' & & probability == 'Unlikely') event.value = "moderate."

    ElseIf (result == 'Moderate' & & probability == 'Moderate') event.value = "high";

    ElseIf (result == 'Moderate' & & probability == 'Probably') event.value = "high";

    Else if (result == 'Moderate' & & probability == "almost certain") event.value = "critical";

    Else if (result == "Major" & & probability == 'Rare') event.value = "Low";

    ElseIf (result == "Major" & & probability == 'Unlikely') event.value = "moderate."

    ElseIf (result == "Major" & & probability == 'Moderate') event.value = "high";

    Else if (result == "Major" & & probability == 'Probably') event.value = "critical";

    ElseIf (result == "Major" & & probability == "almost certain") event.value = "Extreme";

    ElseIf (result == "Catastrophic" & & probability == 'Rare') event.value = "moderate."

    Else if (result == "Catastrophic" & & probability == 'Unlikely') event.value = "high";

    Else if (result == "Catastrophic" & & probability == "Moderate") event.value = "critical";

    ElseIf (result == "Catastrophic" & & probability == 'Probably') event.value = "Extreme";

    ElseIf (result == "Catastrophic" & & probability == "almost certain") event.value = "Extreme";

    etc.

    else event.value = "";

    I wonder if its possible to have the color of the field that uses the script above, change based on the input. For example if the response is weak; make the background color green. If its moderate, make orange etc. ?

    I know it of asking a big but thought I would check.

    Thanks in advance.

    Of course, it is possible. Add at the end of your code:

    if (event.value=="Low") event.target.fillColor = color.green;
    else if (event.value=="Moderate") event.target.fillColor = ["RGB", 1, 0.5, 0]; // = Orange
    else if (event.value=="High") event.target.fillColor = color.red;
    // etc.
    else event.target.fillColor = color.white;
    
  • Datepicker apex 4.0 - maximum value bug

    Hi all

    I have a number of dates in my page of simple form, and I applied a maximum date on a field of DOB to be '-16y "(without the quotes)

    The features of this element works as expected, and validation does not apply for other dates.

    However the jquery datepicker applies the restrictive selection on other date fields that do not have a maximum value.

    Has it been met before (I searched the forum but found too many references to filter / walk in)

    See you soon,.

    ScottWe

    A bug was recorded, and this problem will be fixed in the next version of the product. Thank you for reporting this issue.

    Thank you
    JS

  • Convert a Date Format data in a different Format of Date

    I'm trying to convert a date field (Text1-29), which is in the format "yyyy/mm/dd", and move it to the data in another field (text-DOB), which is in the format "mmmm dd, yyyy'."

    I tried various methods, such as the following, but without success. Any suggestions?

    getField("Text-DOB").value = util.scand ("mmmm dd, yyyy", (getField("Text1-29").value);)

    To reformat a date string, first convert the string into a JavaScript date object and and then format this date object as needed.

    Console.Show (); Console.clear();
    Disable the default result field
    Event.value = ";
    get the string from the date of entry
    var sText1_29 = this.getField('Text1-29').value;
    process if there is data
    If (sText1_29.toString ()! = ") {}
    Console.println ("sText1_29:" + sText1_29);
    convert JavaScript Date object
    var oText1_29 = util.scand ("yyyy/mm/dd ', sText1_29");
    Console.println ("oText1_29:" + oText1_29);
    convert the object date JS to the new format
    var sDOB = util.printd ("mmmm dd, yyyy', oText1_29");
    Console.println ("sDOB:" + sDOB);
    Event.Value = sDOB;
    }

  • How can I make a box autopopulate a text field

    I have 2 text fields named MailingAddress and GarageAddress.

    I would like to have a check box next to my MailingAddress the field when checked would be autopopulate my GarageAddress with the value of MailingAddress.

    I scrounged around forums and cobbled this together (with my very limited knowledge of JavaScript)... but get a syntax error.  I'm sure it's something obvious... If you understand JavaScript!

    Any help would be greatly appreciated

    var aMailing = this.getField ("MailingAddress");
    var aGarage = this.getField ("GarageAddress");

    If (this.getField (event.target.name) .value is 'Yes')
    {
    copy the mailing address to the address of Garage;
    aMailing.value = aGarage.value;
    }
    aGarage.readonly = true; do GarageAddress readonly;
    }

    on the other

    {
    aGarage.readonly = false; clear readonly
    this.resetForm ([aGarage.name]) / / reset GarageAddress
    }

    You have syntax errors in your code. Also, it seems that the logic of your code is reversed. You copy the value of GarageAddress to MailingAddress, instead of what you have described. I suggest using this code (as the MouseUp event of the checkbox) instead:

    var aMailing = this.getField("MailingAddress");
    var aGarage = this.getField("GarageAddress");
    
    if (event.target.value == "Yes") {
        // copy Mailing address to Garage address;
        aGarage.value = aMailing.valueAsString;
        aGarage.readonly = true; // make GarageAddress readonly;
    } else {
        aGarage.readonly = false; // clear readonly
        this.resetForm([aGarage.name]) // reset GarageAddress
    }
    
  • Autopopulate need a field based on the selection of a field of LOV

    Hi all

    I have a requirement as below.

    I have a LOV field in my custom the OPS page by selecting a value from the lov, I need autopopulate another field of text in my custom page of OFA, please help me on how to do this.

    Thank you

    Hello

    If you get this value in processRequest means, you can use the following code.

    {

    Integer a;

    a = ResultSet.GetInt ("CCU_ID");

    System.out.println ("partid is:" + a);

    OAMessageTextInputBean oaApp = (OAMessageTextInputBean) webBean.findIndexedChildRecursive ("text");

    oaApp.setValue (pageContext,a);

    }

    Assume that if you get this value firePartialAction or processFormRequest means this field of messageTextInput must be associated with some VO, so that you can view the value of vo when running.

    Thank you and best regards,

    Myvizhi

  • Using a check box for autopopulate other fields (= ship Bill to)

    I checked the other threads and don't know what I have to do.

    I have NO experience of script and am using LC Designer ES 8.2.

    The form I designed will be finally sent to customers for them to fill out using Adobe Reader.

    I have two sections - a "Bill" and a "ship to" and they are areas of free text to one drop down to "country".

    What I want to do is to put a check box on the form that says "Bill is identical to ship to.

    If the user clicks on the box, the data should autopopulate the other fields.  If they "UN-click on ' the box, the data goes.

    Script is WAY above my head and scares me but I peut follow directions.

    Can someone help me?

    Chuck,

    First off apologize not to ask a question... no question is stupid.

    Secondly, the script of your checkbox is on the bad event.  Looking at your screenshot, you placed on the 'click' event... should be placed on the 'change' event See screen capture below.

    Then, the script should be (for example):

    If (this.rawValue == 1) {}

    Company2.RawValue = Company1.rawValue;

    }

    If (this.rawValue == 0) {}

    Company2.RawValue = "";

    }

    Finally, it's just a suggestion...  Since you make the box (same as ship to... which means that the Bill for info would be the same as the ship for info) I make the column 'Bill To' the second column and make the ShipTo the first column so users enter the Ship To news first. In my example, company 1 represents the ShipTo, a Company 2 BillTo nd. When the user checks the box (checkbox value == 1), the news of billto are filled by the ship to info data entered and when unchecked (checkbox value == 0), the billto fields are empty... so (Company2.rawValue = "" ;))

  • Autopopulate duplicate fields

    Hello

    I am building a form with multiple pages. A field "number of cases" will be repeated on each page. Is there a script I can add in the fields of 'number of cases' 2nd and the following, which would be autopopulate with the entry number in the field "number of cases" 1 so that the user should only enter only once?

    Thank you

    Caroline

    Change the Global binding to this field... That will help you...

    Thank you

    Srini

  • Autopopulate text field based on LOV in OFA

    Hello

    I have two fields as project no and the name of the project. Project, no field is LOV so much based on the selected value of LOV the project name field shd automatically filled with the name of the project. Please help me make this scenario.

    Thank you

    Haja has

    Add an extra lovMap to the LOV and card ProjectName.

    You must have the name of the project in the LOV region as well.

    Let us know if you have any questions.

    The link below helps you to understand the LOV events.

    Advice from the Oracle Johny: OAF: how event Capture LOV in Oracle Application Framework

    See you soon

    AJ

  • Enter the info intoText field causes another field to autopopulate

    I have this form:

    Clipboard01.jpg

    I would like the form to fill the "Subtotal" and text fields 'Total' with the amount appropriate when a box is checked against a selection.

    I would also like to produce it even when a customer initiates a number of evidence in the text boxes in the 'Art Extra' section at the bottom. For example, the customer selects the "Vintage Collection" box and $399 is automatically entered in the "Subtotal" and "Total" (read only) areas. The client then decides that in addition to the impressions that come with "Vintage" Collection, they would like to add an 8 x 10 of one of the favorite from the shoot. They do so by entering a number of evidence in the text box next to "8 x 10 • $20" under the section "Extra." When they enter this number (or any text at all in one of the areas of text next to "• $20 8 x 10"), I would like the fields subtotal and Total to add $20 to the $ 399 already there.

    I contacted Adobe Support and they told me that it should be possible and ask here for help.

    I'd appreciate any help.

    Yes, it is possible, but it will write a script about measure that calculates the total (and the subtotal) based on values entered into the fields.

Maybe you are looking for