Is it possible to script the Depreciation History ...
# suitescript
l
Is it possible to script the Depreciation History records? I can't see it on the Records Browser. Is is not shown because it's part of FAM or it's really not scriptable?
s
I am not familiar with this module at all, what is the internalid of the depreciation history record?
l
691
It's Fixed Asset Management.
s
Well, lets back up, what do you mean by script the depreciation record. Create them via script, add a client script to them, etc?
l
Create a scheduled script to delete those records based on a saved search.
s
Why would want to delete the histories that are automatically created with the bundle? My guess is it's just a custom record, what is the record type if you navigate to one of the records.
l
Yes, it is indeed a custom record from FAM. We want to delete them because the users accidentally imported mid-life assets' depreciation history with wrong info. 33k+
s
Then you don't need the records browser, custom records would not be in there.
l
Where would I find it? Thanks.
s
You just said it's a custom record, use the id of the custom record, like
customrecord_whateverishere
instead of
record.Type.something
l
Hi, I'm sorry but I can't see where the id of the custom record is.
s
Check the definition of the bundle, or look in the custom record list. It should show you the id.
l
Thank you so much! It worked. How to rerun the scheduled script automatically after reaching the governance limit?
s
Use a map/reduce instead to delete a bunch of records, no need to requeue.
l
Alright. I will search about that. By the way, will try and catch solve my issue on requeue? Thanks.
var count=0; var counter=0; var result=[]; var testSearch = search.create({ type: 'customrecord1', filters: [ 'custrecord_date_created', 'notonorafter', 'startOfLastMonth' ], columns: [ 'internalid' ] }); do{ var resultSearch = testSearch.run().getRange({ start : count, end : count+1000 }); for(var arr=0;arr<resultSearch.length;arr++){ result.push(resultSearch[arr]); } counter = count+counter; }while(resultSearch.length >= 1000 && counter != 4000); return result;
I found this example. Does it have a 4000 limit or I can adjust it?