(first topic was marked as spam)
Hi,
i’m using the prompter dialog to enter text and date/time for a new cild record:
…
let prompter = Prompter.new();
prompter.addParameter(‘Note:’, ‘note’, ‘text’)
.addParameter(‘DateTime:’, ‘datetime’, ‘date_time’)
.show(‘Message prompt’, callbackFunction);
The field “Note” is filled with the texted i entered in the dialog, but “DateTime” is still empty. What is wrong with my script?
Is it possible to add days/weeks/years (choosing from picklist in the prompter dialog) to the current date and add the result in the DateTime field in the created record?
Thanks
Chris
The third parameter is a field type but I don’t think date_time
is a valid type, certainly it doesn’t appear in the documentation.
This populates the variables how I expect them on TF 5.3.15 (972):
var note;
var datetime;
function callbackFunction() {
console.log('Callback');
console.log('Note:');
console.log(note);
console.log('Date Time:');
console.log(datetime);
}
let prompter = Prompter.new();
prompter.addParameter('Note:', 'note', 'text')
.addParameter('DateTime:', 'datetime', 'date_time')
.show('Message prompt', callbackFunction);
Thanks for your suggestion. Still does not work. Where can i find the documentation?
I took “date_time” from https://www.tapforms.com/help-mac/5.3/en/topic/javascript-api
Attachments:
You must be
logged in to view attached files.
… and how can i automatically open the created record after confirming prompt?
Life is difficult… ;-)
getFieldsForType
is for getting fields from a form not for the prompter, the prompter section at the bottom has a list of the supported types as the examples.
You can use openUrl
to open a record, something like this should work:
Utils.openUrl(targetRecord.getUrl());
Change targetRecord
to be the variable of the record you want to open.