How to set value to Null for SmartObject method

  • 20 January 2015
  • 1 reply
  • 16 views

Badge +1

How do I go about setting an ID value to NULL in a SmartObject event? 

 

I am using a SmartObject to update a SQL DB table. I want the SO event to null out a field (the fields is ProcessInstanceID type INT) . How do I do that? Passing in a static value of "NULL" (without the quotes) does not work as K2 tries to convert the word into a string.


1 reply

Badge +7

Hello -- I know this is later than you were hoping to get an answer but hopefully it'll help other people in the future too. 

 

So instead of setting null into the field you can put in SCNULL using a Static value

 

The reason for this is it has something to do with .NET, which doesn't understand how to relay NULL back to SQL properly so SQL get's confused and it will throw the error where it has "failed to convert parameter value from a String to Int32..." etc. as you know. 

 

Hope you got this all sorted!

Reply