How to add Button in RITM- in Portal

chanikya
Tera Guru

Hi ,

 

when i click a button "Cancelled RITM" then RITM was going to be cancelled .

Script:

var appr=new GlideRecord('sysapproval_approver');
appr.addQuery('sysapproval', current.sys_id);
appr.query();
while(appr.next())
{
appr.state='rejected';
appr.update();
}
current.state=4;
current.update();

find_real_file.png

 

 

find_real_file.png

 

 

Same actions should be from PORTAL  &  Create Button

find_real_file.png

7 REPLIES 7

Hi,

 

Problem is here,

 

with out clicked on Button  automatically RITM is going to Cancelled when i opened RITM in Portal level

it should not be done like this , when i click on button in RITM then only RITM should be cancelled.

 

 

here i didn't clicked on Cancelled RITM button but it is automatically state changed  to Closed Incomplete

Approvals was not rejected 

find_real_file.png

That's because you should only execute the code IF the button is clicked. Take a look at the tutorial I sent you.

ok