It is narrated from Ibn Abbas (may Allah be pleased with him), he said: "When the Messenger of Allah (ﷺ) came to Madinah, the people of Madinah used to conduct Salam sales in dates for one, two, or three years. Then the Messenger of Allah (ﷺ) said: 'Whoever does a Salam sale, let him do so for a specified measure, a specified weight, and a specified term.'"
Hadith Referenceمسند الإمام الشافعي / كتاب البيوع / 1440