Question

3
Replies
3006
Views
amolt885 Member since 2013 5 posts
Infosys Limited
Posted: 3 years ago
Last activity: 2 years 9 months ago
Closed

I'm using the below code in non auto generated HTML but it opens the new work in new window and not inside the portal

Hi All,

I am using the below code in non auto generated HTML but it opens the new work in new window and not inside the portal. I have included my section in pyPortalContent section.

Please advise.

1. In a non-auto generated section, include a JS file. This JS file would include the API call.

<pega:static type="script" app="webwb" moveToEnd="true"> // this is how we include a JS file

<pega:file name="TempTestFile.js" />

</pega:static>

2. In the TempTestFile.js file have the below code

pega.u.d.attachOnload (function(){pega.desktop.createNewWork("Good-FW-gcsFW-Work", 1, "NewWork")},true);

here in the API pega.desktop.createNewWork(strClassName, harnessVersion, strFlowName, flowParams) :

strClassName - class name

harnessVersion - harness version, set it as 1

strFlowName - flow name

flowParams - if any parameters are passed in the flow, then you can pass it here in the format : &param1=value1&param2=value2

where "&" and "=" are delimiters

There is another way you can use the API call :

In an HTML page(non-auto generated section) you can create a button. When you click the button, a new work item would be created.

<script>

function buttonFunc(){

var safeURL = new SafeURL();

safeURL.put("className",'PegaSample');

safeURL.put("flowType","BUG64630");

safeURL.put("HarnessVersion",'1');

safeURL.put("Param1",'xxx');

safeURL.put("Param2",'yyy');

safeURL.put("Param3",'1234');

safeURL.put("Param4",'k4567z');

pega.desktop.createNewWork(safeURL);

}

</script>

<button class='buttonTdButton' alt='' title='' onclick="buttonFunc();">NEW_WORK_BUTTON</button>

***Updated by moderator: Lochan to create new post from this comment, add topic categories***

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

User Interface
Moderation Team has archived post
Share this page LinkedIn