<% ' ' Customer Entry and Maintenance ' 'Initialize Standard Information Index = request("Index") ' The last selected Index number RowId = request("RowId") ' If a record Id was passed RunReport = (request("RunReport")<>"") ' If run report was selected %> <% ' redirects must occur before any html output! If RunReport then Response.redirect ("CustomerList.asp?RunReport=1&Index=" & Index) end if %> Customer0 <% ' LoginRights: If 1 user has full rights, if 0 or -1, browse only rights %> <% LoginRights = request.cookies("Rights") %> " TYPE="text/css"> <% CheckFieldChange=oCustomer.call("get_peFieldMultiUser") %> <% ' DebugMode =1 ' uncomment this for page get/post debug help %> <% If LoginRights = "1" then %>

Customer Entry and Maintenance

<% else %>

Customer Query

<% end if %> <% oCustomer.call "set_pbReportErrors", 1 'normally show any errors that occur 'We either find a record, or clear the WBO If RowId <> "" Then Err = oCustomer.RequestFindbyRowId( "Customer", RowId) else Err = oCustomer.RequestClear("Customer",1) End if ' process various buttons that might have been pressed. ' only support Post submissions If request("Request_method")="POST" Then if Request("clear")<>"" then Err = oCustomer.RequestClear("Customer",1) end if if Request("save")<>"" then oCustomer.call "set_pbReportErrors", 0 err = oCustomer.RequestSave("Customer") if err = 0 then Response.Write("

Customer record saved

") else Response.Write("") Response.Write("

Could not save changes. Errors Occurred

") oCustomer.call "msg_ReportAllErrors" Response.Write("
") end if end if if Request("delete")<>"" then oCustomer.call "set_pbReportErrors", 0 Err = oCustomer.RequestDelete("Customer") if err = 0 then Response.Write("

The record has been deleted.

") else Response.Write("") Response.Write("

The record could not be deleted.

") oCustomer.call "msg_ReportAllErrors" Response.Write("
") end if end if if Request("validate")<>"" then oCustomer.call "set_pbReportErrors", 0 err = oCustomer.RequestDDUpdate("Customer",0) if Err = 0 then Response.Write("

Current data is Valid

") else Response.Write("") Response.Write("

Current data is not valid

") oCustomer.call "msg_ReportAllErrors" Response.Write("
") end if end if ' note we use the Index variable we created above if Request("findprev") <>"" then Err = oCustomer.RequestFind("Customer", Index, LT) if Request("find") <>"" then Err = oCustomer.RequestFind("Customer", Index, GE) if Request("findnext") <>"" then Err = oCustomer.RequestFind("Customer", Index, GT) if Request("findfirst")<>"" then Err = oCustomer.RequestFind("Customer", Index, FIRST_RECORD) if Request("findlast") <>"" then Err = oCustomer.RequestFind("Customer", Index, LAST_RECORD) end if %> <% ' generate a row for the passed obj and field ' The advantage of this method is you can control your output ' anyway you want and propagate it to all input controls Sub ShowDataLine (Obj, FileField ) FErr = Obj.DDValue(FileField,DDFIELDERROR) Response.write("") Response.write( "Doing it with a sub-routine") Response.write( "") If FErr<>"" then Response.Write("") else Response.Write("") Response.write( Obj.ddValue(FileField, DDLONGLABEL) & "") Response.write( "" & Obj.DDValue(FileField,DDAUTO) & "") If FErr <> "" then Response.write("" & FErr & "") end if Response.write("") End Sub %>
">

Find by <% oCustomer.call "get_CreateFindIndexCombo", "Index", "Customer", Index %>

<%sValue = oCustomer.DDValue("Customer.Customer_Number")%> <%FieldError=oCustomer.DDValue("Customer.Customer_Number",DDFIELDERROR)%> <%If FieldError<>"" then%> <%end if%> <%FieldError=oCustomer.DDValue("Customer.Customer_Number",DDFIELDERROR)%> <%If FieldError<>"" then%> <%end if%> <% ShowDataLine oCustomer, "Customer.Customer_Number" ' do it with a subroutine %> <%FieldError=oCustomer.DDValue("Customer.State",DDFIELDERROR)%> <%If FieldError<>"" then%> <%end if%>
Various ways to make single line entries work
Simple single line entry Customer Number ">
Alternate Simple single line entryCustomer Number
Simple single line entry w/ error checkCustomer Number "> <%=FieldError%>
Simple single line entry w/ auto-status help Customer Number " name="CUSTOMER__CUSTOMER_NUMBER" value="<%=oCustomer.DDValue("Customer.Customer_Number")%>">
Simple single line entry with auto label <%=oCustomer.DDValue("Customer.Customer_Number",DDLONGLABEL)%> ">
Simple single line entry with auto label w/error info <%=oCustomer.DDValue("Customer.Customer_Number",DDLONGLABEL,2)%> ">
auto generated single line entry Customer Number <%=oCustomer.DDValue("Customer.Customer_Number",DDFORM)%>
auto DDAUTO generated single line entry Customer Number <%=oCustomer.DDValue("Customer.Customer_Number",DDAUTO)%>
Doing it all<%=oCustomer.DDValue("Customer.Customer_Number",DDLONGLABEL,1)%> <%=oCustomer.DDValue("Customer.Customer_Number",DDAUTO)%><%=FieldError%>
Various ways to make validation tables work
Val table as form w/ error displayState <%=oCustomer.ddValue("Customer.State", DDFORM)%><%=FieldError%>
Val table as combo take 1 State
Val table as combo take 2 DDCOMBO State <%=oCustomer.ddValue("Customer.State", DDCOMBO)%>
Val table as combo take 3 DDAUTO State <%=oCustomer.ddValue("Customer.State", DDAUTO)%>
Val table as a radio State <%=oCustomer.DDValue("Customer.State",DDRADIO)%>
Various ways to make display only fields work
Read only field (w/ no displayonly) Purchases ">
Read only field (w/ manual displayonly) Purchases ">
Read only field (w/ auto displayonly) Purchases name="CUSTOMER__PURCHASES" value="<%=oCustomer.DDValue("Customer.Purchases")%>">
Read only field via DDAUTO or DDFORM Purchases <%=oCustomer.DDValue("Customer.Purchases",DDAUTO)%>
Read only field without using control Purchases <%=oCustomer.DDValue("Customer.Purchases")%>
Various ways to make multi-line (comments) work
Comment done manually Comments
Comment done DDEDIT Comments <%=oCustomer.DDValue("Customer.Comments",DDEDIT)%>
Comment done DDAUTO Comments <%=oCustomer.DDValue("Customer.Comments",DDAUTO)%>