Is there a way to get a date field to autopopulate with the current date without having to use code?
*This post is locked for comments
Is there a way to get a date field to autopopulate with the current date without having to use code?
*This post is locked for comments
Hi
You can try the following code plz change the schema name and write the js onChange event on form properties
function test()
{
var _ContractStartDate = Xrm.Page.getAttribute("new_contractstartdate").getValue();
if (Xrm.Page.getAttribute("new_contractstartdate") != null) {
var ContractStartDate = new Date(_ContractStartDate.getMonth() + 1 + "/10/" + _ContractStartDate.getFullYear())
Xrm.Page.getAttribute('new_contractstartdate').setValue(ContractStartDate);
}
else {
Xrm.Page.getAttribute('new_contractstartdate').setValue(null);
}
}
Thanks,
On schema name - "suc_paymentduedate" fieldname - PaymentDueDate on the Main form i need to do.. i had to create the field it was not created...
Thanks
I am asking about attribute in which you want to show date
(like this every month the date of that particular field will change the month but date will remain 10th).
Is this field created by you?
Thanks
Hi Ridhima,
The form is Main form type, if that is what you asked was, am new to CRM....sorry may be I am sounding funny :(
Hi Sucharita.
Are you using custom field of date and time type?
Thanks
i want a field to show date 10th day of month. Suppose it is April then it should show 10 April 2018 or 10/04/2018 like this every month the date of that particular field will change the month but date will remain 10th, how to do using javascript on CRM form. Can you please help???
does real time work flow on creation of..... mean I have to click save?
I would love to have a date field that autopopulates as today as the form opens. Not as the form saves.
thanks!
Allready found the solution by a small script:
function updateDateField(startdate) {
var currentDateTime = new Date();
Xrm.Page.getAttribute(startdate).setValue(currentDateTime);
}
Hi Karth, this is something that runs in the background am I right? What do I need to do if I want to have the date predefined on the form. So a default value (data of today) and I can adjust it later and then save the form?
For the records already created, you can follow the same approach, but using the on-demand workflows. You can then select the records through Advanced Find, and run the on-demand workflow.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,235 Most Valuable Professional
nmaenpaa 101,156