CoverageAmount
Moderator: Phil Barton
-
- Posts: 22
- Joined: Tue Dec 11, 2018 10:03 am
CoverageAmount
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
order.TitleInsuranceCalculations[1].LoanPolicy.PremiumCalculation.CoverageAmount
-
- Posts: 1382
- Joined: Wed Jan 15, 2014 3:50 pm
- Location: Raleigh, NC
- Contact:
Re: CoverageAmount
Order.Title.TitleInsuranceCalculations...
Bob Richards, Senior Software Developer, SoftPro
-
- Posts: 22
- Joined: Tue Dec 11, 2018 10:03 am
Re: CoverageAmount
Thanks. I made the correction and I am getting the following error.
Cannot access member.
order.Title.TitleInsuranceCalculations[0].LoanPolicy.PremiumCalculation.CoverageAmount
Cannot access member.
order.Title.TitleInsuranceCalculations[0].LoanPolicy.PremiumCalculation.CoverageAmount
-
- Posts: 1382
- Joined: Wed Jan 15, 2014 3:50 pm
- Location: Raleigh, NC
- Contact:
Re: CoverageAmount
Please post your code (and use the </> button so the tabs/spaces are preserved).
Bob Richards, Senior Software Developer, SoftPro
-
- Posts: 22
- Joined: Tue Dec 11, 2018 10:03 am
Re: CoverageAmount
Code: Select all
Order.Title.TitleInsuranceCalculations[0].LoanPolicy.PremiumCalculation.CoverageAmount = Convert.ToDecimal(((LocalOrder)tState.LocalOrder).LoanPolicyCoverageAmount);
-
- Posts: 1382
- Joined: Wed Jan 15, 2014 3:50 pm
- Location: Raleigh, NC
- Contact:
Re: CoverageAmount
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.
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
-
- Posts: 22
- Joined: Tue Dec 11, 2018 10:03 am
Re: CoverageAmount
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)
-
- Posts: 1382
- Joined: Wed Jan 15, 2014 3:50 pm
- Location: Raleigh, NC
- Contact:
Re: CoverageAmount
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.
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
-
- Posts: 22
- Joined: Tue Dec 11, 2018 10:03 am
Re: CoverageAmount
Did as you suggest and got the same results. I will try with the Select UI.
-
- Posts: 22
- Joined: Tue Dec 11, 2018 10:03 am
Re: CoverageAmount
The fields for that section of the order are disabled for me in the SPS UI.