Use WMS online resource to generate Map Viewer URL
Uses the WMS GetCapabilities request url to generate the Map Viewer URL. Linked documents were generating the incorrect url because the ID was the id of the linked-document not the id of the map service in the linked to document.
When the Map Viewer is loaded the first thing it calls is the WMS getCapabilities request to get layer info, etc so the WMS online resource needs to exist for the Map Viewer to work