cancel
Showing results for 
Search instead for 
Did you mean: 

set null/nothing field

former_member258877
Participant
0 Kudos

Hi

is possible to set a field with a value like null/nothing/empty/blank?

I have to "clean" e field like ForeignName into OITM table.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

You can set  String.Empty .

Regards

Vivek

former_member258877
Participant
0 Kudos

Thanks for the useful answer.

I have to do the same thing with field like oItem.OrderIntervals!

Johan_H
Active Contributor
0 Kudos

You would have to test this, but generally numeric fields require 0 (zero) or -1

Regards,

Johan

former_member258877
Participant
0 Kudos

I have to say that field is very strange because if you use it into a query is numeric but if you have to read ed set with sdk is a text 

These are all my attempts:

//oItem.OrderIntervals =string.Empty ;

                        //oItem.OrderIntervals = "0";

                        //oItem.OrderIntervals = "-1";

the error is always the same ... "Enter valid code  [OITM.OrdrIntrvl] , '-1'" (-5002)

Johan_H
Active Contributor
0 Kudos

Okay, now I see. Order intervals are predefined values.

This means, that whatever value you put there, you need to define it in the client first. In other words, you have to define a cycle code for "don't do anything", and then call that code.

So for example, in the client you determine cycle code "None"

and you code becomes:

oItem.OrderIntervals = "None";

Alternatively, you could write your code to simply not call this property at all when you do not need it:

oItem.ItemName = "New wonderfull Item";

If (Needed)

{

     oItem.OrderIntervals = "Cycle 01";

}

Regards,

Johan

P.S. You do understand that it is not necessary to set all properties, right ?

former_member258877
Participant
0 Kudos

okkey

I hoped it was possible to "clean" the field without use a "phantom" cycle

however if this is the only solution ... I'll do it!

Thanks a lot!

Answers (0)