"This thinking is very narrow-minded and it does not think about the long-term effects of such actions towards national unity and the relationship between races," he said during a press conference at the Yayasan Wilayah Persekutuan on Tuesday (Sept 3).
Khalid said when Pakatan Harapan was the Opposition, it had also opposed to a lot of issues.
However, he said it had focused on issues related to corruption and good governance as the coalition wanted to build up society and unite the people.
Khalid lamented that the Opposition today had no other issues to voice out other than focusing on racial issues and by pitting Muslims and non-Muslims against each other.
He said the boycott was not a constructive approach and might become a cause for dispute among races.
He added that instead, it was important to work towards improving the quality of products.
"Along with improving the quality, the prices also can be improved so that it remains competitive in the market," he added.
Khalid noted that it would only destroy creativity and entrepreneurship of Muslim businesses if people only wanted to buy Muslim products despite the product being of poor quality and expensive.
Recently, certain groups have been pushing for a campaign on social media to boycott goods produced by non-Muslims.
The campaign has been denounced by many, including Prime Minister Tun Dr Mahathir Mohamad and MCA president Datuk Seri Dr Wee Ka Siong.