Announcements
Hi all,
Hope everyone is safe and sound. I am new to dynamics and wondered what would be the correct solution to make the system automatically fill in the date field (step 4 in the scenario below)
User scenario:
Could someone please advice if we can write business rules or add a JavaScript to fulfil step 4? Perhaps someone has solved similar challenges?
Hi,
You can create a Calculated field first:
For more details on creating Calculated field, you can refer to this official documentation:
And then you can create a Business rule to judge whether the Field A is Yes:
For more details on creating business rules, please refer to this official documentation:
This is my result:
If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.
Best Regards,
Frank Gong
Hi,
here the code:
var test = test || {};
test.Customizing = {
Load: function () {
Xrm.Page.getAttribute("your-field-with-value").addOnChange(this.AddYear);
},
AddYear: function () {
var fieldBValue = Xrm.Page.getAttribute("your-field-with-value").getValue();
var fieldCValue = new Date(fieldBValue.getFullYear() + 5, fieldBValue.getMonth(), fieldBValue.getDate());
Xrm.Page.getAttribute("your-field-to-update").setValue(fieldCValue);
}
};
add it to js file. Register it on Form to OnLoad Event.
Greetz
Hello,
There are some solutions for your scenario:
1. Write a Javascript
2. Write a system workflow
3. you can make field B a calculated field and add 5 years to it. Please see the below screenshot:
André Arnaud de Cal...
294,095
Super User 2025 Season 1
Martin Dráb
232,866
Most Valuable Professional
nmaenpaa
101,158
Moderator