Does anyone know how to retrieve the M3 URL, when called from Ming.le. When using Odin1 and/or Odin4.
No for that scenario, use a relative URL "/mne/apps" etc.
Hi,
Since you mention Odin, aka H5 M3 SDK I assume you would like the the location in JavaScript.
window.location.href
https://www.w3schools.com/js/js_window_location.asp
Then you find the first index of "/mne" and then you substring with that index + 4.
But it's really more interesting why you would need it?
If you would like to add a link to your application (on M3) startpages, then test with a relative link "/mne/apps/xxxxx".
Hi Karin
I use this technique, when I in my SDK solution want to call another SDK embedded in an iframe:
this.origin = window.location.origin;
private onSearchCUNO() {
let origin = this.getOrigin();
let parm: string = "?mode=SearchPlusT456&cuno=" + this.scope.txtCUNO; let src = (origin + '/mne/apps/searchcustomert438' + parm); let template = `<iframe style="overflow: hidden; height: 99% !important; width: 99% !important;" src=${src}></iframe><button type="button" id="dummyBtnDialog" class="btn btn-default" ng-click="cancel()">Luk</button>`;
this.launchModalCUNO(template);
}
It seems to cause problems when an SDK Odin1 launches another SDK Odin1. Because the window.location.origin holds the Ming.le URL
But you suggest window.location.href - could that differ ?
Hi PRavborg!
Where you run your app? In many cases you already "sit" in some iFrame. So URL of that iFrame may be not what you expect. You can check out that by Chrome developer tool.
Maybe you need parent of the iFrame
https://stackoverflow.com/questions/3420004/access-parent-url-from-iframe
Br Jyka
Thx Karin
You are quite right. I have been blinded, because when launching from Visual Studio, I had to redirect the localhost. In installed runtime it isn't an issue, why the relative URL of course works.I am a little bit embarrassed on this one. Thx for enlighten me :-)
Thx for all input
/mne should not used because depends of configuration....
verify m3ConfiguratonInfo variable
I'm not sure what you mean with this? If mne would all of the sudden change it's context? It would be the first time in 10 years,,, Or maybe it's been even longer time the context root is called mne.
Configuration.Current.ContextUrl
it containts '/mne' but can be changed by Infor ....