CoverageAmount

Discussions related to order tracking development with the ProForm module.

Moderator: Phil Barton

shawnregan
Posts: 22
Joined: Tue Dec 11, 2018 10:03 am

CoverageAmount

Post by shawnregan »

I'm trying to write to the CoverageAmount for LoanPolicy. But it keeps telling me that Order doesn't contain a title or TitleInsuranceCalculations.

order.TitleInsuranceCalculations[1].LoanPolicy.PremiumCalculation.CoverageAmount
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: CoverageAmount

Post by BobRichards »

Order.Title.TitleInsuranceCalculations...
Bob Richards, Senior Software Developer, SoftPro
shawnregan
Posts: 22
Joined: Tue Dec 11, 2018 10:03 am

Re: CoverageAmount

Post by shawnregan »

Thanks. I made the correction and I am getting the following error.

Cannot access member.

order.Title.TitleInsuranceCalculations[0].LoanPolicy.PremiumCalculation.CoverageAmount
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: CoverageAmount

Post by BobRichards »

Please post your code (and use the </> button so the tabs/spaces are preserved).
Bob Richards, Senior Software Developer, SoftPro
shawnregan
Posts: 22
Joined: Tue Dec 11, 2018 10:03 am

Re: CoverageAmount

Post by shawnregan »

Code: Select all

Order.Title.TitleInsuranceCalculations[0].LoanPolicy.PremiumCalculation.CoverageAmount = Convert.ToDecimal(((LocalOrder)tState.LocalOrder).LoanPolicyCoverageAmount);
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: CoverageAmount

Post by BobRichards »

Ok. Very pretty.

Do you have any diagnostic results? Is this C# or a custom order rule. Are the objects null? Do you have any other information to share? I could use a dash of context to go with the code.
Bob Richards, Senior Software Developer, SoftPro
shawnregan
Posts: 22
Joined: Tue Dec 11, 2018 10:03 am

Re: CoverageAmount

Post by shawnregan »

Code: Select all

EXCEPTION
Method: set_Value
Error Message: Cannot access member.

Stack Trace:
   at SoftPro.EntityModel.Field`1.set_Value(T value)
   at PremiumCalculation.set_CoverageAmount(Decimal )
   at CallSite.Target(Closure , CallSite , Object , Decimal )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
I am using C#. This is when we are opening a new order.
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: CoverageAmount

Post by BobRichards »

Can you do it from the Select UI?

If you can do the same action in the Select UI, then try breaking down the dynamic expression on the left of the equals sign into multiple steps. I have found on multiple occasions where the DLR engine will not be able to handle "deep drilling" like this. I don't know why. As an experiment, try below and let me know if it acts any differently.

Code: Select all

var title = Order.Title
var tic = title.TitleInsuranceCalculations[0];
var lp = tic.LoanPolicy
var prem = lp.PremiumCalculation;
prem.CoverageAmount = 100000m
Bob Richards, Senior Software Developer, SoftPro
shawnregan
Posts: 22
Joined: Tue Dec 11, 2018 10:03 am

Re: CoverageAmount

Post by shawnregan »

Did as you suggest and got the same results. I will try with the Select UI.
shawnregan
Posts: 22
Joined: Tue Dec 11, 2018 10:03 am

Re: CoverageAmount

Post by shawnregan »

The fields for that section of the order are disabled for me in the SPS UI.
Post Reply