He had the idea to organise a party for all the new students.
He had the idea of organising a party for all the new students.
In standard British English, use have the idea of + noun/-ing: ‘She had the idea of organising a competition.’
However, use It is/was someone’s idea + to + infinitive: ‘It was Maria’s idea to organise the party.’