I have a process that retrieves an order fulfillment transaction, creates an external ASN document and then updates a custom checkbox on the fulfillment to reflect the ASN was created.
When I do this, NetSuite attempts to compare and update a number of fields. Can this be prevented? I am getting errors on protected fields.
Below is my code:
tsr = webService.search(tsb)
' Update Centerstone ASN Created Flag
If tsr.status.isSuccess And Not tsr.recordList Is Nothing And tsr.recordList.Length > 0 Then
Dim iff As ItemFulfillment = DirectCast(tsr.recordList(0), ItemFulfillment)
For i = 0 To iff.customFieldList.Length - 1
If iff.customFieldList(i).scriptId = "custbody_centerstone_asn_created_flag" Then
' Set Centerstone ASN Created Flag to True
Dim asnc As BooleanCustomFieldRef = New BooleanCustomFieldRef
asnc.scriptId = "custbody_centerstone_asn_created_flag"
asnc.value = True
iff.customFieldList(i) = asnc
asnc = Nothing
' Update Item Fulfillment
Dim response As WriteResponse = webService.update(iff)
' Exit Loop, update performed
Exit For
End If
Next
End If