问题
If the form I am on is in edit mode, and I add items to the sublist (A child custom record) via my suitescript I can not get the list that is visible to the customer to refresh/update.
I have attempted to use the following command, but then found that it only works on a static / read only list.
// Refresh the package contents list
nlapiRefreshLineItems('recmachcustrecord_myCustomRecord');
Is there a way to force a sublist/child record to update its view when the parent transaction form is in edit mode?
On my form I have clicked my "Do Something" button which is to create child records. After the records are created the transaction form does not update the sublist. When I exit edit mode the form then realizes the new lines and displays them.
Thank you,
回答1:
You may have other fields on the record that are not saved yet.
In order to do what you want you'd have to save the record and reopen it with your script.
Here is an example from Netsuite help of saving and reopening a record:
try
{
//committing the phone call record to the database
var callId = nlapiSubmitRecord(call, true);
nlapiLogExecution('DEBUG', 'call record created successfully', 'ID = ' + callId);
//Redirect the user to the newly created phone call
nlapiSetRedirectURL('RECORD', 'phonecall', callId, false, null);
}
catch (e)
{
nlapiLogExecution('ERROR', e.getCode(), e.getDetails());
}
来源:https://stackoverflow.com/questions/21858783/netsuite-sublist-child-record-does-not-update-refresh-in-edit-mode