• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Drop down on Form field

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Drop down on Form field






    Hello,

    I having an issue with a drop down on my order entry form. It is not positioning the drop down to the correct entry (it is a field that is 2 positions) in the dropdown list. When I select a 1 position value from the table and save it, then when I return to edit the page it is not showing the value that is in the form field. It only works when I select a 2 position value. It is the order type field


    In the form the value is A here and the order type on the form is blank  when it should be showing an A - Regular order.


    d1.png


    Here the value is DC in the file and when I edit the order the order form is positioned to the correct order type entry in the dropdown  

    d2.png



    Here are all the values in the drop down.

    d3.png



    Here is the field mapping....Code is the 2 character code from the table file field TKEY

    d4.png


    Here is the source SQL for the drop down...

    d6.png









    ​ ​
       







  • #2
    I would suggest you try trimming your "code" field in your data source. Sounds like your combo box has "A" as "A " (blank space at end)...then I assume that your value being returned for the order only sends back "A".

    Code:
    trim(substr(tkey,1,2)) as code

    Comment


    • #3
      Had already tried that...but got same result.....




      SELECT
      substr(tkey, 1, 2) || ' -' || substr(tdesc, 1, 30) AS name,
      trim(substr(tkey, 1, 2)) AS code,
      rrn(MSTABLE) AS rrn1
      FROM
      mstable
      WHERE
      (
      tco = vvin_virtual('ABSCompany', 'XX', 'char', 2, 0) and tdiv = vvin_virtual('ABSDivision', 'XX', 'char', 2, 0) and tno = '35' and substr(tdesc, 62, 1) = 'Y'
      )
      ORDER BY
      tkey




      d7.png

      Comment


      • #4
        What is being returned by your data source that sets the value for the combo...is it returning "A" without any spaces or does it have a space before or after?

        Comment


        • #5

          Here is what is showing in the data set response


          d8.png

          Comment


          • #6
            Here is the reponse without the trim, I need the code to have "A " space after the A so that it see's it as 2 positions ? Currently no matter what I am doing I can't get a space to stick after the A....How can I get the code to be 2 position as "A " (A + blank space). Is there a way to do this ?

            substr(tkey, 1, 2) || ' -' || substr(tdesc, 1, 30) AS name,
            substr(tkey, 1, 2) AS code


            [{ "NAME": "A -REGULAR ORDER",
            "CODE": "A",
            "RRN1": 16940 },

            { "NAME": "DC -DIRECT TO CONSUMER PHONE ORDER",
            "CODE": "DC",
            "RRN1": 16948 },

            { "NAME": "R -REORDER",
            "CODE": "R",
            "RRN1": 16965 },

            { "NAME": "W -WHOLESALE",
            "CODE": "W",
            "RRN1": 16970 }]

            Comment


            • #7
              I meant what is being returned for the data source that sets the value of the combo...not the combo list. In other words, your order type field for the combo. Is that returning "A" + a blank space?

              Comment


              • #8
                That is what I posted. It is returning a "A" with no space.,


                [{ "NAME": "A -REGULAR ORDER",
                "CODE": "A",
                "RRN1": 16940 },

                Comment


                • #9
                  So you want to see what is value that is mapped to the field on the form when I display the page ?

                  Comment


                  • #10
                    how would I see what the actual value is on the form ?

                    Comment


                    • #11
                      You are posting back the response for the combobox. I understand that the combobox is sending back the record without the trailing space. I have been asking to see the response from the order data source. I assume that your data source for the order sends back a value for the "order type". I also assume that this is the data source that must be returning a trailing space which is likely why the combo value is not mapping.

                      Comment


                      • #12
                        Post back your data source for the order header or whatever it is that supplies the data for your form.

                        Comment


                        • #13
                          The data source is the web order header file WEBTLOGH. The field is THOTYP and is 2 positions. In the file it is "A " and I assume when I load it using the helper program it is mapping a "A " and not "A". I agree since the drop down data source is not retaining the space after the "A" it is not matching, which is why it only works when there is actually a value with 2 characters like "DC". How to get the SQL data source to maintain the space after the "A" ?

                          Comment


                          • #14
                            It would be easiest to just use %trim in your form helper program.
                            Code:
                            SetValue('ORDER_TYPE':%trim(myDbField));

                            Comment


                            • #15
                              ok will try that on Monday....will let you know..... thanks for your help....

                              Comment

                              Working...
                              X