Why did Archduke Franz Ferdinand go to Serbia?

Despite what you'll find on some websites, Franz Ferdinand did NOT visit Serbia. He visited Sarajevo, the capital of Bosnia-Hercegovina, which in 1914 was a part of Austria-Hungary. (The Serbs wanted it, but that's another matter).