Hi...How can we get Internal ID of a record type i...
# suitescript
s
Hi...How can we get Internal ID of a record type in suitescript if I already have the script ID ("customrecord_my_record_type")? For example, I need internal id=852 of my custom record
m
there's probably a better way, but i parse the resolved record url, snippet below
Copy code
var customRecordUrl = url.resolveRecord({recordType: 'customrecord_xyz'});
var customRecordId = getRecordTypeId(customRecordUrl);
function getRecordTypeId(recordUrl){
    var startIdx = recordUrl.indexOf('rectype=');
    var paramStr = recordUrl.substring(startIdx, recordUrl.length);
    return paramStr.substring(8, paramStr.indexOf('&'));
}
s
Thanks @mbrewer, will try this out.