Exception trying to set up a field value

Discussions related to custom development with Select.
BobRichards
Posts: 1060
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Exception trying to set up a field value

Post by BobRichards » Tue Apr 13, 2021 10:20 am

I am curious about one comment you made you said earlier.
According to our Business side she can change it on the UI without any issues. One thing I have wondered. See, in my code I use a simple assignment, and in yours you use the SetProperty method.. any differences?
Are you both using the same system and username/password or different setups? The intent was to rule out any ways that your development setup and credentials might be different from those that have some permission enabled or other environmental difference.
Bob Richards, Software Developer, SoftPro

merak.marey
Posts: 14
Joined: Fri Oct 30, 2020 10:41 am

Re: Exception trying to set up a field value

Post by merak.marey » Thu Apr 15, 2021 1:36 pm

Hi Bob

The process does not use the same username/password, but as stated before, same process does not fail in other orders.

The user for this process has admin rights.

Thanks

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

Re: Exception trying to set up a field value

Post by BobRichards » Fri Apr 16, 2021 11:28 am

I cannot replicate your error. I open the order and pass it and the SelectServer instances to my method. I have used your code as much as possible but it did not fail when setting the BuyerPaidAtClosing property.

Code: Select all

public AggregateAdjustment(SelectServer ss, IOrder order)
{
    // Get Escrow section lines.
    IList lines = ((IOrderItem)order.GetProperty<IList>("CDFs")[0])
        .GetProperty<IOrderItem>("EscrowSection")
        .GetProperty<IList>("Lines");

    // Find the 
    var AdjustmentOrderLine = (dynamic)((IEnumerable)lines).Cast<dynamic>()
        .Where(p => p.Description == "Aggregate Adjustment" || (dynamic)((IEnumerable)p.Charges).Cast<dynamic>()
        .Where(c => c.Description == "Aggregate Adjustment").ToList().Count() > 0).ToList().FirstOrDefault();

    if (AdjustmentOrderLine != null)
    {
        AdjustmentOrderLine.Charges.Clear();
        //if (EncompassObject.agregateAdjustment != 0)
        {
            AdjustmentOrderLine.Charges[0].BuyerPaidAtClosing = 666m; // HERE - 1422
            AdjustmentOrderLine.Charges[0].Payees[0].IsDeducted = false;
            AdjustmentOrderLine.Charges[0].Payors[0].ProcessAs = SoftPro.OrderTracking.Client.Orders.ProcessAs.ReduceFunds;
        }
    }
}
The code correctly finds the "Aggregate Adjustment" line G.08 and modifies the BorrowerPaidAtClosing and payee/payor properties.
Bob Richards, Software Developer, SoftPro

merak.marey
Posts: 14
Joined: Fri Oct 30, 2020 10:41 am

Re: Exception trying to set up a field value

Post by merak.marey » Tue Apr 20, 2021 1:06 pm

Hi Bob

As mentioned before, the same code works perfectly for the big majority of the orders. But in some cases it does fails, rendering the BuyerPaidAtClosing property read-only.

We just need an explanation on why this may be happening so our Business can do the appropiate research.

Thanks

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

Re: Exception trying to set up a field value

Post by BobRichards » Tue Apr 20, 2021 1:25 pm

I do not have a reason. Production needs to furnish the criteria or example orders that have this failure mode. Then we can analyze the order for the root cause. Without any information at all, it is just likely that there was a networking error as any other error mechanism I could postulate. Sorry.
Bob Richards, Software Developer, SoftPro

Post Reply