First - I know this may be a dumb question, and Iām NOT a very seasoned developerā¦so please be gentle
Iām trying to create lead records in Suite via posting a form to the webform endpoint:
http://{{mydomian}}/index.php?entryPoint=WebToPersonCapture
Iām trying to pass in a datetime field (ie. Lead Appointment Date), but Iām struggling to get it to work.
Iāve already created the datetime field in the Lead module.
Iām seeing 2 issues:
#1 - it seems that you can not use a date time field in the webform builder. I think that this is a known issueā¦and Iām guessing itās not easily solvable. I donāt strictly need to use the form builder, but I was using it to dump out the āformatā of the data/fields so I can match that format when sending data to that endpoint. So Iām guessing this is not the way to goā¦
#2 - so the ārealā issue I may be having is that Iām not āformattingā the datetime correctly?
Iāve tried MANY different formatsā¦but I āthinkā the format itās expecting is:
2016-04-15T18:47:00-05:00
but this seems not to work either.
I know that I likely āshouldā use the new API, rather than curl-ing over to the webform endpointā¦but is there an easy solution to what Iāve already set up??
Iāve created a ādatetimeā field in the Lead module using the Studio.
Iāve not done anything to change the format of that fieldā¦but, Iām not able to add that field to the Person Creation form in SuiteCrm.
So, Iām posting to the form endpoint with custom scriptā¦but for some reason the datetime isnāt being accepted by the endopointā¦and I canāt figure out why.
Iām āguessingā I donāt have the format correctā¦but not 100% sure.
Here is the format Iām sendingā¦
2016-04-15T18:47:00-05:00
@TobyTkd
The webform endpoint:
http://{{mydomian}}/index.php?entryPoint=WebToPersonCapture
support only text type fields. If you want to use date you should load javascript which will make correctly the date field.
Yes, Iām already using an outside process to send the POST to the endpoint. (PHP via curl)
Iām sending a string in the POST with this parameter:
demo_1_apt_text_temp_c=2016-04-15T18:47:00-05:00
(where demo_1_apt_text_temp_c is the custom field Iāve created)
Howeverā¦the data seems not to populate that fieldā¦and Iām not sure why.
Iām guessing that the field may want a different format, but Iām not sure what that might be, or how to figure it out.
I wouldnāt be surprised to discover that it needs an additional if clause there, to check if the field is a datetime, to insert the value properlyā¦
EDIT: also, check if itās the $possiblePersonCaptureFields mechanism that is blocking your field.
@TobyTkd
You should look at format date of user (screenshot) who make the form. The variable of $_POST use format ā01/04/2020 15:30ā for this example.