Settlement Location - Settlement Location Type
Posted: Mon May 17, 2021 9:59 am
On the Order Information screen in SPS there is a Settlement Location. It includes a Settlement Location Type radio button, backed by the SettlementLocationType enum values of Contact, Property, Other.
I am attempting to programmatically alter the SettlementLocation using the API while the order is open (getting a reference to the active order). I come into the order with the default SettlementLocationType (Contact) and want to switch it to Other, then update the details.
After some trial and error I learned that one cannot directly write to the SettlementLocationType property on the Order.SettlementLocation object. Although it has a public SET, altering it raises a member access exception. What does seem to work, generally speaking, is to set. This moves the OtherSettlementLocation object into the Place, and causes SPS to update the Order.SettlementLocation.SettlementLocationType to "Other". Exactly what I wanted.
The problem? The SPS Shell UI does not actually change the value of the radio button, causing my changes to be "invisible". Is something in the above incorrect? When I take this same approach server side without having the order open in the Shell, the changes play out as I hope, with the radio button showing settlement location type of Other on next order load.
I am attempting to programmatically alter the SettlementLocation using the API while the order is open (getting a reference to the active order). I come into the order with the default SettlementLocationType (Contact) and want to switch it to Other, then update the details.
After some trial and error I learned that one cannot directly write to the SettlementLocationType property on the Order.SettlementLocation object. Although it has a public SET, altering it raises a member access exception. What does seem to work, generally speaking, is to set
Code: Select all
Order.SettlementLocation.Place = Order.SettlementLocation.Other
The problem? The SPS Shell UI does not actually change the value of the radio button, causing my changes to be "invisible". Is something in the above incorrect? When I take this same approach server side without having the order open in the Shell, the changes play out as I hope, with the radio button showing settlement location type of Other on next order load.