| **Navigation:**  [[abc library reference.htm|ABC Library Reference]] > ErrorClass > ErrorClass Methods >====== SetField (set the substitution value of the %Field macro) {{c6h0009.jpg|C6H0009.jpg}} ====== | [[setfatality set severity level for a particular error .htm|{{btn_prev_n.gif|Previous page}}]][[abc library reference.htm|{{btn_home_n.gif|Return to chapter overview}}]][[setfieldname set field name that produced the error .htm|{{btn_next_n.gif|Next page}}]] | | || **SetField(**// fieldname //**)** {{blk2blue.jpg|blk2blue.jpg}} | **SetField** | Sets the substitution value of the %Field macro. | | //fieldname// | A string constant, variable, EQUATE, or expression that indicates which field produced the error. | The **SetField **method sets the substitution value of the %Field macro. This value replaces any %Field symbols within the error message text. **Implementation:** Assigns the //fieldname //parameter to the ErrorClass.FieldName property. **Example:** ** !Lookup on State Code failed** ** GlobalErrors.SetField('State')  !set field that failed** ** GlobalErrors.ThrowMessage(Msg:FieldNotInFile,'State File')  !process the error** **See Also:**     [[fieldname field that produced the error .htm|FieldName]]