```function customizeGlImpact(transactionRecord, s...
# suitescript
c
Copy code
function customizeGlImpact(transactionRecord, standardLines, customLines, book) {
    var recordID = transactionRecord.id;
    nlapiLogExecution('DEBUG', 'recordID ', transactionRecord.id);
recordID === null on first save
p
If it's a new record and you're in a
beforeSubmit()
then the record won't have an internalid yet. It's available in
afterSubmit()
c
@PNJ I don't think you get to specify before or after in a custom GL script?
p
Oh, my bad. Was relaying UE info
z
Not tested, but I am sure that Custom GL impact is executed in "before stage"... At that moment, transaction is not saved. GL lines (standard and custom) must be created by main transaction and saved as sublist data. Additionally, if custom gl impact script failed (generate error or an exception) whole transaction wouldn't be saved. Summarized, ID of transaction does not exist during Create event