Filling of transient fields based on VO

I have a VO that stores the start date and duration (months). I need to have 2 transient fields.

One to view the end date, based on the start date and duration.

One is to display the status. If the current date is after the end date, display closed. Otherwise, displays Open.

For example. Start date = 16/12/2016, duration = 1. End date must be 16/01/2016 and the status is open.

There is an expression that I can use?

Hello

You can do this by using groovy.

But I will propose you to make class rowImpl of the viewObject and write your logic in the Get accessor of the temporary variable. There, you can use your java code to calculate and your don't need to write a grrovy...

Thank you

Aman J

Tags: Java

Similar Questions

  • How to fill two text fields based on a simple drop down list

    I'm trying to set up a form so that the two text fields will fill with a text by default (separate for each text field) at the same time.

    Here is a screenshot of the fields.

    Thus, for example, if I select Utah in the drop-down list in 'State', ' OH Fund Center "is automatically filled in with APWSWR4949 and"OH WBS"is automatically filled in with WR49.73.0003.

    I have a similar script for down text in form fields, but the script does not work.  I tried the following script:

    var v1 = this.getField("RecState").valueAsString;

    If (v1 == "Utah") event.value = APWSWR4949;

    else event.value = "";

    However, it would not AutoFill OH Fund Center area.  And I have no idea how complete both fields at the same time.

    Any help would be greatly appreciated.

    Thank you!

    Crystal

    Strings must be enclosed in quotation marks. So change your code:

    var v1 = this.getField("RecState").valueAsString;
    if (v1=="Utah") event.value = "APWSWR4949";
    else event.value = "";
    

    If it works, then you can use code similar to your other field.

  • Fill in the field based on the entrance to the previous field

    So it's probably a very simple question, but I tried for hours to make it work.  I have a pretty long form I'm trying to get data from the beginning to a field on a page more later.  I have a digital field of the user has entered in a subform on the first page.  Then I have a place in a subform more later (actually a set of completely different pages) I want, filled with information from the user to input on this first page.  I don't have the calculations, I want just this original information to appear in several places.  I tried to rename the second field identical to the first, but that doesn't seem to work.  Any help would be appreciated.

    Hello

    There is a simple solution.

    Select the object on the first page and go to object > range of liaison. Linking the Global value.

    Then set the name of all the other objects that need to display the same information and change their NAME to match the object on the first page.

    The overall binding means that everything that is typed in one of the objects will be instantly updated in all others. And no script not involved.

    Hope that helps,

    Niall

  • Fill in the field based on the data entered in another field

    I'm working on a document that will have benefits at levels above prices. In the column below, there are individual fields for each of the services options. The cost of participation for these options will depend on what the monthly dues, which is the value entered in the upper part.

    Assuming that my range of monthly dues are $ 100, $125 and $150, I'm looking for a script that I can customize for each subsequent field that would, I'm assuming that do the following:

    • Get the value of the primary field "PlanBenefit01":
      • If the PlanBenefit01 value is "$ 100" enter "XXX"
      • If the PlanBenefit01 value is "$ 125" enter "YYY"
      • If the PlanBenefit01 value is "$ 150" enter "ZZZ"

    I guess it must be entered in the "properties > compute > custom calculation Script" as a recent alternative was the article for the field. If Yes please confirm. If not, kindly provide me with advice on where you want to insert this?

    Thanks again to everyone.

    Assuming they are actually numbers, without the symbol "$", you can use this code as the custom of your domain calculation script:

    var plan = Number(this.getField("PlanBenefit01").value);
    if (plan==100) event.value = "XXX";
    else if (plan==125) event.value = "YYY";
    else if (plan==150) event.value = "ZZZ";
    else event.value = "";
    
  • What trigger would be required to fill in a field based on another field

    Hi all

    I have a tabular presentation that displays the identification number once I run a query

    Now, I want to display a name for this id and sound of another table. is there a post trigger that can do this?

    Thank you

    Hello

    You can use a post on block-level REQUEST.

    -Clément

  • Error using groovy to fill the transient attribute

    Hello

    I wrote this function in my custom extension of ViewObjectImpl
        public String getRecordStatusDesc(oracle.jbo.domain.Number status) {
            if (status.equals(-1)) {
                return "New";
            } else if (status.equals(0)) {
                return "OK";
            } else {
                return "Unknown";
            }
        }
    And I want to use it to fill a transient field in my display object. I use this code as the groovy expression
    adf.object.getRecordStatusDesc(OpStatus)
    The RS of the attribute is defined as oracle.jbo.domain.Number, as shown in this excerpt of the file XML of the entity object depends on the view object
      <Attribute
        Name="OpStatus"
        IsNotNull="true"
        Precision="1"
        Scale="0"
        ColumnName="OP_STATUS"
        SQLType="NUMERIC"
        Type="oracle.jbo.domain.Number"
        ColumnType="NUMBER"
        TableName="OPERATIONS">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="22"/>
        </DesignTime>
        <Data>
          <Property
            Name="ID"
            Value="390789de-0123-1000-8158-c0a8380116d6::::EntityObjectAttribute"/>
        </Data>
      </Attribute>
    But when I run with the tester of business components, I get this error
    (oracle.jbo.JboException) JBO-29000: Unexpected exception caught: groovy.lang.MissingMethodException, msg=No signature of method: 
    com.test.extensions.TestViewRowImpl.getRecordStatusDesc() is applicable for argument types: (java.lang.Long) values: [-1]
    Can someone tell me what I am doing wrong? I use 11g r1

    Hello

    ADF. Object returns the instance of ViewObjectRowImpl not an instance of viewobjectImpl, try using viewObject

    Sample:

    ((CustomViewObjectImpl) viewObject) .getRecordStatusDesc (OpStatus)

    Jean Lou

  • Auto-fill text box values field based on the selection of the menu drop-down

    Try to fill in address, city, province, zip from text fields based on the selected option in a select form field. The following code works fine in Internet Explorer, but in Chrome or Firefox, after selection, text, the fields are filled with the word "undefined."

    I found a PHP script Jquery here version that would probabably do the trick.
    http://StackOverflow.com/questions/3657127/jQuery-populate-text-input-from-table-based-on-select-Valeur

    Maybe someone has a version of CF. they could share?

    Thanks in advance to anyone who can point me to a solution for this code, or a better way to fulfill my need.

    <!--> destinations with address auto-fill, city, etc.
    < script type = "text/javascript" >
    function selectAddress (list) {}
    take the first element is empty
    If (list.selectedIndex > 0) {}
    var locationID = list.options [list.selectedIndex] .value;
    locationAddress var = list.options [list.selectedIndex] .locationAddress;
    var locationCity = list.options [list.selectedIndex] .locationCity;
    var locationState = list.options [list.selectedIndex] .locationState;
    var locationZip = list.options [list.selectedIndex] .locationZip;
    document.getElementById('locationID').value = locationID;
    document.getElementById('locationAddress').value = locationAddress;
    document.getElementById('locationCity').value = locationCity;
    document.getElementById('locationState').value = locationState;
    document.getElementById('locationZip').value = locationZip;
    }
    }
    < /script >
    < b >
    < td align = 'right' bgcolor = "#FFFFFF" valign = "top" > Destination name < table >
    < td align = "left" bgcolor = "#FFFFFF" valign = "top" >
    < select name = "locationID" onChange = "selectAddress (this)" class = "smallforms" > "
    < option value = "" > SELECT the DESTINATION ››› < / option >
    < cfoutput query = "allLocations" >
    "" < option value = "" #locationName # "locationAddress =" #allLocations.locationAddress # "locationCity =" "#allLocations.locationCity #" locationState = "#allLocations.locationState #" locationZip = "#allLocations.locationZip #" > #locationName # < / option >
    < / cfoutput >
    < / select >

    Others: cfinput name = "destinationNameOther" type = "text" class = "smallforms" size = "75" >
    < br / >
    < input id = "locationID" name = "locationID" type = "hidden" > < br >

    Address: < input class = "smallforms" id = "locationAddress" name = "locationAddress" type = "text" size = "30" >
    City: < input class = "smallforms" id = "locationCity" name = "locationCity" type = "text" size = "20" >
    State: < input class = "smallforms" id = "locationState" name = "locationState" type = "text" size = "2" >
    Postal code: < input class = "smallforms" id = "locationZip" name = "locationZip" type = "text" size = "8" > < br / >
    < br / >
    < table > < /tr >

    In your last code done selectAddress refers to "index" but I'm not declared or assigned. I think that you are missing 'var index = list.selectedIndex;' statement.

  • How the auto fill a field based on the drop-down list unless the specific item is selected

    Hi all

    My apologies if I posted this in in the wrong place, but I am new to these forums, JavaScript and Adobe LiveCycle.

    I am trying to build a form using LiveCycle Acrobat but have problems with the drop-down lists.

    Inititaly I just wanted to fill in the fields in a table based on a matching menu selection dropdown in another table.

    I used the following code and it worked fine:

    Workbook.Content.Table1.Row3.AppropriationDetails.Row4.Cell1::change - (JavaScript, client)

    fFrom var = xfa.resolveNodes ("Workbook.Content.Table1.Row3.AppropriationDetails [*]. Row4.cell1');

    OTF var = xfa.resolveNodes ("Workbook.Content.Table2.Row3.AppropriationDetails [*]. Row4.cell1");

    for (var i = 0; i < = fFrom.length - 1; i ++) {}

    fTo.item (i) .rawValue = fFrom.item (i) .boundItem (xfa.event.newText);

    }

    The problem is that now I want the code above works UNLESS one of the items in the drop-down list is enabled specifically in this case, I want the text box in the other table to display a message such as "Details of the entry in the field below.

    I tried to create an If Else statement using the following code:

    Workbook.Content.Table1.Row3.AppropriationDetails.Row4.Cell1::change - (JavaScript, client)

    fFrom var = xfa.resolveNodes ("Workbook.Content.Table1.Row3.AppropriationDetails [*]. Row4.cell1');

    OTF var = xfa.resolveNodes ("Workbook.Content.Table2.Row3.AppropriationDetails [*]. Row4.cell1");

    for (var i = 0; i < = fFrom.length - 1; i ++) {}

    If (fFrom.item (i) .rawvalue = "Option 3") {}

    fTo.item (i) .rawValue = "enter the details in the field below.

    }

    else {}

    fTo.item (i) .rawValue = fFrom.item (i) .boundItem (xfa.event.newText);

    }

    }

    The code now filled the field with "Enter the details in the field below" any item I select in the drop-down list.

    Your help is greatly appreciated.

    See you soon,.

    ozzy_q

    Hello

    You use .rawValue in the change event. This will cause problems because the selection of the users has not received .rawValue from the drop-down list at the time when the change event is triggered.

    Move your script as it should to the output of the dropdown event.

    Hope that helps,

    Niall

  • Fill in the multiple fields based on the checkbox

    (other questions newb...)

    You want to fill several form fields from or not a checkbox is enabled.

    I now using scripts calculated in the work field. for example:

    If (this.getField("checkbox").value == "Off") {}

    Event.Value = null;

    } else {}

    Event.Value = "ABCXYZ";

    }

    However, it is possible to assign values only from the field box itself?

    Yes, you can do so from the MouseUp event of the checkbox field. It will look something like this:

    if (event.target.value=="Off") {
        this.getField("Text1").value = "";
        this.getField("Text2").value = "":
    } else {
        this.getField("Text1").value = "ABCXYZ";
        this.getField("Text2").value = "123456":
    }
    
  • Auto-fill form fields based on the input from the end user?

    I am currently trying to create a new form that has a combo box 'Locations' with various options.  What I want to do, is to have another car to text field to fill out other fields associated with this location (for example, address, contact information) to save on time and reduce the possibility for the end user input errors.

    What are my options to accomplish such a task?  A form of bonding in the fields with a database of MS maybe?

    Thanks in advance for all advice and assistance on this subject!

    I created a sample for you... are a look and let me know if this is the case for you.

    Paul

  • Hide/show the fields based on textbox

    I wonder if there is a way to hide certain fields based on the question of if a user enters a value in a text box and then reappear if the value in the text box is removed and the field becomes white.

    I have two scenarios where I would this happen

    1. I have a "Non-registered" check box and a text field 'blood pressure '. If the user check mark the box "Not registered", the field of blood pressure is hidden (I managed this already). If the user unclicks the box, the field of blood pressure again (even once, I did already). Otherwise, if the user enters a value in the 'pressure' I would 'Unregistered' area to disappear. I got this as well with this code: (placed in the form of javascript Action, mouse upward, event)

    this.getField("Not_Recorded").display = event.target.value = "Off"? Display.visible: display.hidden;

    I don't know if it's the appropriate script that I use, but he did not hide the field "unregistered". The problem is, I would 'not registered' to hide if a value is entered in the field of blood pressure and reappear if this value is then removed (i.e., the user changes his mind or made a mistake and wants to not click saved instead). I don't know if it's feasible or just way too complicated for me to do.

    2. in the second scenario, I have 2 text fields where the user must enter a value for weight in pounds or kilograms. There is a text box for a value of lbs and a text box for a value in kg. If the user enters a value for books, I'd like to field for kgs be hidden, but still, if they delete this value so that the lbs field becomes empty, I would field for kgs reappear.

    is this feasible or is there another way I might be able to do this?

    For the first, I would not hide the check box for the reason you give. In addition to hide the text field, it must reset it so that any value that the user may have entered is not retained when it is hidden.

    If you really want to show/hide the check box depending on whether there is an entry in the text field, you can use the validation script customized for the text field:

    var f is getField ("unregistered");.

    If (! event.value) {}

    f.Display = display.visible;

    } else {}

    f.Value = "Off";

    f.Display = display.hidden;

    }

    For this script start working, you change the value in the text field.

    For the second problem, what I do, is to have a single text field and two boxes to tick to indicate lbs or kg. If you want to stay with the configuration you have, you can clear the other text field with a custom validation script:

    Script for weight_lbs custom validate field

    If (event.value) getField("weight_kgs").value = "";

    Do the same for the other text field, but change the domain name in the script. This will allow only one field to be filled at the same time and do not bother with the masking.

  • How to make Player Mobile (IOS/Android) to fill the shape cells based on the entry in the other cell?

    Hi, is there a way to make Acrobat Reader Mobile (Android/IOS) to fill the shape cells based on entry into another cell?

    I did a time sheet were based on a code entry activity in a description drop-down list box that matches the activity code is displayed automatically in another cell. (see below)

    This works perfectly as long as I'm on a PC, however, does not work on any phone. (I guess that this feature is not yet supported on Acrobat Mobile)

    My question is if anyone can suggest an alternative method for characteristic mentioned that also works on phones?

    Any suggestion would be appreciated

    In the Format field:

    If (Event.willCommit)

    {

    Console.println (Event.value);

    Switch (Event.value)

    {

    case ' 1 01 ":

    this.getField("REMARK1").value = "unloading".

    break;

    case "2 01":

    this.getField("REMARK1").value = "preparing."

    break;

    .

    .

    .

    case "19 44":

    this.getField("REMARK1").value = 'Support-3rd part insp/contract.';

    break;   case "": ""

    this.getField("REMARK1").value = "";

    break;

    }

    }

    Sincerely: Robert

    Try to get rid of this console.println statement. If this does not help, it should work if you convert that from a script from the drop-down list format in a calculation of the field REMARK1 script.

  • Make the text visible/invisible field based on the menu drop-down

    I currently have a form that automatically calculates dates based on the value in particular the "Text10" field with the current script of

    Custom calculate script for the field 'date '.

    (function () {}

    Get the date in the field

    var v = getField("Text10").valueAsString;

    Convert string to date

    var d = util.scand ("mm/dd/yyyy", v);

    Add 30 days

    d.setDate (d.getDate () + 31);

    Fill in this field with the result

    If {(v)

    Event.Value = util.printd ("mm/dd/yyyy", d);

    } else {}

    Event.Value = "";

    }

    })();

    I want to thank this option to hide the field if one selects a particular value in a drop-down list. Allows to call the drop "decline.1" and values are just 'Yes' and «» Yes makes visible, hide it.

    Is this possible? I looked through the forums and can't seem to find a solution. I use Adobe Acrobat X Pro

    Thank you

    Yes, it is possible. Just add the following line, this isn't little matter so long it after the first year and before the last:

    Event.Target.Display = getField("drop1").value = 'no '? Display.Hidden: display.visible;

  • Fill in the fields on the customer side dynamically without the reader extensions

    Hello

    Can I make a call to the server of a pdf form using Ajax technology? I want to fill some textfields dynamically on the client side based on a user selection. I have not the license extension drive still make a web service call to the server. Is there another way to achieve the desired requirement?

    Thank you.

    Yes, there is a better way to do it without Reader Extensions.

    AJAX is not an option, because this is not supported by Adobe Reader.

    Here is the solution:

    Write that a REST based web or any Service Server Page that accepts the query string and meets the specified query string.

    Assume that a Page http://myserver.com/EmployeeDetails?EmpId=1234 server returns the details of the employee as comma-separated values.

    This page can be called from PDF using FormCalc

    the syntax is

    ResultField.rawValue = Get ("http://myserver.com/EmployeeDetails?EmpId=1234")

    EmpName.rawValue = ResultField.rawValue.split (",") [1];          Retrieve the name of the emp of result and fill in the field

    Note that if the page or the web service requires authentication, a basic authentication dialog box appears when you call this method.

    In order to better allow anonymous authentication for pages.

    I have implemented this approach in many projects and works very well.

    Hope that helps...

    Nith

  • How to fill in the field on the page with the value of the primary key of the previous page

    I am trying to create a patient monitoring system for a group of doctors. There is a patient form add based on the Patient table (which has Patient_Id as primary key) which branches off toward an preoperative evaluation form. I would like to fill in the field of Patient_Id of pre-surgical assessment with the Patient_Id generated by the page add Patient during treatment, which comes from the Patient_seq sequence. How can I do this? I tried to use a calculation on the pre-operative evaluation form, but no matter what I put, the field remains empty.

    Hello

    If I understand you correctly, once the patient record is created you branching to the next page (preoperative assessment form). First create a static hidden point in the form of patients *: PX_PATIENT_ID_COPY *.

    Create a process on submit after the calculation and validation patient form to get the inserted patient_id of patient table. Here's the code-

    SELECT patient_id into :PX_PATIENT_ID_COPY from patient_table where rownum=1
    
    order by patient_id desc
    

    I would not use the sequence to get the present value, because if the record inserted was removed from your patient table, the current value of the sequence would be invalid to find this record in the patient table.

    Basically when the inserted record, the process of getting the value and put into the hidden element.

    Pass the value of the item hidden on the next page by defining them in the direction of the page. Under the section of the Action in the branch of the page, set this items field type - *: PX_PATIENT_ID * (page the order of the day for patient_id). Type * & PX_PATIENT_ID_COPY.* in the with the field of these values. Make sure that include you the dot (.) after * & PX_PATIENT_ID_COPY *.

    Try it now. Hope that it would help.

    Kind regards

    Djelloul

    Blog: http://aspblog.whitepagesbd.com

    Web: http://tajuddin.whitepagesbd.com

Maybe you are looking for

  • can't see the tabs

    Until recently, I could see tabs in landscape for example I could see several tabs at the same time. Now I have to see them one at a time bt access via the top of the left page number indicated how many tabs are open. It was more convenient be wheat

  • instead of my google search engine usual next to the field address, all of a sudden, I have a wikilpedia research onl windo

    At the top of the screen on a page web I generally had the address in the top field and right, there was always a Google search engine. Now that the window has disappeared and all I have is a significant window of Wikipedia and I can get Wikipedia se

  • Windows does not detect a driver for my network card

    Hello. I am trying to understand what driver should I install for a network card on a HP 2000-219DX laptop. I saw the list of the drivers for it and got the file of the driver Ralink 802.11 b/g/n WiFi Adapter from another PC. I don't know how to inst

  • "The remote call procedure failed" installation ATI graphics driver

    I had problems with the driver for my graphics card (ATI Radeon x 1950) and it was recommended that I have recharge it. When I started to reload the driver, I got an error message when the Setup program has been extracted which said ' Fhurt to run th

  • HP all in a single installation c4780

    I just installed an all in one printer on my pc. I have windows vista Home premium. but the printer does not appear in the list of printers installed any help or advice would be greatly appreciated.