open URL as Popup in addcell?

lock
push_pin
done
Besvart
3

Hi,

 

to "addcell" in table.setFieldValue in Custom Screen, how could i insert "url" in Map() with <script>, so that User open the URL in a Popup instead of in a new Page?

Map map;             
map.insert("label", <my Label>); 
map.insert("url", "https://...");  // popup?
table.setFieldValue("addCell", map);

 

Thanks!

29. nov. 2024 | 12:09 a.m.

Alle Svar (3)

Hi Jianchun

Isn't the default behaviour that it opens in the same page, and not in a new tab? So, your code as it stands would open in the same page?
If you want to open it in a new tab, you can do:

map.insert("target", "_blank");

 

However if you need it as a popup window I don't think you can do it with CRMScript. You could probably add a HTML element to the screen and do some JavaScript trickery to selects the cells, add a click event listener on each cell that finds the URL from the row and opens a popup, but that could be prone to break if SuperOffice change the table layout.

29. nov. 2024 | 07:46 a.m.

HI Espen, sorry for my delay.

I have custom Screem to list my spcial Documents in a Static table v2.

Yes, you are right, in the crm scripts to this Table there is no possible to write JavaScripts for Popup my URL. I have also created Button, in the Scripts for this Button I have no iea to get Popup. 

Maybe do you have example in which HTML-Element I can write Java Scripts to get Popup like this:

myPopup=window.open([url to my Popup],'','height=200,width=300');
setTimeout(Function(){myPopup.close();}, 1000);

The URL goes to my next Screen in Popup to run Logic for download selected Document like this:

        NSDocumentAgent documentAgent;
        NSDocumentEntity documentEntity = documentAgent.GetDocumentEntity(docId.toInteger()); 
        NSStream documentStream = documentAgent.GetDocumentStreamFromEntity(documentEntity);
        print("Content-Type: application/octet-stream; name=" + documentEntity.GetName() + "\n");
        print("Content-Disposition: attachment; filename=" + documentEntity.GetName() + "\n");
        print("Expires: Tue, 01 Jan 2030 12:00:00 GMT\n\n");
        Byte[] docBytes = documentStream.GetStream();
        print("Content-Length: " + docBytes.length().toString() + "\n\n");
        printBinary(documentStream.GetStream());

Thanks a lot!

 

4. des. 2024 | 02:51 p.m.

I got Popup in Screen with Ejscript element.

9. des. 2024 | 10:15 a.m.

Legg til svar