I have a UDF checkbox on the GL_Account maintenance called UDF_DONATION. What I want to do in the Table Pre-Write is to check to see if there is another GL Account record where this UDF_DONATION is already set to "Y". If there is another record with the UDF_DONATION field set to "Y" I would like the script to change the UDF_DONATION on the GL Account that was found to have the UDF_DONATION field set to "Y" to "N". Then save the current GL Account change through the standard process.
I have figured out how to find the existing record (not the current record since the script is being executed during the Pre-Write Object) where the UDF_DONATION is "Y". I am using a SQL search to find this record.
The problem I am having is how to change the UDF_DONATION field from "Y" to "N" for the secondary GL Account.
I have tried creating a second GL_Account_Bus object (I am not sure if I am doing this correctly or if this is the right thing to do.) and using the .FIND and even tried looping through the records and using the SetKey but the SetKey value fails.
I would appreciate any help.
Thanks
Steve