SO_CustomSettingValues - Cannot set them as in Jiwa6  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

SO_CustomSettingValues - Cannot set them as in Jiwa6

Postby jeromeh » Fri Jun 12, 2015 2:58 pm

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?
jeromeh
Occasional Contributor
Occasional Contributor
 
Posts: 17
Joined: Wed Apr 08, 2009 9:53 am

Re: SO_CustomSettingValues - Cannot set them as in Jiwa6

Postby Scott.Pearce » Fri Jun 12, 2015 3:09 pm

Try something like:

Code: Select all
Dim myCustomField As JiwaApplication.CustomFields.CustomFieldValue = MyJiwaSalesOrder.CustomFieldValues.ItemFromSettingName(fieldname)
myCustomField.Contents = fieldValue
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230

Re: SO_CustomSettingValues - Cannot set them as in Jiwa6

Postby jeromeh » Mon Jun 15, 2015 10:49 am

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?
jeromeh
Occasional Contributor
Occasional Contributor
 
Posts: 17
Joined: Wed Apr 08, 2009 9:53 am

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

Postby Scott.Pearce » Wed Jun 17, 2015 10:42 am

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.
Attachments
CustomFieldTest.rar
(146.13 KiB) Downloaded 490 times
Plugin Sales Order Custom Setting Sample.xml
(33.87 KiB) Downloaded 761 times
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 0 guests