You need to sign in to do that
Don't have an account?
Sai Laasya
Problem with Map get key value
Hi
Could anyone please help me out.
I have a map in my apex controller. The key value pair is showing correct values in my debug logs.
And when I am using Map.get(key) method it is returning null though the key,value pair exists in the map.
This is happening only for a particular user. For other users, the map is working fine.
User1 Debug Logs:
10:46:37.0 (25625411)|USER_DEBUG|[473]|DEBUG|DP Map####{2017-03-01 00:00:00=a06p0000003QE3YAAW, 2017-03-02 00:00:00=a06p0000003QE3ZAAW, 2017-03-03 00:00:00=a06p0000003QE3aAAG, 2017-03-04 00:00:00=a06p0000003QE3bAAG, 2017-03-05 00:00:00=a06p0000003QE3cAAG, 2017-03-06 00:00:00=a06p0000003QE3dAAG, 2017-03-07 00:00:00=a06p0000003QE3eAAG, 2017-03-08 00:00:00=a06p0000003QE3fAAG, 2017-03-09 00:00:00=a06p0000003QE3gAAG, 2017-03-10 00:00:00=a06p0000003QE3hAAG, ...}
10:46:32.0 (43377517)|USER_DEBUG|[555]|DEBUG|Day Value ####2017-03-02 00:00:00 10:46:32.0 (43382829)|STATEMENT_EXECUTE|[556] 10:46:32.0 (43385696)|HEAP_ALLOCATE|[556]|Bytes:14 10:46:32.0 (43428743)|HEAP_ALLOCATE|[556]|Bytes:18 10:46:32.0 (43440260)|HEAP_ALLOCATE|[556]|Bytes:32 10:46:32.0 (43448708)|USER_DEBUG|[556]|DEBUG|Map Value ####a06p0000003QE3ZAAW
User 2 Debug Logs:
10:49:53.0 (25411489)|USER_DEBUG|[473]|DEBUG|DP Map####{2017-03-01 00:00:00=a06p0000003QGRWAA4, 2017-03-02 00:00:00=a06p0000003QGRXAA4, 2017-03-03 00:00:00=a06p0000003QGRYAA4, 2017-03-04 00:00:00=a06p0000003QGRZAA4, 2017-03-05 00:00:00=a06p0000003QGRaAAO, 2017-03-06 00:00:00=a06p0000003QGRbAAO, 2017-03-07 00:00:00=a06p0000003QGRcAAO, 2017-03-08 00:00:00=a06p0000003QGRdAAO, 2017-03-09 00:00:00=a06p0000003QGReAAO, 2017-03-10 00:00:00=a06p0000003QGRfAAO, ...}
10:49:53.0 (34085451)|USER_DEBUG|[555]|DEBUG|Day Value ####2017-01-03 00:00:00 10:49:53.0 (34089903)|STATEMENT_EXECUTE|[556] 10:49:53.0 (34092924)|HEAP_ALLOCATE|[556]|Bytes:14 10:49:53.0 (34130947)|HEAP_ALLOCATE|[556]|Bytes:18 10:49:53.0 (34140284)|USER_DEBUG|[556]|DEBUG|Map Value ####null
Both the users are System Admins
Could anyone please help me out.
I have a map in my apex controller. The key value pair is showing correct values in my debug logs.
And when I am using Map.get(key) method it is returning null though the key,value pair exists in the map.
This is happening only for a particular user. For other users, the map is working fine.
User1 Debug Logs:
10:46:37.0 (25625411)|USER_DEBUG|[473]|DEBUG|DP Map####{2017-03-01 00:00:00=a06p0000003QE3YAAW, 2017-03-02 00:00:00=a06p0000003QE3ZAAW, 2017-03-03 00:00:00=a06p0000003QE3aAAG, 2017-03-04 00:00:00=a06p0000003QE3bAAG, 2017-03-05 00:00:00=a06p0000003QE3cAAG, 2017-03-06 00:00:00=a06p0000003QE3dAAG, 2017-03-07 00:00:00=a06p0000003QE3eAAG, 2017-03-08 00:00:00=a06p0000003QE3fAAG, 2017-03-09 00:00:00=a06p0000003QE3gAAG, 2017-03-10 00:00:00=a06p0000003QE3hAAG, ...}
10:46:32.0 (43377517)|USER_DEBUG|[555]|DEBUG|Day Value ####2017-03-02 00:00:00 10:46:32.0 (43382829)|STATEMENT_EXECUTE|[556] 10:46:32.0 (43385696)|HEAP_ALLOCATE|[556]|Bytes:14 10:46:32.0 (43428743)|HEAP_ALLOCATE|[556]|Bytes:18 10:46:32.0 (43440260)|HEAP_ALLOCATE|[556]|Bytes:32 10:46:32.0 (43448708)|USER_DEBUG|[556]|DEBUG|Map Value ####a06p0000003QE3ZAAW
User 2 Debug Logs:
10:49:53.0 (25411489)|USER_DEBUG|[473]|DEBUG|DP Map####{2017-03-01 00:00:00=a06p0000003QGRWAA4, 2017-03-02 00:00:00=a06p0000003QGRXAA4, 2017-03-03 00:00:00=a06p0000003QGRYAA4, 2017-03-04 00:00:00=a06p0000003QGRZAA4, 2017-03-05 00:00:00=a06p0000003QGRaAAO, 2017-03-06 00:00:00=a06p0000003QGRbAAO, 2017-03-07 00:00:00=a06p0000003QGRcAAO, 2017-03-08 00:00:00=a06p0000003QGRdAAO, 2017-03-09 00:00:00=a06p0000003QGReAAO, 2017-03-10 00:00:00=a06p0000003QGRfAAO, ...}
10:49:53.0 (34085451)|USER_DEBUG|[555]|DEBUG|Day Value ####2017-01-03 00:00:00 10:49:53.0 (34089903)|STATEMENT_EXECUTE|[556] 10:49:53.0 (34092924)|HEAP_ALLOCATE|[556]|Bytes:14 10:49:53.0 (34130947)|HEAP_ALLOCATE|[556]|Bytes:18 10:49:53.0 (34140284)|USER_DEBUG|[556]|DEBUG|Map Value ####null
Both the users are System Admins
As my map contains keys of type Date, the compiler was unable to fetch it's value due to change in date format