Blank String in Option String

Hi I have an option string which is having a one of the options as an empty string. How can i filter that empty string using the setfilter function? Regards Rajan

Hi, try: Table.SETFILTER(Field,Table.Field::" "); Usually, anything that uses a space (variables,fields,option strings) must be enclosed in “”.

quote:


Originally posted by nelson
Hi, try: Table.SETFILTER(Field,Table.Field::" ");


This won’t work! You can do it like this: Table.SETRANGE(Field,Table.Field::" "); or Table.SETFILTER(Field,'%1',Table.Field::" "); [:D]

Thanx But it’s not working

quote:


Originally posted by nelson
Hi, try: Table.SETFILTER(Field,Table.Field::" "); Usually, anything that uses a space (variables,fields,option strings) must be enclosed in “”.


Sorry, I wrote SETFILTER but I was thinking of SETRANGE. [8)] Thanks Arthur!

Shouldn’t this work: SetFilter(YourField,’’);

quote:


Originally posted by Andre DDB
Shouldn’t this work: SetFilter(YourField,‘’);


It won’t work because filter ‘’ will be represented as nothing. So no filter will be put on this field.

In General Journal form there is a option string for document type, what i want is to filter those records where document type is blank. First option in the option string is single space. Rajan

quote:


Originally posted by Arthur

quote:


Originally posted by Andre DDB
Shouldn’t this work: SetFilter(YourField,‘’);


It won’t work because filter ‘’ will be represented as nothing. So no filter will be put on this field.


As mentioned before you can use this: SETRANGE("Document Type","Document Type"::" "); or SETRANGE("Document Type",0);

Just a reminder that SETRANGE(“Document Type”,0) Selects the First option from the Option List.

yeah, but if you use the option " " then you should do it in the beginning of the option-string

quote:


Originally posted by stepheng
Just a reminder that SETRANGE(“Document Type”,0) Selects the First option from the Option List.


Yes and in this case it’s exactly what’s required because empty option in the Gen. Journal Line table the Document Type field is the first. [;)]

Rajan, like the other ones said, instead of using the classic format of the option fields/variables: optionfield::option value you can use integer format, because every option refers to an integer that specifies the position of the option value, starting from 0. It’s just an enumeration of smallintegers. for example, for “Sales Header”.“Document Type” you have: Quote,Order,Invoice,Credit Memo,Blanket Order,Return Order Quote is 0 Order is 1 Invoice is 2 … “Return order” is 5. So, you can filter this field in 2 ways: 1. setrange(“document type”,“document type”::Order) 2. setrange(“document type”,1) Hope this can help you. Bye.