Dynamic Field Population and Conversion Logic Based on System Units for Mass and Length in Form

In the PurchTotals form extension, within the existing class, the setDisplayfields() method should be revised. I need these subrequirments :

  1. If no system unit is set up for unit class Mass/Length, then show “0” in new fields i.e if no default unit is set for example default unit is not set as lbs or inch then the new fields should be 0
  2. If system units are kg and m - show the same value as original fields i.e there already exists two fields for mass and length the values in new fields should be same as the value in exisisting fields :
    If system unit for class Mass has Fixed unit = Kilograms, then Weight in kg = Weight
    If system unit for class Length has Fixed unit = Meters, then Volume in cbm = Volume
  3. If system units are NOT kg and m - recalculate based on standard unit conversions from system units to kg and meter(must be set up beforehand)