Number of Vendors

Dear All,

Greetings,

while entering a new request for purchase order i want to make a method which will count the records and if the vendors (records) if the number is less than 5 then an exception wiil be trough