Skip to main content
Nintex Community Menu Bar

Clear a field value in a Smart Object

  • July 28, 2009
  • 3 replies
  • 29 views

Forum|alt.badge.img+1

Hi all,


I'm new on the K2 world and I have a problem with SmartObjects and editing data programmatically.
When I want clear the field value of a SmartObject, so set a NULL value or an empty string, it does not seem to work: the field is not cleared.


 I've tried with these three ways:




  • mySmo.Properties["fieldName"].Clear();



  • mySmo.Properties["fieldName"].Value = string.Empty;



  • mySmo.Properties["fieldName"].Value = null;


Can someone help me ?

Thank you.

3 replies

Forum|alt.badge.img+5
  • July 28, 2009
Hi Mike,

A very quick background on SmartObjects:
SmartObjects rely on an underlying Service implementation (code) which determines what functionality is available. The default Service Used by SmartObjects when using the SmartObject designer is SmartBox. SmartBox will as you have seen create a SQL table for each SmartObject you create in the SmartBox database which K2 Creates on install and provide methods for create, save, delete and get list.

The reason that I am explaining this is that the ability to null your back end data depends on how the underlying service implementation manages this for SmartBox you can pass a string value of SCNULL, for other services this may be different.

HTH

Murph

Forum|alt.badge.img+1
  • Author
  • July 28, 2009

Thanks for the response.


So yes, I use the SmartBox Service.
What is SCNULL ? Should I do this: mySmo.Properties["fieldName"].Value = "SCNULL"; ?


Forum|alt.badge.img+1
  • Author
  • August 12, 2009

It doesn't work, I don't see how I can do this.


Anyone can help me ?