Alpha Video Training
Results 1 to 6 of 6

Thread: Dialog Question

  1. #1
    "Certified" Alphaholic chadbrown's Avatar
    Real Name
    Chad Brown
    Join Date
    Aug 2007
    Location
    Aurora, Ontario, Canada
    Posts
    1,408

    Default Dialog Question

    Hi I am trying to make a currentform2 control show up on the dialog only if another currentformcontrol1 has a value of .t.
    I beleive this is added in the component show/hide expression
    After that I would like to use this validation if(currentformcontrol.1=.t. then currentformcontrol2 must not be < 3.99)
    And I beleive that this would be put into the validate area.

    Thanks

    Chad

  2. #2
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Location
    Oregon, USA
    Posts
    2,625

    Default Re: Dialog Question

    Chad,

    For part 1, since this is a dialog, it is important to get the actual value of field 1. You indicated .t., but that is a logical value and the all the values in the fields are character. That value could be different based on whether you are using a checkbox, a textbox, a dropdown or a radio button for the t/f value.

    For part 2, I would put that validation in the validate event. Again, you've got to convert to numeric to make the comparison.

    Pat

  3. #3
    "Certified" Alphaholic chadbrown's Avatar
    Real Name
    Chad Brown
    Join Date
    Aug 2007
    Location
    Aurora, Ontario, Canada
    Posts
    1,408

    Default Re: Dialog Question

    Thanks Pat here is the After Validate code from the Dialog

    control 1 is ewp which is a checkbox which you can see is logical
    control 2 is esp_retail which is numeric

    Thanks


    dim t as p
    tbl2 = table.open("[PathAlias.ADB_Path]\esp")
    tbl = table.open("[PathAlias.ADB_Path]\bdi tracking")
    tbl.enter_begin()
    tbl2.enter_begin()
    tbl.Store = alltrim(CurrentForm.Controls.Store.value)
    tbl.Date = convert_type(alltrim(CurrentForm.Controls.Date.value),"d")
    tbl.Telephone = convert_type(alltrim(CurrentForm.Controls.Telephone.value),"N")
    tbl.Sales_type = alltrim(CurrentForm.Controls.Sales_Type.value)
    tbl.Detail = alltrim(CurrentForm.Controls.Detail.value)
    tbl.Emp = convert_type(alltrim(CurrentForm.Controls.Employee.value),"N")
    tbl.Comment = alltrim(CurrentForm.Controls.Comment.value)
    tbl.Customername = alltrim(CurrentForm.Controls.Customer_Name.value)
    tbl.Esn = alltrim(CurrentForm.Controls.ESN.value)
    tbl.Sap = alltrim(CurrentForm.Controls.SAP_Code.value)
    tbl.Term = convert_type(alltrim(CurrentForm.Controls.Term.value),"N")
    tbl.Ispr_amount = convert_type(alltrim(CurrentForm.Controls.Total_ISPR_LTO.value),"N")
    tbl.Data_mthly_fee = convert_type(alltrim(CurrentForm.Controls.Monthly_Data_Rate.value),"N")
    tbl.Ewp = convert_type(alltrim(CurrentForm.Controls.EWP.value),"l")
    tbl.Agreementnumber = convert_type(alltrim(CurrentForm.Controls.Agreement_.value),"N")
    tbl.Promo_value = convert_type(alltrim(CurrentForm.Controls.Promo_Amount.value),"N")
    tbl.Plan = alltrim(CurrentForm.Controls.Plan.value)
    tbl.Bv_invoice = convert_type(alltrim(CurrentForm.Controls.BV_Invoice_.value),"N")
    tbl.Model = alltrim(CurrentForm.Controls.Model.value)
    tbl.Brand = alltrim(CurrentForm.Controls.Brand.value)


    'Second Table posting'

    tbl2.Card = convert_type(alltrim(CurrentForm.Controls.Credit_Card.value),"N")
    tbl2.Cc_expmth = convert_type(alltrim(CurrentForm.Controls.Expiry_Month.value),"N")
    tbl2.Cc_expyr = convert_type(alltrim(CurrentForm.Controls.Expiry_Year.value),"N")
    tbl2.Bank = alltrim(CurrentForm.Controls.Bank.value)
    tbl2.Branch = alltrim(CurrentForm.Controls.Branch.value)
    tbl2.B_account = alltrim(CurrentForm.Controls.Account.value)
    tbl2.Esp_retail = convert_type(alltrim(CurrentForm.Controls.Retail_Price.value),"N")
    tbl2.Store = alltrim(CurrentForm.Controls.Store.value)
    tbl2.Date = convert_type(alltrim(CurrentForm.Controls.Date.value),"d")
    tbl2.Telephone = convert_type(alltrim(CurrentForm.Controls.Telephone.value),"N")
    tbl2.Emp = convert_type(alltrim(CurrentForm.Controls.Employee.value),"N")
    tbl2.Customername = alltrim(CurrentForm.Controls.Customer_Name.value)
    tbl2.Esn = alltrim(CurrentForm.Controls.ESN.value)
    tbl2.Ewp = convert_type(alltrim(CurrentForm.Controls.EWP.value),"l")
    tbl2.Agreementnumber = convert_type(alltrim(CurrentForm.Controls.Agreement_.value),"N")
    tbl2.Bv_invoice = convert_type(alltrim(CurrentForm.Controls.BV_Invoice_.value),"N")
    tbl2.Espacc = convert_type(alltrim(currentform.controls.Accessory_ESP.value),"l")

    tbl.enter_end(.t.)
    tbl2.enter_end(.t.)
    tbl.close()
    tbl2.close()
    CurrentForm.RedirectTarget = "t Collingwood input.a5w"
    Last edited by chadbrown; 02-12-2009 at 03:00 PM. Reason: Update missing items

  4. #4
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Location
    Oregon, USA
    Posts
    2,625

    Default Re: Dialog Question

    Sorry, but I don't understand. Do you still have a question?

    I suggested that you use the validate event, not the aftervalidate.

    Pat

  5. #5
    "Certified" Alphaholic chadbrown's Avatar
    Real Name
    Chad Brown
    Join Date
    Aug 2007
    Location
    Aurora, Ontario, Canada
    Posts
    1,408

    Default Re: Dialog Question

    Oh yeah I still have the question I was just showing you the code so that you could see the field types and names. I know that it has to be in the validate area. I was hoping you would know some examples or some direction on the validation code. The current dialog works it just needs the validation added.
    Thanks

  6. #6
    VAR
    Real Name
    Andy Meer
    Join Date
    Mar 2005
    Location
    Atherstone UK
    Posts
    452

    Default Re: Dialog Question

    Hi
    I do somthing Similar

    First I use a lookup to get the value of a field

    session.w1 = lookupc("L",session.DBASE+"001","Question","[PathAlias.ADB_Path]\questions","QnoQno")

    Then in the initialize use this code

    if session.w1 > "" then
    tmpl.Variable_Info[1].Column.Heading = session.w1
    else
    tmpl.Variable_Info[1].Column.Hide = .t.
    end if

    Andy

Similar Threads

  1. dialog question
    By Mike Reed in forum Application Server Version 9 - Web/Browser Applications
    Replies: 2
    Last Post: 08-09-2008, 02:34 PM
  2. Dialog question
    By Link in forum Application Server Version 9 - Web/Browser Applications
    Replies: 5
    Last Post: 04-11-2008, 05:48 PM
  3. Dialog Question
    By BRIAN GRAY in forum Alpha Five Version 5
    Replies: 10
    Last Post: 08-23-2003, 09:27 AM
  4. Dialog question
    By BRIAN GRAY in forum Alpha Five Version 5
    Replies: 4
    Last Post: 06-09-2003, 07:48 AM
  5. X-Dialog Question
    By Louis Nickerson in forum Alpha Five Version 5
    Replies: 2
    Last Post: 12-02-2002, 08:44 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •