Updating a text field in  aform based on conditions

Hi ,
We are developing a custom form which has a database datablocks.
This form is a master detail form . It has a field called "status" whose initial values is 'Draft' and this field is present in the master part of the form.
The Logic for "Draft" is written in Pre-Insert trigger of the header block.
Question
If condition "A" is met and "B" is met , status should be set as a value called as 'Submitted';
If condition a is not met and B is met , status should be set as a value called as 'Created';
We are doing this in the post-update trigger at block level. But the changes are not taking effect.
Please let us know if this is the correct approach to handle the column. Note that the column "Status" is a database column.
Thanks and Regards
SR

The above is not working
Let me restate the problem statement
Hi ,
We are developing a custom form which has a database datablocks. This form is a master detail form . It has a field called "status" whose initial values is 'Draft' and this field is present in the master part of the form.
The Logic for "Draft" is written in Pre-Insert trigger of the header block.
Question
The record is created with a status of Draft initially.
Query and requery back and if condition is met , the value of status should be updated as follows......Condition A and B involves going an chekcing in some other table and based on that , we set the status column....
If condition "A" is met and "B" is not met , status should be set as a value called as 'Submitted';
If condition "A" is not met and B is met , status should be set as a value called as 'Created';
We are doing this in the post-update trigger at block level. But the changes are not taking effect.
Please let us know if this is the correct approach to handle the column. Note that the column "Status" is a database column.
Also tried the following
1) When validate item at block level by capturing the item in a parameter and then assigning the parameter to the status column in pre-update column . This is not working
Thanks and Regards
SR
----------------------------------

