You could try making the script I have made here. And set is as an "OnObjectSave" script trigger on Field 1.
One question: Wouldn't you want to keep the originally typed number "xxxxy"? Because now that get's overwritten so you have no way to ever check wat was actually typed in.
ScriptTrigger Field 1
If [Filter ( TblFields::Field1;"y" ) = "y"]
Set Field [TblFields::Field2; "A"]
Set Field[TblFields::Field1; Left ( TblFields::Field1 ; 4 )]
Set Field [TblFields::Field2; "B"]
Thanks DaSaint! I tweaked your script with a "Substitute" instead of "Left", and that does exactly what I want.
I really appreciate the help.