Skip to main content

I'm having some bother deleting records from Smartobjects.

 

When a user submits a Form, the record is SAVED in the Smartobject and a workflow sends the request to an Authoriser

When an Authoriser declines the request, I want to DELETE that record from the Smartobject.

 

I am using the Smartobject ID to pass to the Delete Method in the Workflow, but its not deleting the record from the smartobject.

 

In the Workflow mappings, i have a DateField called RequestID, and map that to the Form Field - Item View ID

 

Am i doing this wrong? Can anyone give me a surefire way of capturing the ID of the record which i can then use to delete that record if needed?

 

Thanks

Dear ,

 

The way of capturing , wt i usually do , when i use "Start workflow" action on my form , i open its configure part , and send the data from my smart form into the workflow data fields .

just couple of points to think about ,

-have you traced the ID you are using to delete the request ? is it the right ID for the item ?

-are u performing the deletion in an activity smartobject server event? or is it a rule on ur smartform ? either way , you need to make sure that if u had it on ur smart form , make sure that it is executing . and if it was inside server SMO event on workflow , u need to make sure that it is reaching that activity after authorizer declines.

-would u try deleting the record directly on the data base ? is it gonna let u delete it ? (just to make sure the record is delete able and there is no issue from the data base)

-if the data base did let u delete , go to ur tester utility and perform a delete for the specific smart object , and give it a static ID , an ID that u have in ur request table , is it gonna delete it or not ?

 

Hope you find the resolution performing these steps ,

Regards. 


 Ahmad,

 

Thanks for your reply...

 

The problem is as follows:

 

In the Database, for example. the new record ID is numbered 20217

When i send a message in the Workflow, i included the request ID:, but that ID is 20200

 

How can this be? They are both different numbers, so that i why the record is not being deleted.

 

I do the same as you, I configure the workflow to use the Parameters on Configure (In Start) and map the data fields to form fields.

For the ID field, I am mapping the View -> Smartobject => ID field... But as above, the ID created in the Smartobject DB is different from the one it using to delete

 

Any ideas?

 

Also, i noticed my ID numbers have jumped for 100...101, to 10001....10002 (again) This is really annoying, i've seen that happen before.

 

Thanks


Dear ,

 

As for the jumping of ID's , i feel ya , its annoying to see number jumping like that ,

and for the ID , how about not using view-->SMO->ID field , why dont u try another way

first u need to add new data label to hold a value on ur form/view , then go to the method that creates this new record and go to the output pane , return back the ID to the data label , and then when u "start workflow" configuration , send the data label that holds the id of the new record to the workflow data field .

check it out and lets see if it still sends different ID than the one that was created .

 

Hope it helps!

Regards 


Excellent suggestion Ahmad,

 

I use the SAVE Method to save the record on the form, so as per your suggestion, I used the OUTPUT of that method to send the ID to a data label on the View.

Then i passed the Label to the Workflow to map to a Workflow Data field and used it to do the DELETE Smartobject method in the Workflow.

 

I also have a PDF Smartobject, so i truncated both the PDF and my Form Smartobjects, so everything starts at 1... However i still worry that either of these Smartobjects will jump up in number by 10000 at random.

 

Thanks Ahmad, much appreciated/


Ahmad,

 

Just following on from this. I do a SAVE method on one BizData Smartobject and also use the PDF Converter control to save the resulting PDF in a different Smartobject.

 

Do you know of a way to make sure the PDF smartobject has the same ID as the BizData one? or at least ensure the PDF and BizData IDs match>?

 

I can't see anyway of retrieving the PDF ID because there is no output (like a normal Smartobject)

 

Reason I ask is, if the request is declined, I want to delete the record from the BizData Smartobject and also the PDF in the PDF Smartobject.

 

Thanks


Dear ,

I will check the scenario u need nd get back to u as soon as i find solution for it , and ill post it in case no one else already posted a solution .
But for the moment , i dont believe u could make their ID's match because as we discussed earlier , ID's could go crazy and jump from 1 to 1000 for no reason , so the best way to achieve this is to find a way to retrieve the pdf ID .

Regards.

Dear Sharp ,

 

First , here is a useful link about save as pdf control 

http://help.k2.com/sfsaveaspdf , download the file from there and it will help u alot .

 

but for fast explaination of steps and correct me if i was wrong ,

- u have save as pdf control on ur form/view

-on some kind of an event , u execute a control's method , which is the save as pdf control method ->> save as pdf 

i assume that u r using default configuration , if u click on ur save as pdf control , in the properties pane , u will have configurations for data source , if u have that on default as in using PDF File as smartobject , oh well ,

-to get the ID , lets imagine ur event actions as following:

 When a control raises an event , execute the following actions

    1-save as pdf control -> save as pdf method 

    2-transfer data (Configure) , send the save as pdf Control ITSELF , to a textbox 

    3-then send this textbox value into ur workflow datafield (Create a new data field if u dont have one already)

-these steps will make sure u got the ID of the PDF File created , and inside ur workflow , if a rejection happens , then u could execute a smartobject server event , id o believe u have PDF File SmartObject , and it has a delete method , use that SMO and delete using the ID u already got from the data field .

 

Hope it helps!

Regards.

 


Reply