i have a portlet that submits to a suitelet , how ...
# suitescript
s
i have a portlet that submits to a suitelet , how can I get the suite to let refresh the portlet either directly or even alink to click
b
what does your suitelet do?
s
creates a task for map/reduce
b
normal options for refresh require your suitelet to write a html page that has a script that refreshes its parent
s
do you mean the sutelite needs to call a clientscript?
b
suitelet do 2 things
run the code in their onRequest entry point
and return a response
s
response.write(html, true);
b
in this case, you need to run javascript in whatever is showing the response
there are 2 approaches you can use to do that in a suitelet
s
im unsure how to set upthe html
b
either way will work
you can use Form.clientScriptModulePath instead if you wish
but its generally a weakness not knowing html when working with scripts that run in a browser
s
lol i know html i wasnt born yesterday
currently this is my code
Copy code
var url=`/app/common/scripting/mapreduce/ui/MapReduceStatusDetail.nl?taskId=${mrTaskId}`
    var html = `<h2>Thank you for submitting task to mark all orders shipped </h2> <p>STATUS:  ${taskStatus.status}</p> <a href = ${url}>SEE Status</a>`;
    //document.location.reload()
    response.write(html, true);
this just gives a link to the status page I would like a link our automatically to refresh the porlet after 10 seconds
you havent explained your idea just parts of it
b
you dont really have a link to the portlet
s
that is my problem ..
b
sorta depends on what you set as the target for your portlet's submit
s
left it for default
b
but you want to use something like window.opener to access the parent window
s
which would be the portlet ?
b
if you used the default, then the portlet form target is _self
which basically means your portlet is gone
you dont really reload the portlet if its gone, you navigate to the portlet's url again
s
yes that is what im trying to figure out what is the URL ?
Copy code
var output = url.resolveScript({
      scriptId: "customscript852",
      deploymentId: "customdeploy1",
      returnExternalUrl: false,
    });
will that work for portlet script
b
i wouldnt expect it to
s
so how do you get the url for the portlet ?
b
the easy options are sorta browser dependent
s
chrome or firefox
b
chrome is you right click the portlet and view the frame's source
firefox is you right click the portlet and view the frame's info or source
huh?
s
i see what you mean got it