Question:
Is it possible to add custom code to a SmartObject method?
Example:
I want to write a function which accesses a webservice, retrieving between 1 and n payment terms. Each term has a payment plan (monthly, quarterly and yearly) and a number of periods (ex 24). I want my SmartObject method to return the sum of all these payment terms in months:
- Term 1 8 periods (monthly) = 8 x 1 = 8 months
- Term 2 4 periods (quarterly) = 4 x 3 = 12 months
- Term 3 2 periods (yearly) = 2 x 12 = 24 months
- Term 4 2 periods (monthly) = 2 x 1 = 2 months
Expected result:
In this example the function would need to return 46 months. (8 + 12 + 24 + 2)