Hi There,
I have created an entity where there is an attributes for expected date of closure. In this entity, there is a sub-grid where there are 3 attributes for "expected date of closure". What i want is that main page "expected date of closure" gets updated with latest date available in sub-grid 3 attributes of "expected date of closure". Please help if it is possible.
Thanks in advance
Hanshu
*This post is locked for comments
// Assuming 'Xrm' is the CRM client object model
var subgridControl = Xrm.Page.getControl("your_subgrid_name");
if (subgridControl != null) {
var rows = subgridControl.getGrid().getRows();
// Initialize with a date in the past
var latestDate = new Date(1900, 0, 1);
// Iterate through subgrid rows to find the latest date
rows.forEach(function (row, index) {
var dateValue1 = row.getData().getEntity().getAttributes().get("new_date_attribute_1").getValue();
var dateValue2 = row.getData().getEntity().getAttributes().get("new_date_attribute_2").getValue();
var dateValue3 = row.getData().getEntity().getAttributes().get("new_date_attribute_3").getValue();
// Update latestDate if a newer date is found
if (dateValue1 != null && dateValue1 > latestDate) {
latestDate = dateValue1;
}
if (dateValue2 != null && dateValue2 > latestDate) {
latestDate = dateValue2;
}
if (dateValue3 != null && dateValue3 > latestDate) {
latestDate = dateValue3;
}
});
// Update the main page attribute with the latest date
Xrm.Page.getAttribute("new_expected_date_of_closure").setValue(latestDate);
}
To be honest, even if I have long deadlines I always write my essays at the last moment, I can't put myself to write them peacefully with some days prior. This is why I am always using editing services as due to lack of time I can't concentrate on writing them without mistakes. However, I pay attention to the college essay editing cost because as a student I can't afford every service, but there are many who offer qualitative services at a reasonable price.
This is very much possible. Follow these simple steps to get it done. The trigger point of this logic would play an important role in deciding the overall performance of the solution.
Let me know if this helps.
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... 290,900 Super User 2024 Season 2
Martin Dráb 229,275 Most Valuable Professional
nmaenpaa 101,156