Setting specific properties on cost for PersonalAutoCovCostData
The cost data setSpecificFieldsOnCost method needs to populate the line-specific (non-core) properties.
The setSpecificFieldsOnCost
method first calls out to the superclass version, then sets the coverage
and vehicle IDs. This code calls the setFieldValue
method using the fixed ID Key object. Foreign keys on effective-dated
(revisionable) entities store the value of the FixedId of the referenced entity.
The alternative is to try to find an actual reference to the entity in
question by traversing all over the entity graph, which would be resource-intensive
and error-prone. Thus, calling setFieldValue
is the easiest approach.
In the policy auto line, the setSpecificFieldsOnCost method is shown below.
override function setSpecificFieldsOnCost(line : PersonalAutoLine,
cost : PersonalAutoCovCost) : void {
super.setSpecificFieldsOnCost(line, cost)
cost.setFieldValue( "PersonalAutoCov", _covID )
cost.setFieldValue( "PersonalVehicle", _vehicleID )
}
