We’re using a form that has the following line in it: SL.“Variant Code” := ‘’; SL is a Record variable that points to the Sales Line table. I believe the intent was to create an empty value, void of any content. However, what actually happens is the value of two quotation marks (side-by-side) is entered into the field. When that value is used to act as a filter on a subsequent form, the quotation marks always provide an invalid (although allowed) value as the filter. The user then needs to move the pointer to the field and delete the two quotation marks, and then the form returns all the values. The following code in the OnOpen trigger of the form shows there is no value in the field: IF “Variant Filter” = ‘’ THEN BEGIN MESSAGE(‘Variant Filter: %1’,“Variant Filter”); CLEAR(“Variant Filter”); MESSAGE(‘Variant Filter: %1’,“Variant Filter”); END; What I want to do is have NOTHING (or a NULL - like in Oracle) value in the field, like what happens when the user enters the field and deletes the two quotation marks. I’ve tried a text constant of no value, but that didn’t seem to work either. Any help greatly appreciated.
Matt, first of all to assign a NULL value to a CODE or TEXT datatype you would use:
Variable := '';
And it seems like you are confusing “Variant Code” and “Variant Filter”. Could you give us some more information on the scenario? Soren Nielsen, moderator Integration/Developer NOLUG
SETRANGE(“Variant Filter”); Will Clear any applied filters showing all Variants including blanks on the drilldown or lookup table. SETRANGE(“Variant Filter”,’’); Will Filter the information for all flow filter records with a blank (double quotes)“Variant Code” on the drilldown or lookup table SETRANGE(“Variant Code”); Will Clear any applied filters showing all record Variant on the current table SETRANGE(“Variant Code”,’’); Will Filter the information for all filter records with a blank “Variant Code” on the current table Hope this makes it clearer David Cox MindSource (UK) Limited Navision Solutions Partner Email: firstname.lastname@example.org Web: www.mindsource.co.uk
Soren, you were quite right. I was confusing Filter and Code. But I’m better now. David, thanks for your input as well. This topic can be locked.