Handling error code of Ex11073Exception kept going in infinite loop

SOLVED

Hi all,

I wanted to bypass this error message with the code below, by referring to https://my.sage.co.uk/Sage200SDKDocs/html/DOC0078_Overview.html#ERRORS . But I only went into infinite loop if I click Yes, and stop the loop is I click No, but my custom column "SortIndex" is not updated anyway. How to actually handle this error exception = Ex11073Exception?

bool retry = false;
foreach (FinancialCurrency curr in FinancialCurrencies)
{
	do
	{
		try
		{
			retry = false;
			curr.Fields.FindItem("SortIndex").Value = fc.Fields.FindItem("SortIndex").Value;
			curr.Update();
		}
		catch (Sage.Accounting.Exceptions.Ex11073Exception exception)
		{
			System.Windows.Forms.DialogResult dialogResult = Sage.MMS.ExceptionMessageBox.Show(exception, c.Name + " - " + curr.CurrencyISOCode.Code);

			if (dialogResult == System.Windows.Forms.DialogResult.Yes ||
				dialogResult == System.Windows.Forms.DialogResult.OK)
			{
				retry = true;
			}
		}catch(Exception ex)
		{
			ImportRemark ir = new ImportRemark(companySelected.Name, "[" + fc.CurrencyISOCode.Code + "] : " + ex.ToString());
			importRemarks.Add(ir);
			Logger.WriteLog(ex.ToString());
		}
	} while (retry);

Thank you