In the form there is the option to select location code. From the location code list i do not want to view some values from the list. Alos,I do not want to disable the location for all the forms.
So, if there is logic:
1) If the location list is opened by form 'SalesReport'
2) Filter Location Code <>Store1|Store2
Declare a Variable LocRec (Record, Location) and LocForm (Form, Location List);
Then in the OnLookup trigger write:
CLEAR(locForm);
// Here you cann apply any filter you need
locform.SETTABLEVIEW(locRec);
locform.LOOKUPMODE(TRUE);
IF locform.RUNMODAL = ACTION::LookupOK THEN BEGIN
locform.GETRECORD(locRec);
VALIDATE("Location Code",LocRec.Code);
END;
But I would add a new field and filter based on this because a filter like the one above can cause a runtime error if the length exceeds a certain number of characters...
The above filter tells the system to show only the records that are Not Store1 AND Not Store2 And NOT Store3...
You can read the online help for more information on applying filters...
You can do this with the MARK function to iteratively select the records you want to view and then use MARKEDONLY to view only those records.
Hopefully you don't have a lot of records in your location table.
Answers
Can you give us a bit more detail?
In the form there is the option to select location code. From the location code list i do not want to view some values from the list. Alos,I do not want to disable the location for all the forms.
So, if there is logic:
1) If the location list is opened by form 'SalesReport'
2) Filter Location Code <>Store1|Store2
vasilis
Then in the OnLookup trigger write:
Location.SETFILTER(Code,not 'Store1'|'Store2');
Euxaristo,
vasilis
Location.SETFILTER(Code,'<>%1&<>%2&<>%3',Store1,Store2,Store3);
But I would add a new field and filter based on this because a filter like the one above can cause a runtime error if the length exceeds a certain number of characters...
The above filter tells the system to show only the records that are Not Store1 AND Not Store2 And NOT Store3...
You can read the online help for more information on applying filters...
i used Location.SETFILTER(Code,'<>Store1|Store2|Store3|Store4|Store5');
vasilis
Is this what you want????
This will exclude ONLY Store1... which is equal to saying:
Location.SETFILTER(Code,'<>Store1');
Thanks
I meet an error message which says a maximum of 12 parameters must be used....
So I think the limit may be 12 parameters. Thank you.
Hopefully you don't have a lot of records in your location table.