Delete a Record from a Smartobject using K2 Studio Workflow?

  • 23 January 2015
  • 5 replies
  • 1 view

Userlevel 3
Badge +16

Not done this before,

 

I have some Approval requests that are declined? But i save them in a Smartobject anyway before sending them for Approval.

It makes no sense to keep the declined requests, so i'd like to remove them from the Smartobject.

 

I have the Record Number saved as a Parameter in my Workflow, any idea what I need to do in K2 Studio to delete that Record from the Smartobject?

 

Is it a Data event? or other activity i need?

 

Thanks


5 replies

Badge +10

You should be able to just add the SmartObject Event to an activity when it flows down the deleted path and pass the ID to the delete method exposed by the SmartObject you're calling. 

Userlevel 3
Badge +16

Hi,

 

I added the Smartobject Event, then for the Smaartobject Method I did "Smartobject.Delete"

On the Input Mappinfg, i did Auto Map which put ID there.

 

I deployed, then ran the form, but record is still not getting deleted...

 

Where did u choose the input mapping ID Value from?

 

Badge +10

You mentioned that the record ID is stored in the workflow, presumably in a process datafield.  You should be able to pass that ID to the delete method of your SmartObject.

 

Try deleting the record by executing the delete method from the SmartObject tester tool to test it out.

 

Regards,

Tim

Userlevel 3
Badge +16

Thanks for your help, managed to figure it out.

 

My ID was saved in a datafield as a String.

I did a data tranfer to copy the value to another dayafield (integer) and used that, it worked.

 

Thanks bud.

Badge +10

Glad that worked.

 

Note:  The Inline function Conversion/To Integer could have saved the step of having to copy it to another datafield.

Reply