Page 1 of 3

Saving Date into database not working.

Posted: Fri Feb 28, 2014 5:05 am
by frank6683668

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!


Saving Date into database not working.

Posted: Fri Feb 28, 2014 8:35 am
by Maryna Brodina

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


Saving Date into database not working.

Posted: Mon Mar 03, 2014 2:12 am
by frank6683668

I get errors in the javascript editor.


Saving Date into database not working.

Posted: Mon Mar 03, 2014 7:07 am
by Maryna Brodina

Hello! Could you post error screenshots?


Saving Date into database not working.

Posted: Tue Mar 04, 2014 3:18 am
by frank6683668

Saving Date into database not working.

Posted: Tue Mar 04, 2014 3:21 am
by frank6683668

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


Saving Date into database not working.

Posted: Tue Mar 04, 2014 4:44 am
by Illya Stepanov

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


Saving Date into database not working.

Posted: Tue Mar 04, 2014 4:52 am
by Illya Stepanov

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


Saving Date into database not working.

Posted: Tue Mar 04, 2014 5:02 am
by Illya Stepanov

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


Saving Date into database not working.

Posted: Wed Mar 05, 2014 3:31 am
by frank6683668

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