CoverageAmount

Discussions related to order tracking development with the ProForm module.

Moderator: Phil Barton

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

CoverageAmount

Post by shawnregan » Wed Dec 11, 2019 5:24 pm

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: 1007
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: CoverageAmount

Post by BobRichards » Wed Dec 11, 2019 5:28 pm

Order.Title.TitleInsuranceCalculations...
Bob Richards, Software Developer, SoftPro

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

Re: CoverageAmount

Post by shawnregan » Wed Dec 11, 2019 5:50 pm

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

Cannot access member.

order.Title.TitleInsuranceCalculations[0].LoanPolicy.PremiumCalculation.CoverageAmount

BobRichards
Posts: 1007
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: CoverageAmount

Post by BobRichards » Wed Dec 11, 2019 5:54 pm

Please post your code (and use the </> button so the tabs/spaces are preserved).
Bob Richards, Software Developer, SoftPro

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

Re: CoverageAmount

Post by shawnregan » Wed Dec 11, 2019 6:19 pm

Code: Select all

Order.Title.TitleInsuranceCalculations[0].LoanPolicy.PremiumCalculation.CoverageAmount = Convert.ToDecimal(((LocalOrder)tState.LocalOrder).LoanPolicyCoverageAmount);

BobRichards
Posts: 1007
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: CoverageAmount

Post by BobRichards » Wed Dec 11, 2019 6:24 pm

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, Software Developer, SoftPro

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

Re: CoverageAmount

Post by shawnregan » Thu Dec 12, 2019 11:45 am

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: 1007
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: CoverageAmount

Post by BobRichards » Thu Dec 12, 2019 11:57 am

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, Software Developer, SoftPro

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

Re: CoverageAmount

Post by shawnregan » Thu Dec 12, 2019 12:13 pm

Did as you suggest and got the same results. I will try with the Select UI.

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

Re: CoverageAmount

Post by shawnregan » Thu Dec 12, 2019 3:46 pm

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

Post Reply