Similar Messages

  • Using external XML document to update / change text fields inside of published captivate output.

    Hello
    I currently have a project where the client has requested to have the ability to update the text fields inside the project at a later date.
    This is due to the nature of the content changing rather rapidly, i would like to set this up so the client can manage this them selfs.
    What would the best way to do this be?
    I'm thinking XML, an external XML sheet were by Captivate imports the text from this XML sheet and then displays it within the specific text fields contained within the captivate output.
    This way the client would just update the external XML document(cut and paste the text in) and then the text would be dynamically updated in the published Captivate document.
    any help would be amazing !
    Thanks in advance
    Nick

    Hi Lieve
    But isn't this thread more about an end user having an ability to change text after the Captivate has been published and delivered? I could see where that might be useful if making changes then publishing to create a new output. But I'm interpreting that the situation here is that a Captivate project has been published and delivered, and some mechanism is desired that allows the recipient to modify an external XML file to influence changes in the already compiled Captivate output.
    Cheers... Rick

  • Update a text field based on a SelectOneChoice field

    Hi,
    I have a set of Create, Confirm and Thankyou screens. These screens are bound to a global view object. The create screen has a SelectOneChoice element which allows the user to pick an employee. When the selection is made, I need to display the employee's department in a read only text field below the dropdown. The Employees list(SelectOneChoice) is associated to the read only view object and this view object also has the employee's department information. Im dont know how to set the department name in the text field and refresh the screen. Any help is appreciated. Thank You.

    Frank, thanks for you time. Please see my answers below.
    Hi,
    can you help me creating a reproducable testcase
    based on the HR schema where we have a Departments
    and Employees tables. To understand your usecase I
    have some questions:
    Im not too familiar with HR Schema.
    >
    First of all however, what is a "global view object",
    and is it safe to assume you are using ADF Business
    Components?
    Its the "Globals View Object" as described in the SRDemo for creating a new Service Request and yes I am using ADF Business Components.
    >
    Which version of Oracle JDeveloper do you use ?
    10.1.3
    >
    The usecase I understand is that you have a
    selectOneChoiceList that whenever you select a new
    name should update a read-only text field with the
    department name. Is this correct ? Or is there more
    in it ?
    Heres the complete description. There are 4 fields on the screen
    1. Program Name (text input field, - required field)
    2. Program Category (SelectOneChoice field - required field)
    3. Employee Name (SelectOneChoice field - required field)
    4. Employee Department (Text output field - based on 3 above)
    What you have described above is working for me now, but everytime I select a value for 3, it does the required fields check and gives a message like "1 & 2 are required and a value must be entered", this validation should only occur when my continue button is clicked.
    >
    The department name should be displayed only (read
    only), or is it also bound to what you call "global
    view"?
    Yes its read only but I need to bind to the Globals view as I need to display it in the confirmation screen.
    >
    Also, just to be sure, is the department name part of
    the VO or is it the departmentId?
    The screen is bound to the Globals View, the selectOneChoice values are displayed from another view(EmployeeList view) which has the department name.
    >
    Frank

  • Trying to retrieve content from a text field & use it in a conditional statement

    Hi Everyone,
    I have a form with a text field and a button. The  text field is called "orderNo", and the button is called "genOrder".
    Initially  the text field is empty, and clicking on the button fills the text  field with an appropriate order number.
    I need to check the text  field for data (content) before writing the order number to it, this  way if an order number is already present in the text field it will not  be over written.
    My intention is to use an if / else structure to  perform the testing, however I don't know how to retrieve the content  of the text field (if content is present!).
    If anybody can  suggest how I can go about retrieving the content of the text field and  then use it in an if / else statement it will be greatly appreciated.
    Kind  Regards,
    Davo

    Hi try67,
    Thanks for your assistance. I have posted in this http://www.acrobatusers.com/forums/aucbb/viewtopic.php?pid=70276#p70276 forum asking for further assistance if your able to help more.
    Once again thanks for your time.
    Cheers
    Davo

  • Make fields un-editable based on condition in Relationship tab of ACCOUNTS

    Hi Friends,
    Iam working in CRM 5.0. Application: ZCRMMACCOUNT           View: Z*ACC
    I want to make the fields in the relationship tab of Accounts application to read only based on some condition (when the relationship is contact person).
    I have tried all the ways:
    1. In the READ method of Access Class, set the field property as 'A' in the et_field_attribute.
    2. Use the method set_field_attr of class cl_bsp_bp_global_service.
    But still the fields are in the editable mode. And here i cant use the Field Group Customization, because i want to make the fields read only based on some condition. I tried using field group variants, but while debugging, the method GET_FIELDGROUP_VARIANT is not called.
    Can you please suggest me your ideas and how to work with this?
    Regard,
    Raju

    Dear Raju,
    I am new to CRM, if i am wrong in explaing the things dont consider it.
    We to had the almost the same requirement then we went to the field groups level and chekced the following field groups and changed them to display only feature by checking the box in the field groups....
    ADR_DETAIL_COMM_DATA
    ADR_DETAIL_COMM_DATA_CAM1
    and generated the layout for the following parent field groups....
    ADR_DETAIL_COMM_ALL
    ADR_DETAIL
    BUP_ADR_DETAIL
    ADR_DETAIL_2
    and also check the field groups under the following parent field groups which matches to your requirement...by checking box of the related field group to display mode
    BUP_GENERAL_DATA
    BUP_BUS1006_SRES

  • Using a Document Listener to update a text field

    Hi,
    Background:
    I need to retrieve a number from a card using a hand scanner. I'm currently using a jTextField1 in Netbeans to do this. When the number is input (the format is 6 digits, i.e. 123456) the rest of the form fields are filled in and updated automatically from an oracle database as it should. I have the database being checked as soon as the field reaches 6 characters (doc.getLength() == 6), It all works great.
    Problem:
    The problem comes in when I need to input a card that has a newer, different format of numbers and characters, i.e. **001234567**, it's more than 6 characters. I need only the 123456 substring to update the form, and the 7 substring to input later.
    What I tried:
    I'm using the combination of pattern matching and substring to get the 1234567 part only. I thought of using a hidden field on the form to input the numbers to and then set the text of jTextField1. I'm not sure this would work and seems like a hack anyways.
    Code:
            public void updateLog(DocumentEvent e, String action) {
            Document doc = (Document) e.getDocument();
            Integer docLength = doc.getLength();
            String isCardLegal = jTextField1.getText(); // getting card from textbox
            returnString Del = new returnString();
            String str = Del.getNewNumberFromCard(isCardLegal);
            System.out.println("str: "  +str);
            if (docLength == 6) {
              // see if number exists in database here
    public class returnString {
        public String getNewNumberFromCard(String oldString) {
            Pattern p = Pattern.compile("\\*");
            Matcher m = p.matcher(oldString);
            String newString = m.replaceAll("");
            // takes off leading zeros when using a new card
            // otherwise just returns the string as-is
            if (newString.length() == 9) {
                newString = newString.substring(2);
                return newString;
            } else {
                return newString;
    }Does anyone have a better way to do this? I hope I was clear in my explanation.
    Thank You for your help,
    Alan
    Edited by: shadow_coder on Oct 8, 2009 12:01 PM

    I really thank you for your help, I realize I wasn't clear because I wasn't sure about too many different things. I'll try it again:
    I need to use a hand scanner to input id cards having 2 different character sets. I now realize I can have the scanner insert a carriage return at the end of the scan, so I need to be able to detect this carriage return. I'm using a documentlistener to look at each character in the textfield. The character sets I need to use are 6 characters long, and an 11 character long set (including asterisks).
    Here is my SSCCE:
    import java.awt.FlowLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.JFrame;
    import javax.swing.JTextField;
    import javax.swing.event.DocumentEvent;
    import javax.swing.event.DocumentListener;
    import javax.swing.text.BadLocationException;
    import javax.swing.text.Document;
    public class exampleCase extends JFrame implements ActionListener {
        JTextField textField1;
        public exampleCase() {
            getContentPane().setLayout(new FlowLayout());
            textField1 = new JTextField(15);
            textField1.getDocument().addDocumentListener(new MyDocumentListener());
            textField1.getDocument().putProperty("name", "TextField");
            getContentPane().add(textField1);
            setSize(300, 170);
            setVisible(true);
        public static void main(String argv[]) {
            new exampleCase();
        public void actionPerformed(ActionEvent e) {
            throw new UnsupportedOperationException("Not supported yet.");
        class MyDocumentListener implements DocumentListener {
            public void insertUpdate(DocumentEvent e) {
                updateLog(e, "inserted into ");
            public void removeUpdate(DocumentEvent e) {
                updateLog(e, "removed from ");
            public void changedUpdate(DocumentEvent e) {
                throw new UnsupportedOperationException("Not supported yet.");
            public void updateLog(DocumentEvent e, String action) {
                String newline = "\n";
                Document doc = (Document) e.getDocument();
                int changeLength = e.getLength();
                System.out.println(
                        changeLength  +" character"+
                        ((changeLength == 1) ? " " : "s ")
                        action+  doc.getProperty("name")  +"."+  newline
                        "  Text length = "+  doc.getLength()  +newline);
               try {
                    String docCharacters = doc.getText(0, 2); // Exception when increased
                    System.out.println("Characters are: "+  docCharacters);
                    if (docCharacters.equals("\\r")) { // How to check for carriage return?
                        System.out.println("I'm Here, Yeeaaah!!");
                } catch (BadLocationException ex) {
                   System.out.println("Error Here, bad location" + ex);
    }When I increase the '2' to be able to handle the characters, I get javax.swing.text.BadLocationException: Invalid location can anyone tell me why? I'm not sure why it works when the number is at 2 but not others!
    The other issue is, what is the correct way to detect a carriage return? I was able to test this when the number above was at 2. This doesn't work.

  • How do i get a text field to autopopulate based on responses in two groups of radio buttons

    I am using Adobe Acrobat Pro and am very new to this.
    What I want to achieve:
    I have two sets of radio buttons; one group is "Likelihood" choices and the other group are "Consequence" choices. Based on what the user picks in those two groups, I want the form to auto-populate the risk rating in another field. E.g If the user picks "Insignificant" in the consequence group and "Rare" in the likelihood group; the field titled Risk Rating should display the word "Low". If they pick "Insignificant" and "Almost Certain" the Risk Rating field should display "Moderate". Please let me know if you need further information. Thanks in advance.

    You can use something like this code as the custom calculation script of the risk rating field:
    var consequence = this.getField("Consequence").valueAsString;
    var likelihood = this.getField("Likelihood").valueAsString;
    if (consequence=="Insignificant" && likelihood=="Rare") event.value = "Low";
    else if (consequence=="Insignificant" && likelihood=="Almost Certain") event.value = "Moderate";
    // etc.
    else event.value = "";
    Edit: Fixed small mistake in code.

  • Script To Update Month Text Field?

    Hello SharePoint Fam,
    I am wanting to add a choice field to existing list that contains each month(jan,feb,mar,etc) but was wondering is it possible for me to automate this at all so I don't have to manually change default month value to correct month on the first of each month.
     Basically want the field to be hidden and index it so that I can make a easy filter option for a very big list(60k items) and want it totally invisible to users so all they have to do is load there files and have no idea that a month is being tagged
    to there files.
    Thanks N Advance

    You can use an event receiver (ItemAdded/ItemUpdated) to populate the month field based on any condition (like created date, modified date etc). Or you can also create a Calculated field like (MONTH([Created]).
    Moreover, the field can be set so that it is not visible in forms like NewForm, EditForm, or DisplayForm. Example of setting the field in forms
    SPField.ShowInNewForm = false;
    SPField.ShowInEditForm = false;
    SPField.ShowInDisplayForm = false;
    Blog | SharePoint Learnings CodePlex Tools |
    Export Version History To Excel |
    Autocomplete Lookup Field

  • Auto update of text field on drop down change (binded to XML doc)

    Hi all,
    I have a problem that i'm stuck with since too long and I'll be really grateful for any useful idea.
    Here is my issue:
    I have this XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <ItemsList>
              <Product>
                        <itemUnitPrice>200.00000000</itemUnitPrice>
                        <itemCode>lkg</itemCode>
                        <ItemID>2</ItemID>
                        <itemDescription>lk desc</itemDescription>
              </Product>
              <Product>
                        <itemUnitPrice>300.00000000</itemUnitPrice>
                        <itemCode>lkv</itemCode>
                        <ItemID>1</ItemID>
                        <itemDescription>lkv desc</itemDescription>
              </Product>
              <Product>
                        <itemUnitPrice>400.00000000</itemUnitPrice>
                        <itemCode>lks</itemCode>
                        <ItemID>3</ItemID>
                        <itemDescription>lks desc</itemDescription>
              </Product>
    </ItemsList>
    ItemID and itemCode are bounded to my dd list and the left is bounded to the rest of the columns in my table (below).
    I`d like to find a way to auto change, for example the unit price, of an item selected from the list.
    I have to mention that this xml is returned by a database and data can change so  i can`t write javascript static code to match itemId with their Unitprice and description.
    Any ideas ??
    Thanks in advance.

    Hi,
    yes this is possible.
    Add this script to the change event of your dropw down list.
    Text1.value.text.value = xfa.event.change;

  • Populating Text Fields from XML Based Drop Down

    Hello,
    I'm new to the Adobe Livecycle I have been challenged to make a PDF form that pulls information from an XML file.
    I have been able to get the from to read the XML file and I have successfully created a dynamic pull down, but what I am having a problem with is that when an item is selected in the dropdown I want it to pull other information stored in the XML file.
    <user>
      <csrName>MyName</csrName>
      <csrExt>123</csrExt>
      <csrFax>123-123-1234</csrFax>
    </user>
    <user>
      <csrName>MyName</csrName>
      <csrExt>321</csrExt>
      <csrFax>999-234-1322</csrFax>
    </user>
    My pulldown reads each csrName and I can select whom I want, but how do I get <csrExt> and <csrFax> to pull over for the correct <csrName>? I figured it needs to be done by some code during the "Change Event" but I have not figured out what code is needed.
    Any help is greatly appreciated, if anymore information is needed just let me know and I'll share what I got.
    Thanks
    Derrick

    Thanks for the reply.
    Right now I'm starting with a blank form and once I get my head wrapped around this then I was going to modify what is already in use.
    I'm attaching my scheme and xml file.
    Thanks!
    Derrick
    I get an error when trying to upload my schema. I am pasting the content of the file here. I call it proofout.xsd
    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="userList" type="UserList" />
    <xs:complexType name="User">
      <xs:sequence>
       <xs:element name="csrName" type="xs:string" />
       <xs:element name="csrExt" type="xs:int" />
       <xs:element name="csrFax" type="xs:string" />
       </xs:sequence>
       </xs:complexType>
       <xs:complexType name="UserList">
       <xs:sequence maxOccurs="unbounded">
        <xs:element name="user" type="User" />
        </xs:sequence>
        </xs:complexType>
        </xs:schema>

  • Ability to update a custom text field across multiple projects in a grid type view

    We have a project level custom field for the Project Owner to enter an Executive Level project status.  A project owner will have many projects. Right now the owner has to open each project individually, update the text field and save which can
    take a considerable amount of time. We would like to have the ability to have the project list with the text field in a grid (looks like an excel sheet) with the ability to update the text field directly from the grid.  Is there some way
    to do this?

    Hi,
    Which project version are you using?
    Anyway there is no "excel-like" way to bulk edit proejct field, such as you can do for the resources. The project center is unfortunately a read-only view.
    For PS2010, the
    bulk edit tool allows you bulk editing pronot be "excel-like" meaning updating the value in rows. You'll have to select the project with the same value for the custom field and enter the value once and validate and redo this process for each proejct field
    value.
    Otherwise third-party tools are available on the market for this purpose:
    http://www.senseiprojectsolutions.com/sensei-bulk-update/
    http://www.fluentpro.com/productsfluentbooks2013.html
    Finally you could develop a side-application to achieve this objective.
    Hope this helps,
    Guillaume Rouyre, MBA, MCP, MCTS |

  • Popup LOV updating text field

    Hi
    I have a region on a page with the following fields:
    Popup LOV
    Text Field 1
    Text Field 2
    I need to populate the 2 text fields dependant on the option chosen in the Popup LOV (i.e. whenever the user chooses a value from the popup list, the text fields are populated based on a lookup on a database table using the selected popup value as the item to look up on).
    I have found a similar example on this forum to do this using a select list but nothing for a popup LOV.
    Could anybody help with this please?
    Thanks in advance

    This might help
    http://www.oracle.com/technology/products/database/application_express/howtos/how_to_create_custom_popups.html
    Rene

  • Duplicate a Text Field on Every Page of a Document?

    Today I wrote my first vb.net/adobe app.  I managed to open the pdf doc in adobe and create a named text field.  I managed to insert a java script that gets the current date when the document is open and updates the text field.  I would like to duplicate the text field on all pages of the document.  Manually, I can right click on a text field and select duplicate.  I don't see a property or method that allows me to program this.  The field property "page" appears to be read only.  any help would be appreciated.  thanks.
    page
    The page number or an array of page numbers of a field. If the field has only one appearance in the document, the page property returns an integer representing the 0-based page number of the page on which the field appears. If the field has multiple appearances, it returns an array of integers, each member of which is a 0-based page number of an appearance of the field. The order in which the page numbers appear in the array is determined by the order in which the individual widgets of this field were created (and is unaffected by tab-order). If an appearance of the field is on a hidden template page, page returns a value of -1 for that appearance.
    TypeInteger | ArrayAccessRFieldsallExample 1Determine whether a particular field appears on one page, or more than one page.var f = this.getField("myField");
    if (typeof f.page == "number")
    console.println("This field only occurs once on page " + f.page);
    else
    console.println("This field occurs " + f.page.length + " times);

    I also tried the brute force method of moving from page to page and creating a text field on each page.   I used pageNum to changes the page, but, adobe didn't seem to recognize that.  I saw the page change on the screen, but, all of the textfields were created on the first page!

  • Line item text field from MIGO are not copied into FI line item text field

    Hi all on SCN, please, I need a help.
    It was created as required by the user a field status group with the text field required.
    This field status group was assigned to some accounts, in order to make my unit tests.
    u2003
    In development envirionment was made some tests directly in FI area, and it works properly.
    u2003
    But the user made a test using MIGO transaction, choosing in this transaction an account that he changed its field status variant to the one created in development environment, that make the text fiels required. So, to start, he donu2019t fill the text item of MIGO, and a message error appear stating that he needs to enter values in this field.
    After fill in the text fiels, he can save his work.
    u2003
    But the FI document generated donu2019t receive the line item text typed in MIGO, but receives the values on Reference document and Document Header text entered in the header of MIGO, what is missing, donu2019t is automatically copied MIGO text line items to FI documents line Items, does there is some additional configuration missing?
    Hope someone help me with this issues.
    Thanks in advanced!

    Hi,
    Material document will get updated in reference field in FI by default.  If for any reason, want to get this updated in text field, you need to define a subsititution in GGB1.
    Best Regards,
    Madhu

  • Item level Info record PO text field in Purchase Order Me21n transaction

    Hello All,
    I have to enter some information in the PO info record text field (which is in Item level Texts tab of ME21n transaction ) using an user-exit at the time of creation/change of purchase Order.
    Does anyone knows the user-exit and how to update the text field ?
    Any help is really appreciated
    Thanks
    Ricky

    Check with : Enhancement : MM06E005
    Function module : EXIT_SAPMM06E_017
    This user exit will trigger when you enter the data in item level(Both creation and change)

Maybe you are looking for