frank6683668
Posts: 0
Joined: Sat Feb 22, 2014 2:36 am

Saving Date into database not working.

Hello,

I'm trying to use either the Input or Datepicker component to put the values into my database. The only problem is that if I use Input (date) component, on a mobile device it loads "Jan" instead of "1" for the month. Anyone know a way around this either with javascript, datepicker? I want to add the value into a data type "date" field into salesforce.com

p.s. I can load it just fine as "text" from input field, but for reporting purposes it won't be fun!

thanks!

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Saving Date into database not working.

Hello Frank,

To save data into data base you have to:

1) add datePicker on the page. Go to the properties and set date format as "yy/mm/dd".

2) create update or create service.

3) add datasouce for this service.

4) do mapping from "datepicker_date value" - date field in the request.

5) click "edit js".

6) paste the following js code: prevalue = value.replace(/value = value.replace(/\//gi, "-") + " 00:00:00.000";
return value;#47;/gi, "-") + " 00:00:00.000";
return value;/pre

frank6683668
Posts: 0
Joined: Sat Feb 22, 2014 2:36 am

Saving Date into database not working.

I get errors in the javascript editor.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Saving Date into database not working.

Hello! Could you post error screenshots?

frank6683668
Posts: 0
Joined: Sat Feb 22, 2014 2:36 am

Saving Date into database not working.

Bellow are the errors. I am adding the script to "request' on the mapping.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Saving Date into database not working.

Hi Frank - we are sorry for posting not correct code, it should be like this:

pre
codevalue = value.replace(/
codevalue = value.replace(/\//gi, "-") + " 00:00:00.000&quot
return value;#47;/gi, "-") + " 00:00:00.000&quot
return value;/code/code/pre

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Saving Date into database not working.

codevalue = value.replace(/value = value.replace(/\//gi, "-") + " 00:00:00.000&quot
return value;#47;/gi, "-") + " 00:00:00.000&quot
return value;/code

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Saving Date into database not working.

Hi Frank - Sorry this code is a little bit tricky to post:
code
value = value.replace(/\//code/codegi, "-") + "00:00:00.000&quot
return value;
/code

frank6683668
Posts: 0
Joined: Sat Feb 22, 2014 2:36 am

Saving Date into database not working.

Still no luck. " /\//gi " becomes red. I have the service enabled, and the other inputs get input only when i remove the mapping of the date picker

Return to “Issues”