Forum Discussion

baba_k's avatar
baba_k
Occasional Contributor
14 years ago

Issue with drop down/ calender field

Hi

We are testing an windows application and facing a problem with a date field which is a drop down(Combo box), we are trying to enter the system date instead of selecting today's date from drop down. We are able to capture the system date and able to pass the date into the date field but after entering the date , It is being erased automatically.  System date captured is matching with the date format of the date field in our application.Below is the code

Currentdate=aqdatetime.Today()


Call Aliases.Agresso.Agresso_MainWindow1.Agreement_Screen.Agreement_tab.auiinvhead_start_date.TextBoxMaskBox.SetText(currentdate)






Call Aliases.Agresso.Agresso_MainWindow1.Agreement_Screen.Agreement_tab.auiinvhead_start_date.TextBoxMaskBox.Keys("[Tab]")



Please help us in resolving this issue



Thanks & Regards

Baba k


  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    aqDateTime.Today does not return a string but, instead, returns a datetime datatype.  You need to use either aqConvert.DateTimeToStr or aqConvert.DateTimeToFormatStr on your current date before you pass it in to SetText.
  • I know this is old, but in case anyone else is having this problem...



    I was experiencing this with certain fields.  I would record myself typing in a field and tabbing out. When I played back, what I typed in the field disappeared as soon as I tabbed away.  Why? I don't know.  But this is the workaround that worked:



    Use the On-Screen Action tool along with the Keys operation to send the keystrokes to the field.  This didn't have the same issue. 



    (tags: wpf, devexpress, playback, deletion)