1) This is related to KB articles. There will be a valid date field on KB form. Ideally after that date , article gets retired. So , create an UI Action named Publish which will be visible only in Retired articles and if we click on it, validate that

gomathysanjana
Mega Expert
1)This is related to KB articles. There will be a valid date field on KB form. Ideally after that date , article gets retired. So , create an UI Action named Publish which will be visible only in Retired articles and if we click on it, validate that user changes valid to date to a future date. If date is in past or today, do not publish it.
2)Create two fields on KB form. Group Reference to Groups table User Glide list field reference to User table. Fill Group field with some group.   Now create a UI Action "All Users" , if we click on it, the users of the grp belonging to Group should be filled in User glide list field
How to perform this
1 ACCEPTED SOLUTION

I dono what is wrong in your code,



I have tested this and it does work


//code


if(current.valid_to <= gs.nowDateTime()){


gs.addInfoMessage('Invalid date.Please enter future date');


current.setAbortAction(true);


}


else


  {


current.workflow_state = 'published';


current.update();


  }


action.setRedirectURL(current);


Regards
Harish

View solution in original post

17 REPLIES 17

make sure field names are correct. in my personal instance I did check.


Regards
Harish

field name should be workflow_state not workflow



find_real_file.png


Regards
Harish

gomathysanjana
Mega Expert

S it is correct. For the same code one of my collegue getting accurate output harish:(


I can see the code in your UI action



this line


//current.workflow = "published";


above image


Regards
Harish

gomathysanjana
Mega Expert

I have created new one in that it is correctscr7.png