Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 11:11 AM
Hello Experts,
We have Contracts and under contract related lists "Assets covered" are there
created Before BR insert /update to update the start and end dates its working fine.
Before BR insert /update
Table - clm_m2m_contract_asset
Requirement
Same w want to achieve for the after update the dates needs to update automatically.
We have tried but no luck, kindly support..
(function executeRule(current, previous /*null when async*/) {
var recordUpdated=false;
var asset = new GlideRecord("alm_asset");
asset.addQuery('sys_id',current.asset+"");
asset.query();
if (asset.next()){
if (current.contract.starts!=""){
asset.u_lease_contract_start=current.contract.starts+" 00:00:01";
}
if (current.contract.ends!=""){
asset.u_lease_contract_end=current.contract.ends+" 23:59:59";
}
asset.u_lease_contract=true;
asset.update();
}
})(current, previous);
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 11:28 PM
Hi @akin9
Oops. Just correct these line below. it should do the trick.
grAsset.u_lease_contract_start=current.starts+" 00:00:01";
grAsset.u_lease_contract_end=current.ends+" 23:59:59";
Cheers,
Tai Vu
10 REPLIES 10
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 11:46 PM