Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:27:19

So ˹Solomon˺ smiled, amused at her speech, and said, "My Lord, enable me to be grateful for Your favor which You have bestowed upon me and upon my parents and to do righteousness of which You approve. And admit me by Your mercy into ˹the ranks of˺ Your righteous servants."  

Whereat he, Solomon, smiled (fa-tabassama, the beginning ˹of the sentence˺) amused (dāhikan, the end ˹of the sentence˺) at its words, which he had heard from three miles away and which was carried to him by the winds. When he was on the verge of ˹entering˺ their valley, he ˹Solomon˺ made his hosts halt until they ˹the ants˺ had entered their dwellings — on this journey his hosts consisted of cavalry and infantry. And he said, ‘My Lord, inspire me to be thankful for Your grace with which You have favoured me and my parents, and to do good that will please You, and include me, by Your mercy, among Your righteous servants’, the prophets and saints.
القرآن:٢٧:١٩

فَتَبَسَّمَ ضَاحِكًا مِنْ قَوْلِهَا وَقَالَ رَبِّ أَوْزِعْنِي أَنْ أَشْكُرَ نِعْمَتَكَ الَّتِي أَنْعَمْتَ عَلَيَّ وَعَلَىٰ وَالِدَيَّ وَأَنْ أَعْمَلَ صَالِحًا تَرْضَاهُ وَأَدْخِلْنِي بِرَحْمَتِكَ فِي عِبَادِكَ الصَّالِحِينَ  

{فتبسّم} سليمان ابتداء {ضاحكا} انتهاء {من قولها} وقد سمعه من ثلاثة أميال حملته إليه الريح فحبس جنده حين أشرف على واديهم حتى دخلوا بيوتهم وكان جنده ركباناً ومشاة في هذا السير {وقال رب أوزعني} ألهمني {أن أشكر نعمتك التي أنعمت} بها {علىَّ وعلى والديَّ وأن أعمل صالحاً ترضاه وأدخلني برحمتك في عبادك الصالحين} الأنبياء والأولياء.