Dear All,
I am encountering this issue when attaching a note to a PO item.
Have any one encountered this issue??
What is the solution?
RomRyan
*This post is locked for comments
Dear All,
I am encountering this issue when attaching a note to a PO item.
Have any one encountered this issue??
What is the solution?
RomRyan
*This post is locked for comments
Not worked..:(
The following script is not mine, but one we use for after we restore test company from live to reset the note ids in the system database.
Note if your system database is named anything but DYNAMICS you will need to update the name in the script before running the script against the company database in question.
As always check this script in your test system and reassure yourselves you are happy to run in production and have backups when running against live. It checks for the max note id over all the tables in the database then sets the setup table according to the max.
Tim.
/*
** FindMaxNoteIndex.SQL
**
** Purpose:
**
** Find the max value of NOTEINDX from all tables.
**
** This script must be run against the company in which the notes are incorrect.
** it will automatically update your SY01500 for you to the correct next note index.
**
** Modified by MRO
*/
if exists (select * from tempdb..sysobjects where name = '##GPSMaxNote')
drop table dbo.##GPSMaxNote
set nocount on
create table ##GPSMaxNote (MaxNoteIndex numeric(19,5) null)
go
declare @cStatement varchar(255) /* Value from the t_cursor */
declare @noteidx numeric(19,5)
declare @database as varchar(5)
set @database = cast(db_name() as varchar(5))
/* Get the tables that have a column name of NOTEINDX. */
declare T_cursor cursor for
select 'declare @NoteIndex numeric(19,5) select @NoteIndex = max(NOTEINDX) from ' + o.name + ' insert ##GPSMaxNote values(@NoteIndex)'
from sysobjects o, syscolumns c
where o.id = c.id
and o.type = 'U'
and c.name = 'NOTEINDX'
/* Ok, we have the list of tables. Now get the max value of NOTEINDX from each table. */
open T_cursor
fetch next from T_cursor into @cStatement
while (@@fetch_status <> -1)
begin
exec (@cStatement)
fetch next from T_cursor into @cStatement
end
deallocate T_cursor
select 'Max Note Index:', max(MaxNoteIndex) from ##GPSMaxNote where MaxNoteIndex is not null
use DYNAMICS
set @noteidx = (select max(MaxNoteIndex) from ##GPSMaxNote where MaxNoteIndex is not null)
update SY01500 set NOTEINDX = (@noteidx + 1.0) where INTERID=@database
set nocount off
RomRyan
How was this resolved. I'm getting the same error when trying to attach a note to an SOP Return. I'm trying to find the next note # in each of the tables listed in the resolution but only find the NOTEINDX field in the SY01500 and the SY03900. That field doesn't exist in the SY01400.
In my case the NOTEINDX in the SY01500 for this company is 1291379.00000 while the last number in the SY03900 table is 1237126.00000.
How does this happen and do I update the SY03900 to be 1 greater than the # in the SY01500 for that same company?
How does the SY01400 come into play since that field isn't present in that table.
THANKS!
Usually with these type of errors, the note index field is not setup correctly.
Check the next note index field for this company in the SY01500 system table, then you need to compare against the SY03900 table to make sure the index in the SY01400 table is greater than the index in the SY03900 table.
Then, in the example of the PO Entry window, the PO would need to be tired to the note showing in the SY03900 table for it, by having the same note index number value, in what appears to be the PONOTIDS_1 column of the POP10100 table, for that PO.
I would start with this and see what that shows you.
Thanks
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,235 Most Valuable Professional
nmaenpaa 101,156