Add Special Price to Debtor Class Specific Pricing  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Add Special Price to Debtor Class Specific Pricing

Postby DannyC » Wed Nov 16, 2016 12:01 pm

Hi,
Based on the nice trick to add a column to the Credit Reason Maintenance form ( see viewtopic.php?f=26&t=656), I am trying to add a decimal/money column to Debtor Class Specific Pricing.
I am stuck on one line. In the Save_Ending handler, you have a line
Code: Select all
   Dim creditReason As JiwaSales.Configuration.CreditReasons.CreditReason = creditReasonForm.BusinessLogic(recID)
.
I am trying to do the similar Dim for Debtor Class Pricing but am having trouble with the syntax. I have
Code: Select all
Dim DebtorClass As JiwaInventory.DebtorClassificationInventorySpecific = InventoryForm.BusinessLogic(recID)
but it is not compiling.
I've attached the plugin I've done, see line 79.
Can you have a quick squiz and advise what the correct syntax should be? I have tried various syntaxes and collections but can't seem to get it right.

Cheers
Attachments
Plugin Add Special Price to Debtor Class Pricing.xml
(32.49 KiB) Downloaded 73 times
User avatar
DannyC
Senpai
Senpai
 
Posts: 638
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: Add Special Price to Debtor Class Specific Pricing  Topic is solved

Postby Mike.Sheen » Wed Nov 16, 2016 12:12 pm

DannyC wrote:I am trying to do the similar Dim for Debtor Class Pricing but am having trouble with the syntax. I have
Code: Select all
Dim DebtorClass As JiwaInventory.DebtorClassificationInventorySpecific = InventoryForm.BusinessLogic(recID)
but it is not compiling.


InventoryForm.BusinessLogic will be the Inventory Business Logic - i.e.: the JiwaFinancials.Jiwa.JiwaInventory.Inventory class. That has a property containing the debtor classification pricing - DebtorClassPrices which is of the type DebtorClassificationInventorySpecificCollection.

The following should make it clearer:
Code: Select all
Dim inventoryBusinessLogic As JiwaFinancials.Jiwa.JiwaInventory.Inventory= InventoryForm.BusinessLogic

If inventoryBusinessLogic.DebtorClassPrices.Count > 0
' Following gets the first debtor classification price in the collection
    Dim DebtorClass As JiwaInventory.DebtorClassificationInventorySpecific = inventoryBusinessLogic.DebtorClassPrices(1)
End If


Note that InventoryForm.BusinessLogic(recID) is invalid in this case, as the inventory business logic is not a collection itself - it's of type JiwaApplication.BusinessLogic.Maintenance. The code you based this off was a List Maintenance business logic which is itself a collection, so BusinessLogic(recID) made sense with that type.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 13 guests