function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lucas LargeLucas Large 

Birthdate not mapping over

Im having a problem with a custom script out of Laserfiche Workflow. I have it setup to send a birthday over to a salesforce contact. Everything in the code looks good but the birthdate does not come over. Here is an example of the code. 

s = GetTokenValue("RetrieveFieldValues_Birthdate").ToString();
            if (string.IsNullOrEmpty(s) == false)
            {
            string date = s;
            DateTime dt = Convert.ToDateTime(date);
            contact.Birthdate = dt;
            }

Has anyone else had this issue or can you guys see whats going wrong. Thank you.
 
pconpcon
If you output the value of s to the debug logs what do you get?  What is the content of the Class Convert and it's toDateTime method?  This is not the standard way of parsing strings to dates in Salesforce.
Lucas LargeLucas Large
I have no idea. This is a project that was handed to me so it was writen by a former emplyoee. All the other fields that are sent to Salesforce are working, just not this one. How do I setup the debug logs? That is something I looked for but was having trouble finding. Thanks for the help. 
pconpcon
If the code is running as your current user, you can simply open up the developer console and montior the logs there.  Otherwise you can goto setup -> monitoring -> debug logs and add a log for your user.
Chad Saar 8Chad Saar 8
I dont have the option to click debug logs under monitoring, is theresometing the admin need to do to this account to get that option?
 
Chad Saar 8Chad Saar 8
Also this is Lucas
 
pconpcon
If you are not a System Administrator then you will not have access to the debug logs.
Lucas LargeLucas Large
I got my admin to make my account and admin account. I have the debug console now but i'm having trouble finding where you would see the information being pushed over. Can you help piont me in the right direction. Thanks.
pconpcon
You'll want to add System.debug [1] output to your code in and around this if statement to verify that the data is being set correctly.  Then, you will want to either start the code running as your user and view the debug logs in the developer console, or start logging for your integration user (as described previously) and then start your code running as that integration user.