Reputation: 457
I'm trying to upsert Journal Lines with Mule ESB, using the NetSuite connector. In our setup there are a lot of custom fields, some are required. There is a Journal Entry with several lines, which has to be posted to NS, using an upsert operation, but I'm stuck with custom fields.
Here is what I tried so far:
Unfortunately the documentation is not mentioning custom fields at all. Anyone can tell me a working approach?
Upvotes: 0
Views: 995
Reputation: 457
...spoke a moment too soon. I found the solution.
The structure of the "customField" entry has to be List<Map<String,Object>>
where Object
is either a CustomFieldRef
or anything else.
In case of CustomFieldRef
the key of the map is ignored, and the value is copied over unchanged to the message.
In case of other class the key of the map has to be the following format: FieldTypeClass__fieldname
(where __ is the separator.) Thus SelectCustomFieldRef__custbody_source_system
results in a SelectCustomFieldRef
object with scriptId
set to custbody_source_system
.
Example:
%dw 1.0
%output application/java
---
{
internalId : 123456,
tranId : 'TR-2016-01',
customFieldList : {
customField : [
StringCustomFieldRef__custbody_payment_url : 'http://www.example.com'
]
}
}
Upvotes: 1