Issue with Product Name and Menu Name out of sync

OK, have a client on V4.
I understand and know the button header is not based on the product name,
The client has changed some product names however its not just the button headder which hasnt updated, the product name also remains the same…
Is this expected behavior?

Grouse for example has had the product name changed to Amaretto.
While I understand and have recommended they add new products they insist on updating product names.
However I would have expected the product name column to be correct and the header column to just need updating…

Does anyone have or is able to provide a quick script to update these values?
Have the columns here;

SELECT  m.[Id], m.[Name] AS ProductName, s.[Name] AS ScreenName
FROM [ScreenMenuItems] s JOIN [MenuItems] m on m.[Id] = s.[MenuItemId]
WHERE 1=1

Ideally want to INSERT m.[Name] into s.[Name] but obviously isn’t a straight insert and needs to do it based on m.[Id] = s.[MenuItemId]

@QMcKay any chance of a bit of your magic :smile:

It is normal behavior, and it should have no effect the operation of SambaPOS.

That said, if you want to do this, you need to do a joined update, as such:

update m
set m.[Name] = p.[Name]
from [ScreenMenuItems] m
inner join [MenuItems] p on p.[Id]=m.[MenuItemId]

1 Like

Thanks @QMcKay
Presumably we could add a where p.[GroupCode] = ‘Spirits’ if we only wanted to update spirits group products menu buttons?
Or would this not work as GroupCode isn’t in ScreenMenuItems?

Yes, you can constrain via either table when they are joined, so yes, that would only update the Menu Items which are linked to the Products which are part of the “Spirits” group…

2 Likes

Thanks Q, much appreciated.
May put together a script into my stock system, so many clients come back with this question again and again, despite explaining its best to add new products for several reasons like reports etc, at least I could quickly fix it with this script :smile: