Need help with calculated fields in Adobe Interactive Forms

Hi Gurus,
I have an Adobe Interactive form in which i have radio buttons. Upon selecting any of the radio buttons, value in text box should be changed( Calculqated filedS). How i can achieve this?
Regards,
Srini
Moderator message: wrong forum, please post again in Adobe Interactive Forms, but always try yourself before asking.
Edited by: Thomas Zloch on Jul 13, 2010 11:58 AM

Hi Tapan
No, it's working ,with  one remark.
I've done a mistake, in the final formula. The logic remain the same! ;)
 The calculation values for second column ( COL2 ) are 1,2,3 and not 0,1,2 as I wrote  before and as for COL1 are so the formula is
=3*if(COL1="ABC",0,IF(COL1="DEF",1,2)+if(COL2="RST",1,IF(COL2="YYZ",2,3)
and not
=3*if(COL1="ABC",0,IF(COL1="DEF",1,2)+if(COL2="RST",0,IF(COL2="YYZ",1,2)
I created also a real example  for you, with 2 dif calculation ways . First I created 2 calc_columns for COL1 and COL2 ( CALC_COL1+CALC_COL and after I added both these 2 column , and second way is to calculate directly) .
Check this image
Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

Similar Messages

  • Need help with required fields for my online form

    Hi, I've been mucking around with my online form for a while
    and I just can't see what the problem is in the code.
    I am trying to make all but two of the form items to be
    required upon form validation. However, it doesn't work, nothing is
    required now.
    I'm using these two ways of doing it (natemail.php is my form
    handler).
    <form action="../NateMail.php" method="post"
    enctype="application/x-www-form-urlencoded" id="Man Meets Woman
    Long Form Opt-in"
    onsubmit="MM_validateFormMM_validateForm("date","first_name","last_name","alias","address ","city","prov_state","postal","country","phone","email","birthdate","Sex","marital_status ","other_forums","methods_known","want_learn","coaching","invite_friends","about_myself"," terms_conditions");return
    document.MM_returnValue">
    ...is one way and the other is:
    <input name="require" type="hidden" id="require"
    value="date,first_name,last_name,alias,address,city,prov_state,postal,country,phone,email ,birthdate,Sex,marital_status,other_forums,methods_known,want_learn,coaching,invite_friend s,about_myself,terms_conditions"
    />
    The page is
    http://www.vancouversocialboard.com/register.html
    Can anyone tell me my error and tell me the proper way to do
    this?
    Thank you!

    > (never did figure out what the 'MM_validateForm code was
    supposed to be)
    It's a call to a Dreamweaver javascript function that
    validates your form.
    The function definition should be in the head of the page.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "audio90" <[email protected]> wrote in
    message
    news:ghsljj$4ll$[email protected]..
    >
    quote:
    Originally posted by:
    Newsgroup User
    > On first glance, the problem seems to be that both the
    onsubmit event
    > and the JavaScript function inside are encapsulated with
    double quotes.
    > Try wrapping the onsubmit attribute/event in single
    quotes instead, like:
    >
    >
    >
    onsubmit='MM_validateFormMM_validateForm("date","first_name","last_name","alias"
    >
    ,"address","city","prov_state","postal","country","phone","email","birthdate","S
    >
    ex","marital_status","other_forums","methods_known","want_learn","coaching","inv
    > ite_friends","about_myself","terms_conditions");return
    > document.MM_returnValue'
    >
    >
    > [snip]
    >
    >
    >
    > No, it didn't work. But I solved it to be acceptable. I
    removed the
    > 'MM_validateForm and used the Natemail action. My
    mistake there was that I
    > put
    > "require" rather than "required". It comes up with a
    different screen when
    > form
    > items are missing, rather than a pop up video, but good
    enough.
    >
    > thanks
    >
    > (never did figure out what the 'MM_validateForm code was
    supposed to be)
    >
    >
    >

  • Need help with calculator project for an assignment...

    Hi all, I please need help with my calculator project that I have to do for an assignment.
    Here is the project's specifications that I need to do"
    """Create a console calculator applicaion that:
    * Takes one command line argument: your name and surname. When the
    program starts, display the date and time with a welcome message for the
    user.
    * Display all the available options to the user. Your calculator must include
    the arithmetic operations as well as at least five scientific operations of the
    Math class.
    -Your program must also have the ability to round a number and
    truncate it.
    -When you multiply by 2, you should not use the '*' operator to perform the
    operation.
    -Your program must also be able to reverse the sign of a number.
    * Include sufficient error checking in your program to ensure that the user
    only enters valid input. Make use of the String; Character, and other
    wrapper classes to help you.
    * Your program must be able to do conversions between decimal, octal and
    hex numbers.
    * Make use of a menu. You should give the user the option to end the
    program when entering a certain option.
    * When the program exits, display a message for the user, stating the
    current time, and calculate and display how long the user used your
    program.
    * Make use of helper classes where possible.
    * Use the SDK to run your program."""
    When the program starts, it asks the user for his/her name and surname. I got the program to ask the user again and again for his/her name and surname
    when he/she doesn't insert anything or just press 'enter', but if the user enters a number for the name and surname part, the program continues.
    Now my question is this: How can I restrict the user to only enter 'letters' (and spaces of course) but allow NO numbers for his/her surname??
    Here is the programs code that I've written so far:
    {code}
    import java.io.*;
    import java.util.*;
    import java.text.*;
    public class Project {
         private static String nameSurname = "";     
         private static String num1 = null;
         private static String num2 = null;
         private static String choice1 = null;
         private static double answer = 0;
         private static String more;
         public double Add() {
              answer = (Double.parseDouble(num1) + Double.parseDouble(num2));
              return answer;
         public double Subtract() {
              answer = (Double.parseDouble(num1) - Double.parseDouble(num2));
              return answer;
         public double Multiply() {
              answer = (Double.parseDouble(num1) * Double.parseDouble(num2));
              return answer;
         public double Divide() {
              answer = (Double.parseDouble(num1) / Double.parseDouble(num2));
              return answer;
         public double Modulus() {
              answer = (Double.parseDouble(num1) % Double.parseDouble(num2));
              return answer;
         public double maximumValue() {
              answer = (Math.max(Double.parseDouble(num1), Double.parseDouble(num2)));
              return answer;
         public double minimumValue() {
              answer = (Math.min(Double.parseDouble(num1), Double.parseDouble(num2)));
              return answer;
         public double absoluteNumber1() {
              answer = (Math.abs(Double.parseDouble(num1)));
              return answer;
         public double absoluteNumber2() {
              answer = (Math.abs(Double.parseDouble(num2)));
              return answer;
         public double Squareroot1() {
              answer = (Math.sqrt(Double.parseDouble(num1)));
              return answer;
         public double Squareroot2() {
              answer = (Math.sqrt(Double.parseDouble(num2)));
              return answer;
         public static String octalEquivalent1() {
              int iNum1 = Integer.parseInt(num1);
    String octal1 = Integer.toOctalString(iNum1);
    return octal1;
         public static String octalEquivalent2() {
              int iNum2 = Integer.parseInt(num2);
              String octal2 = Integer.toOctalString(iNum2);
              return octal2;
         public static String hexadecimalEquivalent1() {
              int iNum1 = Integer.parseInt(num1);
              String hex1 = Integer.toHexString(iNum1);
              return hex1;
         public static String hexadecimalEquivalent2() {
              int iNum2 = Integer.parseInt(num2);
              String hex2 = Integer.toHexString(iNum2);
              return hex2;
         public double Round1() {
              answer = Math.round(Double.parseDouble(num1));
              return answer;
         public double Round2() {
              answer = Math.round(Double.parseDouble(num2));
              return answer;
              SimpleDateFormat format1 = new SimpleDateFormat("EEEE, dd MMMM yyyy");
         Date now = new Date();
         SimpleDateFormat format2 = new SimpleDateFormat("hh:mm a");
         static Date timeIn = new Date();
         public static long programRuntime() {
              Date timeInD = timeIn;
              long timeOutD = System.currentTimeMillis();
              long msec = timeOutD - timeInD.getTime();
              float timeHours = msec / 1000;
                   return (long) timeHours;
         DecimalFormat decimals = new DecimalFormat("#0.00");
         public String insertNameAndSurname() throws IOException{
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        while (nameSurname == null || nameSurname.length() == 0) {
                             for (int i = 0; i < nameSurname.length(); i++) {
                             if ((nameSurname.charAt(i) > 'a') && (nameSurname.charAt(i) < 'Z')){
                                       inputCorrect = true;
                        else{
                        inputCorrect = false;
                        break;
                        try {
                             BufferedReader inStream = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("Please enter your name and surname: ");
                             nameSurname = inStream.readLine();
                             inputCorrect = true;
                        }catch (IOException ex) {
                             System.out.println("You did not enter your name and surname, " + nameSurname + " is not a name, please enter your name and surname :");
                             inputCorrect = false;
                        System.out.println("\nA warm welcome " + nameSurname + " ,todays date is: " + format1.format(now));
                        System.out.println("and the time is now exactly " + format2.format(timeIn) + ".");
                        return nameSurname;
              public String inputNumber1() throws IOException {
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        try {
                             BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("\nPlease enter a number you want to do a calculation with and hit <ENTER>: ");
                             num1 = br.readLine();
                             double number1 = Double.parseDouble(num1);
                             System.out.println("\nThe number you have entered is: " + number1);
                             inputCorrect = true;
                        } catch (NumberFormatException nfe) {
                             System.out.println("\nYou did not enter a valid number: " + "\""+ num1 + "\" is not a number!!");
                             inputCorrect = false;
                        return num1;
         public String calculatorChoice() throws IOException {
              System.out.println("Please select an option of what you would like to do with this number from the menu below and hit <ENTER>: ");
              System.out.println("\n*********************************************");
              System.out.println("---------------------------------------------");
              System.out.println("Please select an option from the list below: ");
              System.out.println("---------------------------------------------");
              System.out.println("1 - Add");
              System.out.println("2 - Subtract");
              System.out.println("3 - Multiply");
              System.out.println("4 - Divide (remainder included)");
              System.out.println("5 - Maximum and minimum value of two numbers");
              System.out.println("6 - Squareroot");
              System.out.println("7 - Absolute value of numbers");
              System.out.println("8 - Octal and Hexadecimal equivalent of numbers");
              System.out.println("9 - Round numbers");
              System.out.println("0 - Exit program");
              System.out.println("**********************************************");
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        try {
                             BufferedReader inStream = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("Please enter your option and hit <ENTER>: ");
                             choice1 = inStream.readLine();
                             int c1 = Integer.parseInt(choice1);
                             System.out.println("\nYou have entered choice number: " + c1);
                             inputCorrect = true;
                        } catch (NumberFormatException nfe) {
                             System.out.println("You did not enter a valid choice number: " + "\""+ choice1 + "\" is not in the list!!");
                             inputCorrect = false;
                        return choice1;
         public String inputNumber2() throws IOException {
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        try {
                             BufferedReader br2 = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("\nPlease enter another number you want to do the calculation with and hit <ENTER>: ");
                             num2 = br2.readLine();
                             double n2 = Double.parseDouble(num2);
                             System.out.println("\nThe second number you have entered is: " + n2);
                             System.out.println("\nYour numbers are: " + num1 + " and " + num2);
                             inputCorrect = true;
                        } catch (NumberFormatException nfe) {
                             System.out.println("You did not enter a valid number: " + "\""+ num2 + "\" is not a number!!");
                             inputCorrect = false;
                        return num2;
         public int Calculator() {
              int choice2 = (int) Double.parseDouble(choice1);
              switch (choice2) {
                        case 1 :
                             Add();
                             System.out.print("The answer of " + num1 + " + " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 2 :
                             Subtract();
                             System.out.print("The answer of " + num1 + " - " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 3 :
                             Multiply();
                             System.out.print("The answer of " + num1 + " * " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 4 :
                             Divide();
                             System.out.print("The answer of " + num1 + " / " + num2 + " is: " + decimals.format(answer));
                             Modulus();
                             System.out.print(" and the remainder is " + decimals.format(answer));
                             break;
                        case 5 :
                             maximumValue();
                             System.out.println("The maximum number between the numbers " + num1 + " and " + num2 + " is: " + decimals.format(answer));
                             minimumValue();
                             System.out.println("The minimum number between the numbers " + num1 + " and " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 6 :
                             Squareroot1();
                             System.out.println("The squareroot of value " + num1 + " is: " + decimals.format(answer));
                             Squareroot2();
                             System.out.println("The squareroot of value " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 7 :
                             absoluteNumber1();
                             System.out.println("The absolute number of " + num1 + " is: " + decimals.format(answer));
                             absoluteNumber2();
                             System.out.println("The absolute number of " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 8 :
                             octalEquivalent1();
                             System.out.println("The octal equivalent of " + num1 + " is: " + octalEquivalent1());
                             octalEquivalent2();
                             System.out.println("The octal equivalent of " + num2 + " is: " + octalEquivalent2());
                             hexadecimalEquivalent1();
                             System.out.println("\nThe hexadecimal equivalent of " + num1 + " is: " + hexadecimalEquivalent1());
                             hexadecimalEquivalent2();
                             System.out.println("The hexadecimal equivalent of " + num2 + " is: " + hexadecimalEquivalent2());
                             break;
                        case 9 :
                             Round1();
                             System.out.println("The rounded number of " + num1 + " is: " + decimals.format(answer));
                             Round2();
                             System.out.println("The rounded number of " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 0 :
                             if (choice2 == 0) {
                                  System.exit(1);
                             break;
                   return choice2;
              public String anotherCalculation() throws IOException {
                   boolean inputCorrect = false;
                   while (inputCorrect == false) {
                             try {                              
                                  BufferedReader br3 = new BufferedReader (new InputStreamReader(System.in));
                                  System.out.print("\nWould you like to do another calculation? Y/N ");
                                  more = br3.readLine();
                                  String s1 = "y";
                                  String s2 = "Y";
                                  if (more.equals(s1) || more.equals(s2)) {
                                       inputCorrect = true;
                                       while (inputCorrect = true){
                                            inputNumber1();
                                            System.out.println("");
                                            calculatorChoice();
                                            System.out.println("");
                                            inputNumber2();
                                            System.out.println("");
                                            Calculator();
                                            System.out.println("");
                                            anotherCalculation();
                                            System.out.println("");
                                            inputCorrect = true;
                                  } else {
                                       System.out.println("\n" + nameSurname + " thank you for using this program, you have used this program for: " + decimals.format(programRuntime()) + " seconds");
                                       System.out.println("the program will now exit, Goodbye.");
                                       System.exit(0);
                             } catch (IOException ex){
                                  System.out.println("You did not enter a valid answer: " + "\""+ more + "\" is not in the list!!");
                                  inputCorrect = false;
              return more;
         public static void main(String[] args) throws IOException {
              Project p1 = new Project();
              p1.insertNameAndSurname();
              System.out.println("");
              p1.inputNumber1();
              System.out.println("");
              p1.calculatorChoice();
              System.out.println("");
              p1.inputNumber2();
              System.out.println("");
              p1.Calculator();
                   System.out.println("");
                   p1.anotherCalculation();
                   System.out.println("");
    {code}
    *Can you please run my code for yourself and have a look at how this program is constructed*
    *and give me ANY feedback on how I can better this code(program) or if I've done anything wrong from your point of view.*
    Your help will be much appreciated.
    Thanks in advance

    Smirre wrote:
    Now my question is this: How can I restrict the user to only enter 'letters' (and spaces of course) but allow NO numbers for his/her surname??You cannot restrict the user. It is a sad fact in programming that the worst bug always sits in front of the Computer.
    What you could do is checking the input string for numbers. If it contains numbers, just reprompt for the Name.
    AND you might want to ask yourself why the heck a calculator needs to know the users Name.

  • I need help with a download from Adobe

    I need help with Adode photoshop elements that I bought from Adobe. The download take forever. I can't get signed in very easy. It take forever

    Hi Kathy1963-1964,
    Welcome to Adobe Forum,
    You have photoshop elements 12, you can try downloading without the akamei downloader .
    http://prodesigntools.com/photoshop-elements-12-direct-download-links-premiere.html
    Please read the " very important instruction" prior to downoload.
    I would request you to disable the firewall & the antivirus prior to download.
    Let us know if it worked.
    Regards,
    Rajshree

  • Currency fields on Adobe Interactive Form

    Hello,
    I have placed a currency field on the Adobe Interactive Form.
    Local has been set to 'Viewer's System Locale'.
    But if I try to put any amount in this field, the following error message is displayed:
    "Distance Between Separators for Thousands Must Be 3."
    I tried with following amounts:
    10000
    10000.54
    10
    1
    Note that my default decimal point is '.'.
    Regards
    Sagar

    Sagar,
    Goto Object Palette --> Value Tab --> Check if you set any Validation Pattern for the currency field.
    If you don't want, remove the validation.
    Chintan

  • Hiding a field in adobe interactive form

    Hi All!
    I am working with Adobe Interactive form. I want to make a <i><b>subform</b></i> invisible based on the selection of one of the options in the <i><b>dropdown list</b></i>. I tried the following javascript in the change event of the <i><b>dropdown list</b></i>:
    <i><b>xfa.resolveNodes("subformName").presence = "invisible";</b></i>
    but nothing happens when i change the value of the <i><b>dropdown list</b></i>.
    Please suggest some solution for this.
    Thanks!

    Hi Temp,
                 We can use a data driven approach for setting the presence. The “Minimum Occurrence property’ has to be set as 0. In this approach if data does not exists at runtime for that particular node, the complete subform will be invisible without any reserved space. (In this approach also layout has to be set as Flow Layout only).
    regards
    Sumit

  • Process data of none bound fields in Adobe Interactive Form (stack 13)

    I use a Adobe interactive form (made in Designer 7.0)which is a combination of fields bound to Web Dynpro Context fields and fields which has no binding at all (in Designer: Default binding = Normal). The Adobe Document Services on the J2ee server is of stack 13.
    When I save the Adobe Form (off-line scenario)from the Web Dynpro Application, only fields bounded to the Web Dynpro Context are saved in the Form on my local file system(no warning that data isn't saved).
    When I open the Form for off-line editing, I can change bounded fields and none bounded fields. But when I save and re-open the form, the data in the none bounded fields is lost.
    I used the same scenario in a stack 11 j2ee/portal system, but then all data (bounded or not) in the form was saved!
    Could anyone explain the difference, but better tell me how to save both kind of fields in the off-line form (and bounding all fields is <u>not</u> a solution).
    Thanks in advance,
    Richard

    Hi,
    Check your ADS settings, I feel it's due to lack of some config in ADS only.
    Regards
    <i><b>Raja Sekhar</b></i>

  • Need help with a field to increment points

    There is a business need to add points for some of our accounts. Example is that if an account is a training account, we need to add 5 points. If the same account has a special program tied to it, it gets another 3 points, so on and so forth..
    I need to know what kind of a field I can set up for this to capture the points. It seems the field will need to be a calculated field. However, how can I store the matrix?
    Then, we need to run a report to show points by account.
    I'm really in need of help here .. not sure how to address this business need.
    Thanks,
    Anita

    Hi !
    If you only need a report showing your accounts ordered by points, you'll have to build your report and use the CASE WHEN ... THEN ... ELSE ... END function. If you have for example 3 checkboxes when :
    the 1st brings 3 points
    the 2nd brings 7 points
    the 3rd brings 12 points
    You'll have in your report something like :
    Column 1 : Account Name
    Column 2 : Checkbox1 (CASE WHEN checkbox1 = 'Y' THEN 3 ELSE 0 END)
    Column 3 : Checkbox2 (CASE WHEN checkbox2 = 'Y' THEN 7 ELSE 0 END)
    Column 4 : Checkbox3 (CASE WHEN checkbox3 = 'Y' THEN 12 ELSE 0 END)
    Column 5 : Total (Column 2 + Column 3 + Column 4)
    You can easily do the same with picklist values :
    CASE WHEN pick1 = 'val1' THEN 3
    WHEN pick1 ='val2' THEN 8
    ELSE 0 END
    And if you need to display a score on the account detail page, I'll suggest to create a web applet displaying a report calculating the score the same way than above, but with the AccountId as parameter.
    Hope this will help, feel free to ask more !
    Max

  • Changing the background of a text field in adobe interactive forms

    Hello All,
    Is there any way to change the background colour of text field in interactive form dynamically.??
    Thanks,

    Naresh,
    Change the language to JavaScipt in Script Editor of LiveCycle Designer and use the following code to highlight the area of TextField where R,G,B means that you have to give the RGB values of the color you want.
    <YourTextFieldName>.border.edge.color.value = "R,G,B";
    For eg:- If you have a textfield with name TextField1 then this will highlight the TextField1 area in red color.
    if ((TextField1.rawValue==null) || (TextField1.rawValue==""))
      TextField1.border.edge.color.value = "255,0,0";
    You can use this on exit event of Textfield1 or at the submit button where you check the form data.
    Chintan

  • Need help with PayPal for a conference Registration Form

    I created a conference registration page and enabled PayPal.  I tested it with no issues.
    My client distributed the URL, and two people tried to register today, one of whom was my client.  She called me to say she never got a confirmation email and that when she entered her AMEX information, and hit the pay button, the message she got back was "Done but with Errors."
    Both people show up on my view responses report, but there are no values in the last three columns, which indicates an issue with PayPal.  When I check PayPal, there is no recent activity in my account.
    I need help resolving this ASAP.  Tech support couldn't help, he promised to escalate my case (#183366842) and have someone call me back within an hour.
    Is this forum monitored by FormsCentral staff who might be able to help?
    Thanks!
    Paula

    We're following up with PayPal and the [email protected] offline.

  • Need help with calculating interest

    Hey im trying to find out where my calculations are screwing up on the interest is coming up wrong but i am unable to find out where. After every month its suppose to be deposit - withdrawl * monthly interest rate and then add that total to the new month etc... any help will be appreciated. Heres my class and test
    public class SavingsAccount
        private double bal;
        private double intRate;
    The constructor initializes an object with a
    balance and an annual interest rate.
    @param bal The account balance.
    @param intRate The annual interest rate.
        public SavingsAccount(double bal, double intRate)
        bal= 0.0;
        intRate = 0.0;
        The withdraw method withdraws an amount from
        the account.
        @param amount The amount to withdraw.
        public void withdraw(double amount)
            bal -= amount;
        The deposit method deposits an amount into
        the account.
        @param amount The amount to deposit.
        public void deposit(double amount)
            bal += amount;
        The addInterest method calculates the monthly
        interest and adds it to the account balance.
        public void addInterest()
        // Get the monthly interest rate.
        // Calculate the last amount of interest earned.
        // Add the interest to the balance.
         intRate = bal * (intRate/12);
         bal += intRate;
        The getBalance method returns the account balance.
        @return The account balance.
        public double getBalance()
        return bal;
        The getInterestRate method returns the annual
        interest rate.
        @return The annual interest rate.
        public double getInterestRate()
        return intRate;
        The getLastInterest method returns the last amount
        of interest earned.
        @return The last amount of interest earned.
        public double getLastInterest()
        return bal;
    import java.util.Scanner;
    import java.text.DecimalFormat;
    public class SavingsAccountTest
        public static void main(String args[])
        // Annual interest rate
           double intRate;
        // Starting balance
           double startBal;
        // Amount of deposits for a month
           double deposit;
           double totalDeposit;
        // Amount withdrawn in a month
           double withdrawn;
           double totalWithdrawn;
        // Interest earned
           double intEarned = 0;
        // Deposit accumulator
           deposit = 0.0;
           totalDeposit = 0.0;
        // Withdrawal accumulator
           withdrawn =0.0;
           totalWithdrawn = 0.0;
        // Months that have passed
           double months;
        // Create a Scanner object for keyboard input.
           Scanner keyboard = new Scanner(System.in);
        // Get the starting balance.
           System.out.println("What is your account's starting balance");
           startBal = keyboard.nextDouble();
           while (startBal < 0)
               startBal=0;
        // Get the annual interest rate.
           System.out.println("What is the annual interest rate?");
           intRate = keyboard.nextDouble();
           while (intRate <= 0 )
               intRate = 0;
        // Create a SavingsAccount object.
           SavingsAccount account = new SavingsAccount(0.0, 0.0);
        // Get the number of months that have passed.
           System.out.println("How many months have passed since the " +
                              "account has opened? ");
           months = keyboard.nextDouble();
           while (months <= 0)
               months = 1;
        // Get the deposits and withdrawals for each month.
        for (int i = 1; i <= months; i++)
        // Get the deposits.
           System.out.println("Enter the amount deposited during month " + i);
           deposit= keyboard.nextDouble();
           totalDeposit += deposit;
           while (deposit <=0)
               deposit = 0;
        // Get the withdrawals.
           System.out.println("Enter the amount withdrawn during month " + i);
           withdrawn = keyboard.nextDouble();
           totalWithdrawn += withdrawn;
           while (withdrawn <= 0)
               withdrawn = 0;
        // Add the deposits to the account.
           startBal += deposit;
        // Subtract the withdrawals.
           startBal -= withdrawn;
        // Add the monthly interest.
           intRate = startBal * intRate/12;
           startBal += intRate;
        // Accumulate the amount of interest earned.
           intRate += intEarned;
        // Create a DecimalFormat object for formatting output.
        DecimalFormat dollar = new DecimalFormat("#,##0.00");
        // Display the totals and the balance.
        System.out.println("Total deposited: " + dollar.format(totalDeposit));
        System.out.println("Total withdrawn: " + dollar.format(totalWithdrawn));
        System.out.println("Total interest earned: " + dollar.format(intEarned));
        System.out.println("Account balance: " + dollar.format(startBal));
    }

    Ok this is what i have fixed up so far but im still having trouble calculating the interest. Problem1) We were given the skeleton to the class and demo. I cannot figure out what to enter in getLastInterest.(completely lost all i need is hint) 2)When i try to get the Total money deposited and i call the account.deposit(balance) it keeps on giving an error void not allowed. Any help is appreciated
    public class SavingsAccount
        private double balance;
        private double interest;
        private double intEarned;
        The constructor initializes an object with a
        balance and an annual interest rate.
        @param bal The account balance.
        @param intRate The annual interest rate.
        public SavingsAccount(double bal, double intRate)
        balance = bal;
        interest = intRate;
        The withdraw method withdraws an amount from
        the account.
        @param amount The amount to withdraw.
        public void withdraw(double amount)
            balance -= amount;
        The deposit method deposits an amount into
        the account.
        @param amount The amount to deposit.
        public void deposit(double amount)
            balance += amount;
        The addInterest method calculates the monthly
        interest and adds it to the account balance.
        public void addInterest()
        // Get the monthly interest rate.
        // Calculate the last amount of interest earned.
        // Add the interest to the balance.
         interest = balance * (interest/12);
         interest = intEarned;
         balance += interest;
        The getBalance method returns the account balance.
        @return The account balance.
        public double getBalance()
        return balance;
        The getInterestRate method returns the annual
        interest rate.
        @return The annual interest rate.
        public double getInterestRate()
        return interest;
        The getLastInterest method returns the last amount
        of interest earned.
        @return The last amount of interest earned.
        public double getLastInterest()
        return intEarned;
    import java.util.Scanner;
    import java.text.DecimalFormat;
    public class SavingsAccountTest
        public static void main(String args[])
        // Annual interest rate
           double intRate;
        // Starting balance
           double balance;
        // Amount of deposits for a month
           double deposit;    
        // Amount withdrawn in a month
           double withdraw;
        // Interest earned
           double intEarned = 0;
        // Deposit accumulator
           deposit = 0.0;  
        // Withdrawal accumulator
           withdraw =0.0;    
        // Months that have passed
           double months;
        // Create a Scanner object for keyboard input.
           Scanner keyboard = new Scanner(System.in);
        // Get the starting balance.
           System.out.println("What is your account's starting balance");
           balance = keyboard.nextDouble();
           if (balance < 0)
               balance=0;
        // Get the annual interest rate.
           System.out.println("What is the annual interest rate?");
           intRate = keyboard.nextDouble();
           if (intRate <= 0 )
               intRate = 0;
        // Create a SavingsAccount object. Cannot find Symbol!!
           SavingsAccount account = new SavingsAccount(balance,intRate);
        // Get the number of months that have passed.
           System.out.println("How many months have passed since the " +
                              "account has opened? ");
           months = keyboard.nextDouble();
           if (months <= 0)
               months = 1;
        // Get the deposits and withdrawals for each month.
        for (int i = 1; i <= months; i++)
        // Get the deposits.
           System.out.println("Enter the amount deposited during month " + i);
           deposit= keyboard.nextDouble();
           account.deposit(deposit);
           if (deposit <=0)
               deposit = 0;
        // Get the withdrawals.
           System.out.println("Enter the amount withdrawn during month " + i);
           withdraw = keyboard.nextDouble();
           account.withdraw(withdraw);
           if (withdraw <= 0 || withdraw >= balance)
               withdraw = 0;
        // Add the deposits to the account.
           account.deposit(balance);
        // Subtract the withdrawals.
           account.withdraw(balance);
        // Add the monthly interest.
           account.addInterest();
        // Accumulate the amount of interest earned. ????? Wrong
           intRate += intEarned;
        // Create a DecimalFormat object for formatting output.
        DecimalFormat dollar = new DecimalFormat("#,##0.00");
        // Display the totals and the balance.
        System.out.println("Total deposited: " + dollar.format(account.deposit(balance)));
        System.out.println("Total withdrawn: " + dollar.format(account.withdraw(balance)));
        System.out.println("Total interest earned: " + dollar.format(account.addInterest()));
        System.out.println("Account balance: " + dollar.format(account.getBalance()));
    }

  • Beginner needs help with CMR field problem

    Hello,
    I have two ejbs, one called EstablishmentEJB and another called VisitorCommentsEJB. The relationship is of one EstablishmentEJB instance to many VisitorCommentsEJB instances.
    Here are the definitions for the tables:
    CREATE TABLE establishments (
      DB_ESTABLISHMENT_ID int(11) NOT NULL default '0',
      DB_POSTCODE varchar(100) NOT NULL default '',
      DB_ESTABLISHMENT_NAME varchar(255) NOT NULL default '',
      PRIMARY KEY  (DB_ESTABLISHMENT_ID)
    ) TYPE=InnoDB;
    CREATE TABLE visitors_comments (
      DB_VISITOR_COMMENT_ID int(11) NOT NULL auto_increment,
      DB_ESTABLISHMENT_ID int(11) NOT NULL default '0',
      DB_COMMENT varchar(255) NOT NULL default '',
      PRIMARY KEY  (DB_VISITOR_COMMENT_ID)
    ) TYPE=InnoDB;Here are the xml DDs:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!--
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    -->
    <ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
               http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"
               version="2.1">
         <description>test guide</description>
         <display-name>test guide</display-name>
         <enterprise-beans>
              <!--===========Establishment================ -->
              <entity>
                   <ejb-name>EstablishmentEJB</ejb-name>
                   <home>com.softwareag.test_guide.establishmentEJB.PGEstablishmentHome</home>
                   <remote>com.softwareag.test_guide.establishmentEJB.PGEstablishment</remote>
                   <local-home>com.softwareag.test_guide.establishmentEJB.PGEstablishmentLocalHome</local-home>
                   <local>com.softwareag.test_guide.establishmentEJB.PGEstablishmentLocal</local>
                   <ejb-class>com.softwareag.test_guide.establishmentEJB.PGEstablishmentBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.Integer</prim-key-class>
                   <reentrant>false</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>Establishment</abstract-schema-name>
                   <cmp-field>
                        <field-name>id</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>name</field-name>
                   </cmp-field>
                   <primkey-field>id</primkey-field>
              </entity>
              <!--===========Grade================ -->
              <entity>
                   <ejb-name>GradeEJB</ejb-name>
                   <home>com.softwareag.test_guide.gradeEJB.PGGradeHome</home>
                   <remote>com.softwareag.test_guide.gradeEJB.PGGrade</remote>
                   <local-home>com.softwareag.test_guide.gradeEJB.PGGradeLocalHome</local-home>
                   <local>com.softwareag.test_guide.gradeEJB.PGGradeLocal</local>
                   <ejb-class>com.softwareag.test_guide.gradeEJB.PGGradeBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.Integer</prim-key-class>
                   <reentrant>false</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>Grade</abstract-schema-name>
                   <cmp-field>
                        <field-name>id</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>grade</field-name>
                   </cmp-field>
                   <primkey-field>id</primkey-field>
              </entity>
              <!--===========VisitorsComment================ -->
              <entity>
                   <ejb-name>VisitorCommentEJB</ejb-name>
                   <home>com.softwareag.test_guide.visitorCommentEJB.PGVisitorCommentHome</home>
                   <remote>com.softwareag.test_guide.visitorCommentEJB.PGVisitorComment</remote>
                   <local-home>com.softwareag.test_guide.visitorCommentEJB.PGVisitorCommentLocalHome</local-home>
                   <local>com.softwareag.test_guide.visitorCommentEJB.PGVisitorCommentLocal</local>
                   <ejb-class>com.softwareag.test_guide.visitorCommentEJB.PGVisitorCommentBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.Integer</prim-key-class>
                   <reentrant>false</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>VisitorsComment</abstract-schema-name>
                   <cmp-field>
                        <field-name>id</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>comment</field-name>
                   </cmp-field>
                   <primkey-field>id</primkey-field>
              </entity>
              <!--===========Country================ -->
              <entity>
                   <ejb-name>CountryEJB</ejb-name>
                   <home>com.softwareag.test_guide.countryEJB.PGCountryHome</home>
                   <remote>com.softwareag.test_guide.countryEJB.PGCountry</remote>
                   <local-home>com.softwareag.test_guide.countryEJB.PGCountryLocalHome</local-home>
                   <local>com.softwareag.test_guide.countryEJB.PGCountryLocal</local>
                   <ejb-class>com.softwareag.test_guide.countryEJB.PGCountryBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.Integer</prim-key-class>
                   <reentrant>false</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>Country</abstract-schema-name>
                   <cmp-field>
                        <field-name>id</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>countryName</field-name>
                   </cmp-field>
                   <primkey-field>id</primkey-field>
              </entity>
              <!--===========Category================ -->
              <entity>
                   <ejb-name>CategoryEJB</ejb-name>
                   <home>com.softwareag.test_guide.categoryEJB.PGCategoryHome</home>
                   <remote>com.softwareag.test_guide.categoryEJB.PGCategory</remote>
                   <local-home>com.softwareag.test_guide.categoryEJB.PGCategoryLocalHome</local-home>
                   <local>com.softwareag.test_guide.categoryEJB.PGCategoryLocal</local>
                   <ejb-class>com.softwareag.test_guide.categoryEJB.PGCategoryBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.Integer</prim-key-class>
                   <reentrant>false</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>Category</abstract-schema-name>
                   <cmp-field>
                        <field-name>id</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>category</field-name>
                   </cmp-field>
                   <primkey-field>id</primkey-field>
              </entity>
              <!--===========SearchEngineValueListHandler================ -->
              <session>
                   <ejb-name>PGSearchEngineValueListHandlerEJB</ejb-name>
                   <home>com.softwareag.test_guide.searchEngineEJB.PGSearchEngineValueListHandlerHome</home>
                   <remote>com.softwareag.test_guide.searchEngineEJB.PGSearchEngineValueListHandler</remote>
                   <local-home>com.softwareag.test_guide.searchEngineEJB.PGSearchEngineValueListHandlerLocalHome</local-home>
                   <local>com.softwareag.test_guide.searchEngineEJB.PGSearchEngineValueListHandlerLocal</local>
                   <ejb-class>com.softwareag.test_guide.searchEngineEJB.PGSearchEngineValueListHandlerBean</ejb-class>
                   <session-type>Stateful</session-type>
                   <transaction-type>Container</transaction-type>
                    <resource-ref>
                   <res-ref-name>jdbc/test_guia</res-ref-name>
                   <res-type>javax.sql.DataSource</res-type>
                   <res-auth>Application</res-auth>
                   </resource-ref>
              </session>
              <!--===========SessionFacade================ -->
              <session>
                   <ejb-name>PGSessionFacadeEJB</ejb-name>
                   <home>com.softwareag.test_guide.sessionFacadeEJB.PGSessionFacadeHome</home>
                   <remote>com.softwareag.test_guide.sessionFacadeEJB.PGSessionFacade</remote>
                   <local-home>com.softwareag.test_guide.sessionFacadeEJB.PGSessionFacadeLocalHome</local-home>
                   <local>com.softwareag.test_guide.sessionFacadeEJB.PGSessionFacadeLocal</local>
                   <ejb-class>com.softwareag.test_guide.sessionFacadeEJB.PGSessionFacadeBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <resource-ref>
                   <res-ref-name>jdbc/test_guia</res-ref-name>
                   <res-type>javax.sql.DataSource</res-type>
                   <res-auth>Application</res-auth>
                   </resource-ref>
              </session>
         </enterprise-beans>
         <relationships>
              <!--===========Establishments-VisitorComments================-->
              <ejb-relation>
                   <ejb-relation-name>Establishment-VisitorComment</ejb-relation-name>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>Establishment-has-many-comments</ejb-relationship-role-name>
                        <multiplicity>One</multiplicity>
                        <relationship-role-source>
                             <ejb-name>EstablishmentEJB</ejb-name>
                        </relationship-role-source>
                        <cmr-field>
                             <cmr-field-name>visitorComments</cmr-field-name>
                             <cmr-field-type>java.util.Collection</cmr-field-type>
                        </cmr-field>
                   </ejb-relationship-role>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>Comment-belongs-to-Establishment</ejb-relationship-role-name>
                        <multiplicity>Many</multiplicity>
                        <relationship-role-source>
                             <ejb-name>VisitorCommentEJB</ejb-name>
                        </relationship-role-source>
                   </ejb-relationship-role>
              </ejb-relation>
              <!--===========Establishments-Grades================-->
              <ejb-relation>
                   <ejb-relation-name>Establishment-Grade</ejb-relation-name>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>Establishment-has-many-grades</ejb-relationship-role-name>
                        <multiplicity>One</multiplicity>
                        <relationship-role-source>
                             <ejb-name>EstablishmentEJB</ejb-name>
                        </relationship-role-source>
                        <cmr-field>
                             <cmr-field-name>grades</cmr-field-name>
                             <cmr-field-type>java.util.Collection</cmr-field-type>
                        </cmr-field>
                   </ejb-relationship-role>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>Grade-belongs-to-Establishment</ejb-relationship-role-name>
                        <multiplicity>Many</multiplicity>
                        <relationship-role-source>
                             <ejb-name>GradeEJB</ejb-name>
                        </relationship-role-source>
                   </ejb-relationship-role>
              </ejb-relation>
              <!--===========Establishments-Countries================-->
              <ejb-relation>
                   <ejb-relation-name>Country-Establishment</ejb-relation-name>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>Country-has-many-establishments</ejb-relationship-role-name>
                        <!--========== One or Many here?? ==========-->
                        <multiplicity>Many</multiplicity>
                        <relationship-role-source>
                             <ejb-name>CountryEJB</ejb-name>
                        </relationship-role-source>
                   </ejb-relationship-role>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>Establishment-has-many-countries</ejb-relationship-role-name>
                        <multiplicity>Many</multiplicity>
                        <relationship-role-source>
                             <ejb-name>EstablishmentEJB</ejb-name>
                        </relationship-role-source>
                        <cmr-field>
                             <cmr-field-name>countries</cmr-field-name>
                             <cmr-field-type>java.util.Collection</cmr-field-type>
                        </cmr-field>
                   </ejb-relationship-role>
              </ejb-relation>
              <!--===========Establishments-Categories ================-->
              <ejb-relation>
                   <ejb-relation-name>Establishment-Category</ejb-relation-name>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>Establishment-has-many-categories</ejb-relationship-role-name>
                        <multiplicity>Many</multiplicity>
                        <relationship-role-source>
                             <ejb-name>EstablishmentEJB</ejb-name>
                        </relationship-role-source>
                        <cmr-field>
                             <cmr-field-name>categories</cmr-field-name>
                             <cmr-field-type>java.util.Collection</cmr-field-type>
                        </cmr-field>
                   </ejb-relationship-role>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>Category-has-many-establishments</ejb-relationship-role-name>
                        <multiplicity>Many</multiplicity>
                        <relationship-role-source>
                             <ejb-name>CategoryEJB</ejb-name>
                        </relationship-role-source>
                   </ejb-relationship-role>
              </ejb-relation>
         </relationships>
    </ejb-jar>
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <jonas-ejb-jar xmlns="http://www.objectweb.org/jonas/ns"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://www.objectweb.org/jonas/ns
                http://www.objectweb.org/jonas/ns/jonas-ejb-jar_4_0.xsd" >
    <!--
    <!DOCTYPE jonas-ejb-jar PUBLIC "-//ObjectWeb//DTD JOnAS 3.2//EN" "http://www.objectweb.org/jonas/dtds/jonas-ejb-jar_3_2.dtd">
    <jonas-ejb-jar>
    -->
    <!-- ===============SearchEngineValueListHandler=======================-->
      <jonas-session>
        <ejb-name>PGSearchEngineValueListHandlerEJB</ejb-name>
        <jndi-name>PGSearchEngineValueListHandlerEJBHome</jndi-name>
        <jonas-resource>
          <res-ref-name>jdbc/test_guia</res-ref-name>
          <jndi-name>test_guia</jndi-name>
        </jonas-resource>
      </jonas-session>
      <!-- ===============SessionFacade=======================-->
      <jonas-session>
        <ejb-name>PGSessionFacadeEJB</ejb-name>
        <jndi-name>PGSessionFacadeEJBHome</jndi-name>
         <jonas-resource>
          <res-ref-name>jdbc/test_guia</res-ref-name>
          <jndi-name>test_guia</jndi-name>
        </jonas-resource>
      </jonas-session>
    <!-- ===============Establishment=======================-->
      <jonas-entity>
        <ejb-name>EstablishmentEJB</ejb-name>
        <jndi-name>PGEstablishmentHome</jndi-name>
             <cleanup>none</cleanup>
         <jdbc-mapping>
          <jndi-name>test_guia</jndi-name>
          <jdbc-table-name>ESTABLISHMENTS</jdbc-table-name>
          <cmp-field-jdbc-mapping>
         <field-name>id</field-name>
         <jdbc-field-name>DB_ESTABLISHMENT_ID</jdbc-field-name>
          </cmp-field-jdbc-mapping>
          <cmp-field-jdbc-mapping>
         <field-name>name</field-name>
    <jdbc-field-name>DB_ESTABLISHMENT_NAME</jdbc-field-name>
          </cmp-field-jdbc-mapping>
        </jdbc-mapping>
    </jonas-entity>
      <!-- ===============Grade=======================-->
        <jonas-entity>
        <ejb-name>GradeEJB</ejb-name>
        <jndi-name>PGgradeHome</jndi-name>
         <cleanup>none</cleanup>
         <jdbc-mapping>
          <jndi-name>test_guia</jndi-name>
          <jdbc-table-name>GRADES</jdbc-table-name>
          <cmp-field-jdbc-mapping>
         <field-name>id</field-name>
         <jdbc-field-name>DB_GRADE_ID</jdbc-field-name>
          </cmp-field-jdbc-mapping>
          <cmp-field-jdbc-mapping>
         <field-name>grade</field-name>
         <jdbc-field-name>DB_GRADE</jdbc-field-name>
          </cmp-field-jdbc-mapping>
        <!--
         <cmp-field-jdbc-mapping>
         <field-name>establishment_id</field-name>
         <jdbc-field-name>DB_ESTABLISHMENT_ID</jdbc-field-name>
        </cmp-field-jdbc-mapping>
         -->
        </jdbc-mapping>
      </jonas-entity>
      <!-- ===============Visitor�s comments=======================-->
        <jonas-entity>
        <ejb-name>VisitorCommentEJB</ejb-name>
        <jndi-name>PGVisitorCommentHome</jndi-name>
         <cleanup>none</cleanup>
         <jdbc-mapping>
          <jndi-name>test_guia</jndi-name>
          <jdbc-table-name>VISITORS_COMMENTS</jdbc-table-name>
          <cmp-field-jdbc-mapping>
         <field-name>id</field-name>
         <jdbc-field-name>DB_VISITOR_COMMENT_ID</jdbc-field-name>
          </cmp-field-jdbc-mapping>
          <cmp-field-jdbc-mapping>
         <field-name>comment</field-name>
         <jdbc-field-name>DB_COMMENT</jdbc-field-name>
          </cmp-field-jdbc-mapping>
            <!--
           <cmp-field-jdbc-mapping>
         <field-name>establishment_id</field-name>
         <jdbc-field-name>DB_ESTABLISHMENT_ID</jdbc-field-name>
          </cmp-field-jdbc-mapping>
         -->
        </jdbc-mapping>
      </jonas-entity>
        <!-- ===============Countries=======================-->
        <jonas-entity>
        <ejb-name>CountryEJB</ejb-name>
        <jndi-name>PGcountryHome</jndi-name>
              <cleanup>none</cleanup>
        <jdbc-mapping>
          <jndi-name>test_guia</jndi-name>
          <jdbc-table-name>COUNTRIES</jdbc-table-name>
          <cmp-field-jdbc-mapping>
         <field-name>id</field-name>
         <jdbc-field-name>DB_COUNTRY_ID</jdbc-field-name>
          </cmp-field-jdbc-mapping>
          <cmp-field-jdbc-mapping>
         <field-name>countryName</field-name>
         <jdbc-field-name>DB_COUNTRY_NAME_FR</jdbc-field-name>
          </cmp-field-jdbc-mapping>
        </jdbc-mapping>
      </jonas-entity>
      <!-- ===============Categories=======================-->
        <jonas-entity>
        <ejb-name>CategoryEJB</ejb-name>
        <jndi-name>PGcategoryHome</jndi-name>
        <cleanup>none</cleanup>
         <jdbc-mapping>
          <jndi-name>test_guia</jndi-name>
          <jdbc-table-name>CATEGORIES</jdbc-table-name>
          <cmp-field-jdbc-mapping>
         <field-name>id</field-name>
         <jdbc-field-name>DB_CATEGORY_ID</jdbc-field-name>
          </cmp-field-jdbc-mapping>
          <cmp-field-jdbc-mapping>
         <field-name>category</field-name>
         <jdbc-field-name>DB_CATEGORY_NAME_FR</jdbc-field-name>
          </cmp-field-jdbc-mapping>
        </jdbc-mapping>
      </jonas-entity>
      <!--===========Establishments-VisitorComments================-->
      <jonas-ejb-relation>
          <ejb-relation-name>Establishment-VisitorComment</ejb-relation-name>
          <jonas-ejb-relationship-role>
            <ejb-relationship-role-name>Comment-belongs-to-Establishment</ejb-relationship-role-name>
            <foreign-key-jdbc-mapping>
              <foreign-key-jdbc-name>DB_ESTABLISHMENT_ID</foreign-key-jdbc-name>
            </foreign-key-jdbc-mapping>
          </jonas-ejb-relationship-role>
        </jonas-ejb-relation>
         <!--===========Establishments-Grades================-->
           <jonas-ejb-relation>
          <ejb-relation-name>Establishment-Grade</ejb-relation-name>
          <jonas-ejb-relationship-role>
            <ejb-relationship-role-name>Grade-belongs-to-Establishment</ejb-relationship-role-name>
            <foreign-key-jdbc-mapping>
              <foreign-key-jdbc-name>DB_ESTABLISHMENT_ID</foreign-key-jdbc-name>
            </foreign-key-jdbc-mapping>
          </jonas-ejb-relationship-role>
        </jonas-ejb-relation>
         <!--===========Establishments-Countries================-->
          <jonas-ejb-relation>
          <ejb-relation-name>Country-Establishment</ejb-relation-name>
          <jdbc-table-name>COUNTRIES_ESTABLISHMENTS</jdbc-table-name>
          <jonas-ejb-relationship-role>
            <ejb-relationship-role-name>Country-has-many-establishments</ejb-relationship-role-name>
            <foreign-key-jdbc-mapping>
              <foreign-key-jdbc-name>DB_ESTABLISHMENT_ID</foreign-key-jdbc-name>
            </foreign-key-jdbc-mapping>
          </jonas-ejb-relationship-role>
          <jonas-ejb-relationship-role>
            <ejb-relationship-role-name>Establishment-has-many-countries</ejb-relationship-role-name>
            <foreign-key-jdbc-mapping>
              <foreign-key-jdbc-name>DB_COUNTRY_ID</foreign-key-jdbc-name>
            </foreign-key-jdbc-mapping>
          </jonas-ejb-relationship-role>
        </jonas-ejb-relation>
         <!--===========Establishments-Categories ================-->
          <jonas-ejb-relation>
          <ejb-relation-name>Establishment-Category</ejb-relation-name>
          <jdbc-table-name>ESTABLISHMENTS_CATEGORIES</jdbc-table-name>
          <jonas-ejb-relationship-role>
            <ejb-relationship-role-name>Establishment-has-many-categories</ejb-relationship-role-name>
            <foreign-key-jdbc-mapping>
              <foreign-key-jdbc-name>DB_CATEGORY_ID</foreign-key-jdbc-name>
            </foreign-key-jdbc-mapping>
          </jonas-ejb-relationship-role>
          <jonas-ejb-relationship-role>
            <ejb-relationship-role-name>Category-has-many-establishments</ejb-relationship-role-name>
            <foreign-key-jdbc-mapping>
              <foreign-key-jdbc-name>DB_ESTABLISHMENT_ID</foreign-key-jdbc-name>
            </foreign-key-jdbc-mapping>
          </jonas-ejb-relationship-role>
        </jonas-ejb-relation>
    </jonas-ejb-jar>Here are the two classes for the beans
    package com.softwareag.test_guide.establishmentEJB;
    import java.util.Collection;
    import java.util.Iterator;
    import javax.ejb.CreateException;
    import javax.ejb.EntityBean;
    import javax.ejb.EntityContext;
    import javax.ejb.RemoveException;
    import com.softwareag.test_guide.ejb.util.PGServiceLocator;
    import com.softwareag.test_guide.ejb.util.PGServiceLocatorException;
    import com.softwareag.test_guide.gradeEJB.PGGradeLocal;
    import com.softwareag.test_guide.visitorCommentEJB.PGVisitorCommentLocal;
    import com.softwareag.test_guide.visitorCommentEJB.PGVisitorCommentLocalHome;
    * @author Julien Martin
    public abstract class PGEstablishmentBean implements EntityBean {
         public Integer ejbCreate(
              Integer id,
              String name,
              Collection visitorComments,
              Collection grades,
              Collection countries,
              Collection categories)
              throws CreateException {
              setId(id);
              setName(name);
              setVisitorComments(visitorComments);
              setGrades(grades);
              return null;
         public void ejbPostCreate(
              Integer id,
              String name,
              Collection visitorComments,
              Collection grades,
              Collection countries,
              Collection categories) {
              setCountries(countries);
              setCategories(categories);
         //Business methods
         public int getAverageGrade() {
              Collection grades = this.getGrades();
              if (grades.size() == 0) {
                   return 0;
              } else {
                   Iterator iterator = grades.iterator();
                   int total = 0;
                   while (iterator.hasNext()) {
                        PGGradeLocal pGGradeLocal = (PGGradeLocal) iterator.next();
                        Integer amount = pGGradeLocal.getGrade();
                        total = total + amount.intValue();
                   float average = total / grades.size();
                   int roundedAverage = Math.round(average);
                   return roundedAverage;
         public void addComment(Integer id, String comment) {
              try {
                   PGVisitorCommentLocalHome pGcommentHome =
                        (PGVisitorCommentLocalHome) PGServiceLocator.getInstance().getLocalHome("PGVisitorCommentHome_L");
                   PGVisitorCommentLocal pGcomment = pGcommentHome.create(id, comment);
                   Collection pGcomments = this.getVisitorComments();
                   pGcomments.add(pGcomment);
              } catch (PGServiceLocatorException e) {
                   e.printStackTrace();
              } catch (CreateException e) {
                   e.printStackTrace();
         //Persistence fields
         public abstract Integer getId();
         public abstract void setId(Integer id);
         public abstract String getName();
         public abstract void setName(String name);
         //Relation fields
         public abstract Collection getVisitorComments();
         public abstract void setVisitorComments(Collection visitorComments);
         public abstract Collection getGrades();
         public abstract void setGrades(Collection grades);
         public abstract Collection getCountries();
         public abstract void setCountries(Collection countries);
         public abstract Collection getCategories();
         public abstract void setCategories(Collection categories);
         //Callback methods
         public void setEntityContext(EntityContext ec) {
         public void unsetEntityContext() {
         public void ejbLoad() {
         public void ejbStore() {
         public void ejbActivate() {
         public void ejbPassivate() {
         public void ejbRemove() throws RemoveException {
    package com.softwareag.test_guide.visitorCommentEJB;
    import javax.ejb.CreateException;
    import javax.ejb.EntityBean;
    import javax.ejb.EntityContext;
    import javax.ejb.RemoveException;
    * @author Julien Martin
    public abstract class PGVisitorCommentBean implements EntityBean {
         public Integer ejbCreate(Integer id, String comment)throws CreateException {
              setId(id);
              setComment(comment);
              return null;
         public void ejbPostCreate(Integer id, String comment) {}
         //Persistence fields
         public abstract Integer getId();
         public abstract void setId(Integer id);
         public abstract String getComment();
         public abstract void setComment(String comment);
    //     public abstract Integer getEstablishment_id();
    //     public abstract void setEstablishment_id(Integer establishment_id);
         //Callback methods
         public void setEntityContext(EntityContext ec) {}
         public void unsetEntityContext() {}
         public void ejbLoad() {}
         public void ejbStore() {}
         public void ejbActivate() {}
         public void ejbPassivate() {}
         public void ejbRemove() throws RemoveException  {}
    }I get the following error from MYSQL:
    22:57:10,203 : JOnASVisitorCommentEJBBean.ejbPostCreate : Failed to create bean:
    java.sql.SQLException: General error,  message from server: "Column 'DB_ESTABLISHMENT_ID' cannot be null"
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1626)
            at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:886)
            at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:945)
            at com.mysql.jdbc.Connection.execSQL(Connection.java:1844)
            at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1602)
            at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1488)
            at jorm.rdb.mysql.VisitorsCommentBinding.insertVISITORS_COMMENTSTable(VisitorsCommentBinding.java:558)
            at jorm.rdb.mysql.VisitorsCommentBinding.write(VisitorsCommentBinding.java:147)
            at com.softwareag.test_guide.visitorCommentEJB.JOnASVisitorCommentEJBBean.ejbPostCreate(JOnASVisitorCommentEJBBean.java:283)
            at com.softwareag.test_guide.visitorCommentEJB.JOnASVisitorCommentEJBLocalHome.create(JOnASVisitorCommentEJBLocalHome.java:76)
            at com.softwareag.test_guide.establishmentEJB.PGEstablishmentBean.addComment(PGEstablishmentBean.java:71)
            at com.softwareag.test_guide.establishmentEJB.JOnASEstablishmentEJBLocal.addComment(JOnASEstablishmentEJBLocal.java:170)
            at com.softwareag.test_guide.sessionFacadeEJB.PGSessionFacadeBean.addComment(PGSessionFacadeBean.java:80)
            at com.softwareag.test_guide.sessionFacadeEJB.JOnASPGSessionFacadeEJBLocal.addComment(JOnASPGSessionFacadeEJBLocal.java:168)
            at com.softwareag.test_guide.web.temp.PGBusinessDelegate.addComment(PGBusinessDelegate.java:93)
            at com.softwareag.test_guide.web.temp.PGCommentsManagedBean.addCommentAction(PGCommentsManagedBean.java:13)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
            at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
            at javax.faces.component.UICommand.broadcast(UICommand.java:312)
            at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
            at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)
            at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
            at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
            at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
            at sun.reflect.GeneratedMethodAccessor208.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:241)
            at java.security.AccessController.doPrivileged(Native Method)
            at javax.security.auth.Subject.doAsPrivileged(Subject.java:499)
            at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:263)
            at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:157)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
            at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:50)
            at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:140)
            at java.security.AccessController.doPrivileged(Native Method)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:136)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
            at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702)
            at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
            at java.lang.Thread.run(Thread.java:536)
    22:57:10,203 : JFactory.postInvoke : system exception in business method:
    javax.ejb.EJBException: Failed to create bean: General error,  message from server: "Column 'DB_ESTABLISHMENT_ID' cannot be null"
            at com.softwareag.test_guide.visitorCommentEJB.JOnASVisitorCommentEJBBean.ejbPostCreate(JOnASVisitorCommentEJBBean.java:288)
            at com.softwareag.test_guide.visitorCommentEJB.JOnASVisitorCommentEJBLocalHome.create(JOnASVisitorCommentEJBLocalHome.java:76)
            at com.softwareag.test_guide.establishmentEJB.PGEstablishmentBean.addComment(PGEstablishmentBean.java:71)
            at com.softwareag.test_guide.establishmentEJB.JOnASEstablishmentEJBLocal.addComment(JOnASEstablishmentEJBLocal.java:170)
            at com.softwareag.test_guide.sessionFacadeEJB.PGSessionFacadeBean.addComment(PGSessionFacadeBean.java:80)
            at com.softwareag.test_guide.sessionFacadeEJB.JOnASPGSessionFacadeEJBLocal.addComment(JOnASPGSessionFacadeEJBLocal.java:168)
            at com.softwareag.test_guide.web.temp.PGBusinessDelegate.addComment(PGBusinessDelegate.java:93)
            at com.softwareag.test_guide.web.temp.PGCommentsManagedBean.addCommentAction(PGComments                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              

    Thanks all for replying,
    The error occurs when I run the client and not at deploy time. Here is the client code:
         public void addComment(Integer primaryKey, String comment) {
              System.out.println("primaryKey------>" + primaryKey);
              try {
                   PGEstablishmentLocalHome establishmentHome = (PGEstablishmentLocalHome) PGServiceLocator.getInstance().getLocalHome("PGEstablishmentHome_L");
                   PGEstablishmentLocal establishmentLocal = establishmentHome.findByPrimaryKey(primaryKey);
                   establishmentLocal.addComment(primaryKey,comment);
              } catch (PGServiceLocatorException e) {
                   e.printStackTrace();
              } catch (FinderException e) {
                   e.printStackTrace();
    u haven't defined the PK entry in the Establishment EJB Bean in DDYes look in the standard DD.
    What's more I need both DD as I would with most ejb containers.
    The field DB_ESTABLISHMENT_ID is required and I cannot set it to NULL.
    Any other help greatly appreciated.
    Julien Martin.

  • Need help with string field formula

    Post Author: dshallah
    CA Forum: Formula
    What I am trying to accomplish:
    The report has item numbers and each item number has the
    potential to be associated with up to three u2018binsu2019. So the fields are u2018item
    numberu2019, u2018bin1, u2018bin2u2019 and u2018bin3u2019.
    I tried to write a u2018if thenu2019 statement that would only show
    records that had a value of less than 1 in each u2018binu2019 field. When I try to
    write the statement I get a message that says u2018A string is required hereu2019 and
    it highlights the number 1 in my statement. I have a feeling itu2019s because the u2018binu2019
    fields are string fields and not number fieldsu2026? So I am not sure the proper
    procedure to correct this. Thus help is needed and appreciated.
    Here is what I wrote:
    if {IC_LOC_HIST.BIN_NAME_1} < 1 then
    {IC_LOC_HIST.BIN_NAME_1}
    What is correct way to write a statement that will show me
    the zero values in each column of bin fields?
    Thanks!

    Post Author: bettername
    CA Forum: Formula
    You must have a non-numeric value in there somewhere - up in the top left of the formula editor window, it'll show you the variables you've passed to the formula, which should help track down what's going on.
    You could try and check that the value is a number first by using something like:
    if isnull({IC_LOC_HIST.BIN_NAME_1}) = false and isnumeric({IC_LOC_HIST.BIN_NAME_1}) = false and then "Error - Should be a Number!"
    else
    if isnumeric({IC_LOC_HIST.BIN_NAME_1}) = true and tonumber({IC_LOC_HIST.BIN_NAME_1})<1 then {IC_LOC_HIST.BIN_NAME_1})

  • Need help with disabling fields or hiding rows based on previous field

    Hi,
    I have a report in a region.
    The report has five columns:
    Animal type_ Health Issues* Angel Grant Requested?* Granted?* Grant Response Date*
    Dog Fleas Yes Yes 02/04/2009
    Cat Fleas No
    The first time the screen is displayed only the Animal type_ Health Issues* Angel Grant Requested?* columns will appear.
    The user will make a selection for 'Angel Grant Requested' from the LOV ('YES', 'NO') and then click on the 'Submit' button.
    When the screen returns 'Angel Grant Requested?' will be grayed out so the user cannot change the selection. The user will make a selection for 'Granted?' using LOV ('YES, 'NO') and for 'Grant Response Date' using the calendar.
    {color:#ff0000}{color:#0000ff}Here is what I want to do...
    If the user selects 'NO' for 'Angel Grant Requested?' then I would like to do one of the following (which ever one is easiest to do) when the screen returns:
    1. Disable (gray out) the 'Granted?' and 'Grant Response Date' fields on the screen for the rows that have 'NO' for 'Angel Grant Requested?'
    so that the user cannot make any selection, AND update the HEALTH_ISSUES table to
    set grant_granted = 'N/A'
    grant_response_date = sysdate
    WHERE animal_issue_type_id = AI_ID;
    2. Do not display the rows that have 'NO' for 'Angel Grant Requested?'
    {color}
    Can you please provide code samples to do this?
    {color:#ff0000}*I tried to use javascript to gray out the columns, the problem I have is with the hidden f02 column (Angel Grant Requested) that I created on the report so that javascript could read the value. columns are being disabled as desired but the database table is not updating properly...*
    {color:#ff0000}*For the rows where the user selected 'YES' for 'Angel Grant Requested?' we need to update the table with the 'Granted?' and 'Grant Response Date' values. These values are somehow being put on the row where the user selected 'NO' for 'Angel Grant Requested?'.*
    This happens in the UPDATE_ISSUES PL/SQL after When :P6_DSP_REQUESTED = 'DSPGRANTED'{color}
    Below is the Javascript function that is in HTML HEADER:_
    &lt;/script&gt;
    &lt;script language="JavaScript1.1" type="text/javascript"&gt;
    function checkAngelGrant()
    var col2=document.forms[0].f02; /* angel grant requested */
    var col3=document.forms[0].f03; /* angel grant granted */
    var col4=document.forms[0].f04; /* grant response date */
    for (i=0;i&lt;col2.length;i++)
    var col2Check = col2+.value; /* read the hidden angel grant requested field */+
    +/* checks the hidden angel grant requested field+
    if no then we need to disable the angel grant granted field and the angel response date field.
    if (col2Check == 'NO')
    +{+
    col3.disabled=true; /* angel grant granted (Yes No) */
    col4.disabled=true; /* angel response date
    Below is the UPDATEISSUES PL/SQL process that is run on After Submit:_*
    DECLARE
    ai_id NUMBER;
    vgrant_requested VARCHAR2(3);
    vgrant_grnted VARCHAR2(3);
    vgrant_respdate DATE;
    f01 = Animal Issue Type ID
    f02 = grant requested ('YES','NO')
    F03 = grant granted ('YES','NO')
    F04 = grant response date
    P6_DSP_REQUESTED = DSPGRANTED display region with grant_granted and grant_respdate
    P6_DSP_REQUESTED = DSPREQUESTED display region with grant_requested only
    P6_DSP_REQUESTED = BIFNOCHG cannot change any of the fields that have already been set
    BEGIN
    IF :P6_DSP_BEQUESTED = 'DSPREQUESTED' then -- Allow setting of grant_requested value only
    FOR i IN 1..HTMLDB_APPLICATION.G_F01.COUNT LOOP
    ai_id := HTMLDB_APPLICATION.G_F01(i); -- animal_issue_type_id This is hidden
    vgrant_requested := HTMLDB_APPLICATION.G_F02(i); -- grant_requested (YES or NO)
    UPDATE HEALTH_ISSUE_TYPES
    SET grant_requested = vgrant_requested
    WHERE animal_issue_type_id = AI_ID;
    COMMIT;
    END LOOP;
    elsif :P6_DSP_REQUESTED = 'DSPGRANTED' then -- grant_granted and grant_response_date
    FOR i IN 1..HTMLDB_APPLICATION.G_F01.COUNT LOOP
    ai_id := HTMLDB_APPLICATION.G_F01(i); -- animal_issue_type_id This is hidden
    vgrant_grnted := HTMLDB_APPLICATION.G_F02(i); -- grant_granted (YES or NO)
    vgrant_respdate := to_date(HTMLDB_APPLICATION.G_F03(i),'MM/DD/YYYY');
    UPDATE HEALTH_ISSUE_TYPES
    SET grant_granted = vgrant_grnted,
    grant_response_date = vgrant_respdate
    WHERE animal_issue_type_id = AI_ID;
    COMMIT;
    END LOOP;
    end if;
    END;

    It's actually three reports that get run during different stages of the screen.
    When the user first enters the screen the data is populated from the REQUESTED REPORT sql:
    SELECT hit.animal_issue_type_id, at.animal_type_desc, it.issue_type_desc, hit.grant_requested
    FROM health_issue_types hit, animal_types at,issue_types it
    WHERE hit.animal_type_id = at.animal_type_id
    AND hit.issue_type_id = it.issue_type_id
    AND hit.file_no = :P6_FILE_NO;
    The user will make a selection from the LOV select list (Yes, No) for the grant_requested field and then click on the Submit button.
    {color:#ff0000}*If the user selects 'NO' for this field then I want to disable the grant_granted and grant_response_date fields when the screen is populated from the ISSUES REPORT sql. If this cannot be easily done then I would like to hide the entire row when 'NO' has been selected for the grant_requested field.*{color}
    When the screen returns the data is populated from the ISSUES REPORT sql:
    ISSUES REPORT
    SELECT hit.animal_issue_type_id, at.animal_type_desc, it.issue_type_desc, hit.grant_requested,
    hit.grant_granted, hit.grant_response_date
    FROM health_issue_types hit, animal_types at,issue_types it
    WHERE hit.animal_type_id = at.animal_type_id
    AND hit.issue_type_id = it.issue_type_id
    AND hit.file_no = :P6_FILE_NO;
    At this point the grant_requested field will no longer be available for user modification. The user will make a selection from the LOV select list (Yes, No) for the grant_granted, and the grant_response_date fields and then click on the Submit button again.
    When the screen returns the data is populated from the ANIMAL DISPLAY ONLY REPORT sql:
    ANIMAL DISPLAY ONLY REPORT
    SELECT hit.animal_issue_type_id, at.animal_type_desc, it.issue_type_desc, hit.grant_requested,
    hit.grant_granted, hit.grant_response_date
    FROM health_issue_types hit, animal_types at, issue_types it
    WHERE hit.animal_type_id = at.animal_type_id
    AND hit.issue_type_id = it.issue_type_id
    AND hit.file_no = :P6_FILE_NO;
    At this point the grant_requested, grant_granted, and grant_response_date fields will no longer be available for user modification.
    {color:#0000ff}Thank you for taking the time to look at my problem.{color}

  • Hi..I need help with an application in Adobe Illustrator..can you help me?

    I just want to type something in Adobe Illustrator and rastersize the image so I can upload onto a transfer designing site to have a transfer made of the image. How do I do that?

    I'm not sure what your skill level is, so please forgive these instructions if they are too simplistic.
    1) Type some text using the Type tool, highlighted in the image below:
    2) Go to File > Export.
    3) And, like Steve said, select the file format the transfer designing site indicates.
    Please let us know if you need any more help.

Maybe you are looking for

  • HP Photosmart Premium all-in-one C310a printer, Solution Center will not stay installed.

    It seems lately, past month or so, that the HP Solution Center keeps failing and needs to be reinstalled.  I get a message which says:" HP Solution Center cannot run because your device installation is not complete." followed by a list of steps to ta

  • First Mac Purchase - iMac i3 - Please Advise

    Hello, I am very close to purchasing my first ever Mac, but I am unsure of which direction to take. I am debating between the iMac i3 - 21.5 inch base model with 8gb of ram, or the next model up. I know that the hard drive is double, the processor is

  • BC4J Passivation error

    Hi all, Apologies if this is the second time round; first time didn't appear to post. I'm trying to get a BC4J app working. I'm using a brand-spankin' new 9.0.2.822 JDeveloper connecting to a less-than-new 8.1.7 database. To test, I'm just trying to

  • How to add stop button in this code AS3

    Hello, im new to this adobe flash AS3. i want to create a simple play sound using flash + XML file for wbesite., this is my code all this code are working greate.. but i have the problem to add stop_btn code my playlist button already have pause, pre

  • Help! Two hard drives sharing music on one player issue...

    Hi! I have media on both ext. hard drive and my laptop - I want to gradually delete all duplicate media saved on my laptop (so that all my music is playing from my ext. drive) - but i can't see where my music is saved unless I go into each file indiv