URL Method for 3 tables?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bonneylake
    Contributor
    • Aug 2008
    • 769

    #76
    Originally posted by acoder
    That part of the code should be in cfif tags:
    Code:
    <cfif parts.recordcount is 0>
    <cfset hc_partNo = "">
    <cfset part_returned = "">
    <cfset defective = "">
    <cfset submission = "">
    <cfinclude template="partsdisplay.cfm">
    </cfif>
    Hey Acoder,

    I did that but still getting the same results. here is what i got on the main page

    Code:
    <cfoutput query="ticket">
    <cfset followup_date = #followup_date#>
    <cfset onsite_flag = #onsite_flag#>
    <cfset number_onsite = #number_onsite#>
    </cfoutput>
    
    
    <cfoutput query="parts">
    <cfset hc_partNo = #hc_partNo#>
    <cfset part_returned = #part_returned#>
    <cfset defective = #defective#>
    <cfset submission = #submission#>
    </cfoutput>
    <cfif parts.recordcount is 0>
    <cfset hc_partNo = "">
    <cfset part_returned = "">
    <cfset defective = "">
    <cfset submission = "">
    <cfinclude template="partsdisplay.cfm">
    </cfif>
    Thank you,
    Rach

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #77
      Ah, you will need cfoutput around the call, e.g.
      Code:
      <cfoutput>
      <cfinclude template="partsdisplay.cfm">
      </cfoutput>

      Comment

      • bonneylake
        Contributor
        • Aug 2008
        • 769

        #78
        Originally posted by acoder
        Ah, you will need cfoutput around the call, e.g.
        Code:
        <cfoutput>
        <cfinclude template="partsdisplay.cfm">
        </cfoutput>
        Hey Acoder,

        It still don't like me.

        main page
        Code:
        <cfoutput query="ticket">
        <cfset followup_date = #followup_date#>
        <cfset onsite_flag = #onsite_flag#>
        <cfset number_onsite = #number_onsite#>
        </cfoutput>
        
        
        <cfoutput query="parts">
        <cfset hc_partNo = #hc_partNo#>
        <cfset part_returned = #part_returned#>
        <cfset defective = #defective#>
        <cfset submission = #submission#>
        </cfoutput>
        <cfif parts.recordcount is 0>
        <cfset hc_partNo = "">
        <cfset part_returned = "">
        <cfset defective = "">
        <cfset submission = "">
        <cfoutput>
        <cfinclude template="partsdisplay.cfm">
        </cfoutput>
        </cfif>

        here whats on the partsdisplay.cf m
        Code:
        <table class="createticketables" id="spaceup" >
        <th class="sectiontitle" colspan="7">Parts Information</th>
        <tr>
        <td class="indent" id="formfieldpadding">HC P/N:&nbsp;&nbsp;&nbsp;<input type="text" name="hcpn" style="margin:0px" value="#hc_partNo#"></td>
        <td class="red">
        Have all parts been returned*
        <select name="partsreturn" id="partsreturn">
        <option value="" selected>Make A Selection</option>
        <option value="N/A"<cfif #part_returned# is "N/A">selected</cfif>>N/A</option>
        <option value="No"<cfif #part_returned# is "No">selected</cfif>>No</option>
        <option value="Yes"<cfif #part_returned# is "Yes">selected</cfif>>Yes</option>
        </select>
        </td>
        <td>
        <td class="indent">Defective<input type="checkbox" name="defective" value="#defective#"<cfif #defective# eq "1">checked=yes</cfif>/></td>
        </td>
        </tr>
        </table>
        
        <table class="createticketables" >
        <tr>
        <td class="indent"  id="formfieldpadding">Follow up Date:(MM/DD/YYYY)&nbsp;&nbsp;&nbsp;<input type="text" name="followdate" value="#followup_date#" size="8"/>&nbsp;&nbsp;&nbsp;Current Date<input type="checkbox" name="followcheck" value="" onClick="followdate.value=fill_date()"/></td>
        <td>On Site:</td>
        <td>
        <select name="onsite" id="onsite">
        <option value="" selected>No Choice</option>
          <option value="Yes"<cfif #onsite_flag# is "Y">selected</cfif>>Yes</option>
          <option value="No"<cfif #onsite_flag# is "N">selected</cfif>>No</option>
        </select>
        </td>
        <td>Number of Onsite:</td>
        <td>
        <select name="numonsite">
        <option value="" selected>No Choice</option>
        <cfloop from="0" to="10" index="nonsite">
        <option value="#nonsite#"<cfif #number_onsite# is #nonsite#>selected</cfif>>#nonsite#
        </option></cfloop>
        </select>
        </td>
        </tr>
        </table>
        
        
        
        <table class="createticketables" id="space">
        <tr>
        <td class="indent" id="formfieldpadding">Submission:
        <select class="submissionticketbox" name="submission">
        <option value="" selected>Make a Selection</option>
          <option value="Phone"<cfif #submission# is "Phone">selected</cfif>>Phone</option>
          <option value="Techmail"<cfif #submission# is "Techmail">selected</cfif>>Techmail</option>
          <option value="Request"<cfif #submission# is "Request">selected</cfif>>Request</option>
        </select>
        </td>
        </tr>
        </table>
        Thank you,
        Rach

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #79
          You will also need an include in the first part:
          Code:
          <cfoutput query="parts">
          <cfset hc_partNo = #hc_partNo#>
          <cfset part_returned = #part_returned#>
          <cfset defective = #defective#>
          <cfset submission = #submission#>
          <cfinclude template="partsdisplay.cfm">
          </cfoutput>
          <cfif parts.recordcount is 0>
          <cfset hc_partNo = "">
          <cfset part_returned = "">
          <cfset defective = "">
          <cfset submission = "">
          <cfoutput>
          <cfinclude template="partsdisplay.cfm">
          </cfoutput>
          </cfif>

          Comment

          • bonneylake
            Contributor
            • Aug 2008
            • 769

            #80
            Hey Acoder,

            I am still getting the same results. Do i need to take the values out of my partsdisplay.cf m page? i know it would show them empty if i did that. But then if i take the values out if the fields do actually have values it wont show up. But here is what i have on the main page.


            Code:
            <cfoutput query="ticket">
            <cfset followup_date = #followup_date#>
            <cfset onsite_flag = #onsite_flag#>
            <cfset number_onsite = #number_onsite#>
            </cfoutput>
            
            
            <cfoutput query="parts">
            <cfset hc_partNo = #hc_partNo#>
            <cfset part_returned = #part_returned#>
            <cfset defective = #defective#>
            <cfset submission = #submission#>
            <cfinclude template="partsdisplay.cfm">
            </cfoutput>
            <cfif parts.recordcount is 0>
            <cfset hc_partNo = "">
            <cfset part_returned = "">
            <cfset defective = "">
            <cfset submission = "">
            <cfoutput>
            <cfinclude template="partsdisplay.cfm">
            </cfoutput>
            </cfif>
            Thank you :),
            Rach

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              #81
              Let's try and get one part working at least.

              Find a ticket where you have no parts, i.e. the parts.recordcou nt is 0, and test that first. Forget about displaying parts values for now. Does it still show nothing?

              Comment

              • bonneylake
                Contributor
                • Aug 2008
                • 769

                #82
                Hey Acoder,

                oh i forgot to tell you that the table IS showing up an the fields are in the correct spot. Forgot to tell you (sorry about that).The only thing is the value part. Right now instead of the value for the fields being blank its putting the values i have assigned to the field like for example the value for hc p/c is #hc_partsNo#.If i go an look an an entry where i put a value for that field it will show what the value was. but when i try to look at once where i put it blank it instead puts the value which is the #hc_partsNo#.

                Thank you,
                Rach

                Comment

                • acoder
                  Recognized Expert MVP
                  • Nov 2006
                  • 16032

                  #83
                  Make sure the variable names match up. For example, is it hc_partNo or hc_partsNo?

                  Comment

                  • bonneylake
                    Contributor
                    • Aug 2008
                    • 769

                    #84
                    Hey Acoder,

                    It looks like everything matches up. But Still acting weird. Here is what i have on the main page

                    Code:
                    <cfoutput query="ticket">
                    <cfset followup_date = #followup_date#>
                    <cfset onsite_flag = #onsite_flag#>
                    <cfset number_onsite = #number_onsite#>
                    </cfoutput>
                    
                    
                    <cfoutput query="parts">
                    <cfset hc_partNo = #hc_partNo#>
                    <cfset part_returned = #part_returned#>
                    <cfset defective = #defective#>
                    <cfset submission = #submission#>
                    <cfinclude template="partsdisplay.cfm">
                    </cfoutput>
                    <cfif parts.recordcount is 0>
                    <cfset hc_partNo = "">
                    <cfset part_returned = "">
                    <cfset defective = "">
                    <cfset submission = "">
                    <cfoutput>
                    <cfinclude template="partsdisplay.cfm">
                    </cfoutput>
                    </cfif>
                    and here is whats on partsdisplay.cf m
                    Code:
                    <table class="createticketables" id="spaceup" >
                    <th class="sectiontitle" colspan="7">Parts Information</th>
                    <tr>
                    <td class="indent" id="formfieldpadding">HC P/N:&nbsp;&nbsp;&nbsp;<input type="text" name="hcpn" style="margin:0px" value="#hc_partNo#"></td>
                    <td class="red">
                    Have all parts been returned*
                    <select name="partsreturn" id="partsreturn">
                    <option value="" selected>Make A Selection</option>
                    <option value="N/A"<cfif #part_returned# is "N/A">selected</cfif>>N/A</option>
                    <option value="No"<cfif #part_returned# is "No">selected</cfif>>No</option>
                    <option value="Yes"<cfif #part_returned# is "Yes">selected</cfif>>Yes</option>
                    </select>
                    </td>
                    <td>
                    <td class="indent">Defective<input type="checkbox" name="defective" value="#defective#"<cfif #defective# eq "1">checked=yes</cfif>/></td>
                    </td>
                    </tr>
                    </table>
                    
                    <table class="createticketables" >
                    <tr>
                    <td class="indent"  id="formfieldpadding">Follow up Date:(MM/DD/YYYY)&nbsp;&nbsp;&nbsp;<input type="text" name="followdate" value="#followup_date#" size="8"/>&nbsp;&nbsp;&nbsp;Current Date<input type="checkbox" name="followcheck" value="" onClick="followdate.value=fill_date()"/></td>
                    <td>On Site:</td>
                    <td>
                    <select name="onsite" id="onsite">
                    <option value="" selected>No Choice</option>
                      <option value="Yes"<cfif #onsite_flag# is "Y">selected</cfif>>Yes</option>
                      <option value="No"<cfif #onsite_flag# is "N">selected</cfif>>No</option>
                    </select>
                    </td>
                    <td>Number of Onsite:</td>
                    <td>
                    <select name="numonsite">
                    <option value="" selected>No Choice</option>
                    <cfloop from="0" to="10" index="nonsite">
                    <option value="#nonsite#"<cfif #number_onsite# is #nonsite#>selected</cfif>>#nonsite#
                    </option></cfloop>
                    </select>
                    </td>
                    </tr>
                    </table>
                    
                    
                    
                    <table class="createticketables" id="space">
                    <tr>
                    <td class="indent" id="formfieldpadding">Submission:
                    <select class="submissionticketbox" name="submission">
                    <option value="" selected>Make a Selection</option>
                      <option value="Phone"<cfif #submission# is "Phone">selected</cfif>>Phone</option>
                      <option value="Techmail"<cfif #submission# is "Techmail">selected</cfif>>Techmail</option>
                      <option value="Request"<cfif #submission# is "Request">selected</cfif>>Request</option>
                    </select>
                    </td>
                    </tr>
                    </table>
                    Thank you,
                    Rach

                    Comment

                    • acoder
                      Recognized Expert MVP
                      • Nov 2006
                      • 16032

                      #85
                      So this problem occurs where you have some parts? Are you sure the hc_partNo should be blank? Which value is it taking instead? When you have no parts, the code works fine. Is that correct?

                      Comment

                      • bonneylake
                        Contributor
                        • Aug 2008
                        • 769

                        #86
                        Originally posted by acoder
                        So this problem occurs where you have some parts? Are you sure the hc_partNo should be blank? Which value is it taking instead? When you have no parts, the code works fine. Is that correct?
                        Hey Acoder,

                        If i have something previously written into hc_partNo it will appear perfectly fine with no problems. However, when i go to view one that doesn't have anything previously written into hc_partNo it will appear with the value. Like here is the line

                        Code:
                        <input type="text" name="hcpn" style="margin:0px" value="#hc_partNo#">
                        instead of when you view it the field remains blank it puts the value which is #hc_partNo#

                        Thank you,
                        Rach

                        Comment

                        • acoder
                          Recognized Expert MVP
                          • Nov 2006
                          • 16032

                          #87
                          Check the output from the query. If you put something like (for a test) :
                          Code:
                          <cfoutput query="parts">
                          #hc_partNo#;#part_returned#;#defective#;#submission#<br>
                          <cfset hc_partNo = #hc_partNo#>
                          <cfset part_returned = #part_returned#>
                          <cfset defective = #defective#>
                          <cfset submission = #submission#>
                          <cfinclude template="partsdisplay.cfm">
                          </cfoutput>
                          what does it output?

                          Comment

                          • bonneylake
                            Contributor
                            • Aug 2008
                            • 769

                            #88
                            Originally posted by acoder
                            Check the output from the query. If you put something like (for a test) :
                            Code:
                            <cfoutput query="parts">
                            #hc_partNo#;#part_returned#;#defective#;#submission#<br>
                            <cfset hc_partNo = #hc_partNo#>
                            <cfset part_returned = #part_returned#>
                            <cfset defective = #defective#>
                            <cfset submission = #submission#>
                            <cfinclude template="partsdisplay.cfm">
                            </cfoutput>
                            what does it output?
                            Hey Acoder,

                            with your test, if i looked at a ticket with previous entrys it showed what the values are suppose to be, but it didn't put it the fields it just put it above all the fields.But if i looked at a entry where there were no values applied then nothing would appear at all.

                            Thank you,
                            Rach

                            Comment

                            • acoder
                              Recognized Expert MVP
                              • Nov 2006
                              • 16032

                              #89
                              Ah, so now we've established, the problem is with the recordcount 0 part. Remove the test line because it's not needed any more.

                              Is it just hc_partNo or all 4 fields where you have this problem?

                              Comment

                              • bonneylake
                                Contributor
                                • Aug 2008
                                • 769

                                #90
                                Originally posted by acoder
                                Ah, so now we've established, the problem is with the recordcount 0 part. Remove the test line because it's not needed any more.

                                Is it just hc_partNo or all 4 fields where you have this problem?
                                Hey Acoder,

                                I am having the problem with all the fields for the parts table and all the fields for the ticket table as well. so basically all the fields present.

                                Thank you,
                                Rach

                                Comment

                                Working...