Discussions

 View Only
  • 1.  Day and month being swapped in date field on ""?a=API_GenAddRecordForm

    Posted 06-25-2018 05:43
    I'm using "?a=API_GenAddRecordForm" & "&_fid_41=" & [Date I want] & "&_fid_42=" ...

    Field 41 and 'Date I want' are both date fields.
    In app properties, formatting of dates is DD-MM-YYYY (I live in Australia).
    When the form opens, in field 41, the day is in the month and month is in day from the 'Date I want'.

    Thank you.


  • 2.  RE: Day and month being swapped in date field on ""?a=API_GenAddRecordForm

    Posted 06-25-2018 10:37
    You probably need to write a variable that will format the Date into Australia format using the function ToFormattedText([Date Field],"DDMMYYYY).  Then "encode" the variable in your API call.

    ToFormattedText (Date d, Text f)

    Description: Returns a Text value containing the formatted print representation of the Date d, using the format f.

    Example: ToFormattedText(Date(2000,01,30),"MMDDYYYY")  returns "01-30-2000"
    ToFormattedText(Date(2000,01,30),"MMDDYY")  returns "01-30-00"
    ToFormattedText(Date(2000,01,30),"DDMMYYYY")  returns "30-01-2000"
    ToFormattedText(Date(2000,01,30),"DDMMYY")  returns "30-01-00"
    ToFormattedText(Date(2000,01,30),"YYYYMMDD")  returns "2000-01-30


  • 3.  RE: Day and month being swapped in date field on ""?a=API_GenAddRecordForm

    Posted 06-26-2018 00:37
    Thanks I'm sure this will solve it. Seems strange and was a bit concerning that this would happen.


  • 4.  RE: Day and month being swapped in date field on ""?a=API_GenAddRecordForm

    Posted 06-26-2018 11:39
    I agree that despite setting the Application date-format to a specific format; API Calls do not seem to recognize that.  Imports can be an issue too via Excel.