"System Error: Error getting returns" when opening Lodgment Manager
This support note applies to:
AE Tax Series 6 & 8 (AU)
When opening Lodgment Manager, you might see the error "System Error: Error getting returns".
This issue occurs where there's duplicate return codes in MYOB Tax – for example, ABC2019T and Abc2019T.
To fix this issue, contact us and quote KB 38751.
MYOB INTERNAL STAFF ONLY
This script returns duplicate TFNs and ABNs in the tax database.
You can run the script and provide the results to the customer to review. Once duplicates are removed, the "System Error: Error getting returns" message goes away when opening Lodgement Manager.
SQL Script:
Print 'Duplicate TFN or ABNs'
Print ' '
Declare @Code varchar(255), @Value varchar(255), @FieldName varchar(255)
if exists (
select REPLACE(Value, ' ', '') from ClientExtraValue
where TableCode like 'ABN' or TableCode like 'A.B.N.' or TableCode like 'A.B.N' or TableCode like 'Australian Business Number' or TableCode like 'Aust. Business Number' or TableCode like 'Aust Business Number' or TableCode like 'Aus Business Number' or TableCode like 'TFN' or TableCode like 'T.F.N.' or TableCode like 'T.F.N' or TableCode like 'Tax File Number' or TableCode like 'Tax File No' or TableCode like 'Tax File Num'
group by REPLACE(Value, ' ', '')
having count(REPLACE(Value, ' ', '')) > 1
)
begin
print 'There are duplicate ABN''s, please remove these duplicate ABN/TFN''s via your client search
'
declare A_Cursor Cursor For
select Code, REPLACE(Value, ' ', ''), FieldName
from ClientExtraValue where value in
(
select REPLACE(Value, ' ', '') from ClientExtraValue
where TableCode like 'ABN' or TableCode like 'A.B.N.' or TableCode like 'A.B.N' or TableCode like 'Australian Business Number' or TableCode like 'Aust. Business Number' or TableCode like 'Aust Business Number' or TableCode like 'Aus Business Number' or TableCode like 'TFN' or TableCode like 'T.F.N.' or TableCode like 'T.F.N' or TableCode like 'Tax File Number' or TableCode like 'Tax File No' or TableCode like 'Tax File Num'
group by REPLACE(Value, ' ', '')
having count(REPLACE(Value, ' ', '')) > 1
)
Order By Value, Code
open A_Cursor
Fetch next from A_Cursor into @Code, @Value, @FieldName
WHILE @@FETCH_STATUS = 0
BEGIN
Print @Code + char(9) + @Value + char(9) + char(9) + @FieldName
FETCH NEXT FROM A_Cursor into @Code, @Value, @FieldName
END
CLOSE A_cursor
DEALLOCATE A_cursor
end
else
begin
Print 'There are no duplicate ABN\TFN''s in this database, please proceed with install\Obligations'
end
Alternative script:
Run the following query in SQL Server Management Studio:
WITH LodgementHomepage as
(
SELECT clientcode,formid, returncode, returnyear FROM dbo.vw_TaxSbrSender_LodgmentHomepage2008
WHERE [State] <> 'L'
UNION ALL SELECT clientcode,formid, returncode, returnyear FROM dbo.vw_TaxSbrSender_LodgmentHomepage2009
WHERE [State] <> 'L'
UNION ALL SELECT clientcode,formid, returncode, returnyear FROM dbo.vw_TaxSbrSender_LodgmentHomepage2010
WHERE [State] <> 'L'
UNION ALL SELECT clientcode,formid, returncode, returnyear FROM dbo.vw_TaxSbrSender_LodgmentHomepage2011
WHERE [State] <> 'L'
UNION ALL SELECT clientcode,formid, returncode, returnyear FROM dbo.vw_TaxSbrSender_LodgmentHomepage2012
WHERE [State] <> 'L'
UNION ALL SELECT clientcode,formid, returncode, returnyear FROM dbo.vw_TaxSbrSender_LodgmentHomepage2013
WHERE [State] <> 'L'
UNION ALL SELECT clientcode,formid, returncode, returnyear FROM dbo.vw_TaxSbrSender_LodgmentHomepage2014
WHERE [State] <> 'L'
UNION ALL SELECT clientcode,formid, returncode, returnyear FROM dbo.vw_TaxSbrSender_LodgmentHomepage2015
WHERE [State] <> 'L'
UNION ALL SELECT clientcode,formid, returncode, returnyear FROM dbo.vw_TaxSbrSender_LodgmentHomepage2016
WHERE [State] <> 'L'
UNION ALL SELECT clientcode,formid, returncode, returnyear FROM dbo.vw_TaxSbrSender_LodgmentHomepage2017
WHERE [State] <> 'L'
UNION ALL SELECT clientcode,formid, returncode, returnyear FROM dbo.vw_TaxSbrSender_LodgmentHomepage2018
WHERE [State] <> 'L'
UNION ALL SELECT clientcode,formid, returncode, returnyear FROM dbo.vw_TaxSbrSender_LodgmentHomepage2019
WHERE [State] <> 'L'
UNION ALL SELECT clientcode,formid, returncode, returnyear FROM dbo.vw_TaxSbrSender_LodgmentHomepage2020
WHERE [State] <> 'L'
UNION ALL SELECT clientcode,formid, returncode, returnyear FROM dbo.vw_TaxSbrSender_LodgmentHomepage2021
WHERE [State] <> 'L'UNION ALL SELECT clientcode,formid, returncode, returnyear FROM dbo.vw_TaxSbrSender_LodgmentHomepage2022
WHERE [State] <> 'L' )select ClientCode, ReturnCode, FormID, returnyear from LodgementHomepage
group by ClientCode, ReturnCode, FormID, returnyear
having COUNT(ReturnCode) >1Delete the duplicate returns.
Close and reopen Lodgment Manager.