Create a Lookup from the Ticket to another Object (Object A)
Add a Date field to Object A
Give permissions to the date field and Object A (for the field user)
Add the Date field to the Search Results Layout for Object A
Create a new record for Object A with the Date field populated
Create a Ticket with the Lookup to Object A populated with the Object A record you created
Login to mobile
Click on the Lookup field in your ticket
Expected result
You should see the Date value from the Object A record you created earlier
Actual Result
You see the Column Header for Date but no value. If you look in als_objects you will see the Date field and it's value - so it is syncing to mobile just not displaying on screen
Datetimes also have a problem as seen in this screenshot:
Date type does not display at all
Datetime type displays OK if not NULL and totally messed up if NULL
!LookupDates.png!
Analysis
Date type does not display at all
_in the datetext bing, we were checking "value && !isNaN(value)" but we were passing in a string value for the date (which is NaN) and thus failing the test. Hence, no datetext values were being displayed at all._
Remove "&& !isNaN(value)"
Datetime type displays OK if not NULL and totally messed up if NULL
_in the "datetimetext" binding, we were obtaining the value via "value = _field && field.value ? ko.unwrap(field.value) : field". The problem here was that if the value was undefined, then the test "field && field.value" would return undefined which is falsy, thusly setting the value to the field object itself and ultimately passing thru the field object to the formatter and hence the funky NaN/NaN/0NaN 12:NaN AM output:
Change "field && field.value" to "field && field.hasOwnProperty("value")"
Salesforce queries always return date/datetime values as strings. The mapNewItem method of sync-utils converts date/datetimes to numeric values for transactional data ONLY. This is why some values are string and others are numeric.
Technical Analysis
Fix the date binding to handle strings (i.e. remove isNaN check). This is fix the problem reported.
If necessary, update the report helpers for date/datetime formatters to handle strings. They should be nearly identical to the date/time bindings.
Note that upserts for date/time values in Salesforce requires the values to be in unix epoch format (i.e. numeric). VERIFY THIS
Create a story card to:
stop converting date/times for transactional and handle all date/times as strings.
(REQUIRES FURTHER ANALYSIS) Either:
Verify/test that we can or cannot send up date/times as strings.
Update both Form and BindingContext "getChangeSet" method to convert date/time fields to numeric values.
update the event handlers to accept the object metadata and convert date/time fields to numeric values
update the event processor on heroku to convert date/time fields to numeric values. Note that this will require passing the metadata down as part of the data packet.
Mingle Card: 2422 Steps to reproduce
Expected result
You should see the Date value from the Object A record you created earlier
Actual Result
You see the Column Header for Date but no value. If you look in als_objects you will see the Date field and it's value - so it is syncing to mobile just not displaying on screen
Datetimes also have a problem as seen in this screenshot:
!LookupDates.png!
Analysis
Technical Analysis
Fix the date binding to handle strings (i.e. remove isNaN check). This is fix the problem reported.
If necessary, update the report helpers for date/datetime formatters to handle strings. They should be nearly identical to the date/time bindings.
Note that upserts for date/time values in Salesforce requires the values to be in unix epoch format (i.e. numeric). VERIFY THIS
Create a story card to:
Related Cards
2575
2565
Test Plan