Skip to main content
deleted 66 characters in body; edited title
Source Link
Adrian Larson
  • 151.4k
  • 38
  • 247
  • 431

SalesForce DateTime Datetime format to "\/Date(1213131)\/"

I'm trying to call a Webservice with a DateTime format like this : "/Date(x)/""\/Date(x)\/" where 'x'x is the millisecond value since 1970.

How tocan I generate a DateTime in this format  ?

Here is what i've done :

dateValidation_long = dateValidation_string.getTime();
String a = '\\/Date(';
String b = ')\\/';
modifierEntiteDeFacturation3C_request.dateValidation = a + dateValidation_long + b;

Here is the result in my console :

\/Date(1505904139000)\/

Then, i'm trying to JSON.serialize this date, to send it via a Webservice, and this is the result :

dateValidation":"\\/Date(1505904534000)\\/"

The webservice response is not OK because the format is different as expected :

DateTime content '\/Date(1505904139000)\/' does not start with '\/Date(' and end with ')\/' as required for JSON.

If someone got a solution, a tips, tell me :)

Have a good day

SalesForce DateTime format to "\/Date(1213131)\/"

I'm trying to call a Webservice with a DateTime format like this : "/Date(x)/" where 'x' is the millisecond value since 1970.

How to generate a DateTime in this format  ?

Here is what i've done :

dateValidation_long = dateValidation_string.getTime();
String a = '\\/Date(';
String b = ')\\/';
modifierEntiteDeFacturation3C_request.dateValidation = a + dateValidation_long + b;

Here is the result in my console :

\/Date(1505904139000)\/

Then, i'm trying to JSON.serialize this date, to send it via a Webservice, and this is the result :

dateValidation":"\\/Date(1505904534000)\\/"

The webservice response is not OK because the format is different as expected :

DateTime content '\/Date(1505904139000)\/' does not start with '\/Date(' and end with ')\/' as required for JSON.

If someone got a solution, a tips, tell me :)

Have a good day

Datetime format to "\/Date(1213131)\/"

I'm trying to call a Webservice with a DateTime format like this : "\/Date(x)\/" where x is the millisecond value since 1970.

How can I generate a DateTime in this format?

Here is what i've done :

dateValidation_long = dateValidation_string.getTime();
String a = '\\/Date(';
String b = ')\\/';
modifierEntiteDeFacturation3C_request.dateValidation = a + dateValidation_long + b;

Here is the result in my console :

\/Date(1505904139000)\/

Then, i'm trying to JSON.serialize this date, to send it via a Webservice, and this is the result :

dateValidation":"\\/Date(1505904534000)\\/"

The webservice response is not OK because the format is different as expected :

DateTime content '\/Date(1505904139000)\/' does not start with '\/Date(' and end with ')\/' as required for JSON.
added 204 characters in body
Source Link
FabienHuot
  • 438
  • 2
  • 6
  • 13

I'm trying to call a Webservice with a DateTime format like this : "/Date(x)/" where 'x' is the millisecond value since 1970.

How to generate a DateTime in this format ?

Here is what i've done :

dateValidation_long = dateValidation_string.getTime();
String a = '\\/Date(';
String b = ')\\/';
modifierEntiteDeFacturation3C_request.dateValidation = a + dateValidation_long + b;

Here is the result in my console :

\/Date(1505904139000)\/

Then, i'm trying to JSON.serialize this date, to send it via a Webservice, and this is the result :

dateValidation":"\\/Date(1505904534000)\\/"

The webservice response is not OK because the format is different as expected :

DateTime content '\/Date(1505904139000)\/' does not start with '\/Date(' and end with ')\/' as required for JSON.

If someone got a solution, a tips, tell me :)

Have a good day

I'm trying to call a Webservice with a DateTime format like this : "/Date(x)/" where 'x' is the millisecond value since 1970.

How to generate a DateTime in this format ?

Here is what i've done :

dateValidation_long = dateValidation_string.getTime();
String a = '\\/Date(';
String b = ')\\/';
modifierEntiteDeFacturation3C_request.dateValidation = a + dateValidation_long + b;

Here is the result in my console :

\/Date(1505904139000)\/

Then, i'm trying to JSON.serialize this date, to send it via a Webservice, and this is the result :

dateValidation":"\\/Date(1505904534000)\\/"

If someone got a solution, a tips, tell me :)

Have a good day

I'm trying to call a Webservice with a DateTime format like this : "/Date(x)/" where 'x' is the millisecond value since 1970.

How to generate a DateTime in this format ?

Here is what i've done :

dateValidation_long = dateValidation_string.getTime();
String a = '\\/Date(';
String b = ')\\/';
modifierEntiteDeFacturation3C_request.dateValidation = a + dateValidation_long + b;

Here is the result in my console :

\/Date(1505904139000)\/

Then, i'm trying to JSON.serialize this date, to send it via a Webservice, and this is the result :

dateValidation":"\\/Date(1505904534000)\\/"

The webservice response is not OK because the format is different as expected :

DateTime content '\/Date(1505904139000)\/' does not start with '\/Date(' and end with ')\/' as required for JSON.

If someone got a solution, a tips, tell me :)

Have a good day

Source Link
FabienHuot
  • 438
  • 2
  • 6
  • 13

SalesForce DateTime format to "\/Date(1213131)\/"

I'm trying to call a Webservice with a DateTime format like this : "/Date(x)/" where 'x' is the millisecond value since 1970.

How to generate a DateTime in this format ?

Here is what i've done :

dateValidation_long = dateValidation_string.getTime();
String a = '\\/Date(';
String b = ')\\/';
modifierEntiteDeFacturation3C_request.dateValidation = a + dateValidation_long + b;

Here is the result in my console :

\/Date(1505904139000)\/

Then, i'm trying to JSON.serialize this date, to send it via a Webservice, and this is the result :

dateValidation":"\\/Date(1505904534000)\\/"

If someone got a solution, a tips, tell me :)

Have a good day