Page 1 of 1

Setting a custom field on a sales order

PostPosted: Fri Sep 12, 2014 4:50 pm
by jeromeh
I am trying to set an historical custom field on a sales order in JIWA 7 using the JIWA DLLs

MyJiwaSalesOrder.CustomFieldValues("WebRef").Contents = webid

Used to be done as above in JIWA 6.5.

How would I do this is JIWA 7? and is there a reference I should be using to find this information myself?

Re: Setting a custom field on a sales order  Topic is solved

PostPosted: Fri Sep 12, 2014 5:41 pm
by Mike.Sheen
jeromeh wrote:I am trying to set an historical custom field on a sales order in JIWA 7 using the JIWA DLLs

MyJiwaSalesOrder.CustomFieldValues("WebRef").Contents = webid

Used to be done as above in JIWA 6.5.

How would I do this is JIWA 7?


Hi Jerome,

The custom fields attached to the sales order header are in a property of the sales order named CustomFieldValues. To set the desired value, you need to locate the one in the collection related to the custom field - ie:

Code: Select all
For Each customFieldValue As JiwaApplication.CustomFields.CustomFieldValue In salesOrder.CustomFieldValues
    If customFieldValue.CustomField.PluginCustomField.Name = "WebRef" Then
        customFieldValue.Contents = "test"
        Exit For
    End If
Next


Attached is a plugin which demonstrates this.

Plugin Sales Order Set Custom Field Contents.xml
Sample Plugin
(33.23 KiB) Downloaded 189 times


jeromeh wrote:and is there a reference I should be using to find this information myself?


As mentioned here, there is on-line reference material - most of it is auto-generated, but we are expanding it with more useful content as it becomes apparent which areas need more detailed content - such as here.

Mike