how to change state based on the approval

kamleshrathore
Kilo Contributor

hi Team

i have created the record producer for change

once i am submitting the record change form going to create at that time change appoval field is requested

but state field is coming as Draft   and in the below activity state is showing in draft

find_real_file.png

find_real_file.png

And Below in the approver tab if i am going to approve then appoval field of the change form changing as a approved but state is still in draft state

find_real_file.png

find_real_file.png

please help me what should i do that if approval is requested then state should be requested

and if approval is approved then state should be apporved

i am using workflow also is there i need to do anything

please suggest me

1 ACCEPTED SOLUTION

I would assume there is a workflow connected to your change process.


Try creating a new change and go to "Workflow - Active Context" from the menu. Sort it on last updated or created and if there is a workflow connected to the change process it should show on the top. Look in the "Workflow version" column to see what workflow is associated


find_real_file.png



Open the Workflow Editor and select the workflow you found in the workflow version column. This is the workflow associated with your change and you can modify it. Use "Set Values" from the Core tab, this activity should be after your approval in the workflow.


find_real_file.png


find_real_file.png



If there isn't any workflow associated to your change request, you should use a business rule to set the correct state value instead.


find_real_file.png


find_real_file.png


View solution in original post

10 REPLIES 10

madanm7786
Mega Guru

Hi Kamalesh,



Either you can have a business rule to set the value of state based on approval field value.


Ex:


if(current.approval == 'approved')


{


current.state = 'approved';


}



Or else, you can set it from your workflow. After the approval activity, set the state value.




Thanks,


Madan


i have used the onLoad client script as given below



function onLoad()


{



  var approval_1=g_form.getValue('approval');



      if(approval_1=='requested')


  {


  g_form.setValue('state','requested');



  }


    else if(approval_1=='approved')


      {


  g_form.setValue('state','Approved');    


      }


}




NOTE: it is working but in the activity the state is still coming as Draft state



find_real_file.png


find_real_file.png


same after approved the approval is approved and state is approved but in the activity still it is coming in Draft State


please help me how to do using workflow


could u provide me some screen shot to do using workflow


do you have 'requested', 'approved' drop down values in your change request state field?



Also, use values of the choices, not labels.