Page 1 of 1

SO_CustomSettingValues - Cannot set them as in Jiwa6

PostPosted: Fri Jun 12, 2015 2:58 pm
by jeromeh
We used to set custom settings in Jiwa 6.5 using the below line of code:
MyJiwaSalesOrder.CustomFieldValues(fieldname).Contents = fieldValue

Our application is in VB and is referencing the Jiwa COM DLLs in the same way we did for 6.5.

However now using Jiwa 7.115 the CustomFieldValues collection always seems to be empty, which is stopping us from setting any custom setting values.

Is there something that has changed in how custom settings should be getting set?
Or is there something new we need to do in our application to have the collection populated?

Re: SO_CustomSettingValues - Cannot set them as in Jiwa6

PostPosted: Fri Jun 12, 2015 3:09 pm
by Scott.Pearce
Try something like:

Code: Select all
Dim myCustomField As JiwaApplication.CustomFields.CustomFieldValue = MyJiwaSalesOrder.CustomFieldValues.ItemFromSettingName(fieldname)
myCustomField.Contents = fieldValue

Re: SO_CustomSettingValues - Cannot set them as in Jiwa6

PostPosted: Mon Jun 15, 2015 10:49 am
by jeromeh
I have tried this in our application, however the result returned is Nothing.

I have tried both ItemFromSettingID("000000001V000000000U") and ItemFromSettingName("Priority") for the following sales order custom setting in my local Jiwa 7.0.115 Demo database.

SettingID: 000000001V000000000U
SettingDescription: Priority
SettingName: Priority
CellType: 8


The problem seems to stem from the fact that the MyJiwaSalesOrder.CustomFieldValues collection is empty, but I do not know why this is so or if there is anything else I need to do to have it populated.

Am I missing some references or extra steps that are now required in 7.0.115?

Re: SO_CustomSettingValues - Cannot set them as in Jiwa6  Topic is solved

PostPosted: Wed Jun 17, 2015 10:42 am
by Scott.Pearce
Here is a plugin that Mike put together (thanks Mike!). I've tested it against 7.0.115.

The plugin creates a customer field called "Priority" for sales orders. If the reference field of the sales order is edited, the custom field gets updated with the current date and time.

I've also created an .exe that uses the same code.