Hi JayKay,

In this case, you must set the 'Status' of the range 'Hidden' or 'Locked'.

In the same place, the 'init()' method of form, you nust decleare a
QueryBuildRange variable :

QueryBuildRange qbr;

After that, you can program this range. After the super(); :

qbr =
SalesTable_ds.query().dataSourceTable(tablenum(SalesTable)).addRange(field
num(SalesTable,SalesStatus));

qbr.status(RangeStatus::Locked);                        // or
'RangeStatus::Hidden'
qbr.value(enum2str(SalesStatus::Backorder));

Nobody can change this value from 'Filter' or 'Remove Filter' buttons. If
you set the locked, a user can see but not change. If you set the hidden,
it can not seen or changed by a user!

No Pity ;)

I hope this solution is for you,

Anil


-----Original Message-----
From: Axapta-Knowledge-Village@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of jaykay_nl
Sent: Friday, January 20, 2006 10:51 AM
To: Axapta-Knowledge-Village@yahoogroups.com
Subject: [Axapta-Knowledge-Village] Re: Open form with a specific filter

Hi Anil,

Thanks for the very useful information. It is only a pity it needs to 
be programmed. But it works!

Is it also possible to activate at the same time the "Remove Filter" 
button, so it is possible to remove the filter with just one click.

Thanks in advance,
JayKay.

--- In Axapta-Knowledge-Village@yahoogroups.com, ANIL OZAY 
<[EMAIL PROTECTED]> wrote:
>
> Hi JayKay,
> 
> We use range objects to filter records on datasources. You can 
filter
> datasources of tables and reports. But you must do it after the
> initialization of datasource.
> 
> In forms, the initialization of datasource done after the 'super()' 
of
> init() method of form. 
> 
> So you can add this code in the init() method of datasource, after 
the
> 'super();'
> 
> SalesTable_ds.query().dataSourceTable(tablenum(SalesTable)).addRange
(field
> num(SalesTable,SalesStatus)).value(enum2str
(SalesStatus::Backorder));
> 
> 
> In this code, firstly you selected SalesTable datasource, after you 
select
> the SalesStatus field to filter. Filter values must be string, so 
you must
> change the enum value to string. Enum2str(...) can do for you.
> 
> Regards,
> 
> Anil Ozay
> Software Engineer / Axapta Specialist
> MBSCP (Server, Programming), MCP
> 
> Anadolu Group,ABH
> 
> 
> -----Original Message-----
> From: Axapta-Knowledge-Village@yahoogroups.com
> [mailto:[EMAIL PROTECTED] On Behalf Of 
jaykay_nl
> Sent: Friday, January 20, 2006 1:06 AM
> To: Axapta-Knowledge-Village@yahoogroups.com
> Subject: [Axapta-Knowledge-Village] Open form with a specific filter
> 
> Hi All,
> 
> I would like to open for example the sales table form and by 
default 
> see only the sales orders with status "Open" instead of all orders 
> which is currenty the case.
> 
> So, is there a way to open a form with a specific filter active.
> 
> Thanks,
> JayKay
> 
> 
> 
> 
> 
> Sharing the knowledge on Axapta.
> Visit www.frappr.com/axapta for axapta friends. 
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
> 
> Bu e-posta ve muhtemel eklerinde verilen bilgiler kisiye ozel ve 
gizlidir. Anadolu Bilisim Hizmetleri A.S. bu mesajin icerigi ve 
ekleri ile ilgili hicbir hukuki sorumluluk kabul etmez. Yetkili 
alicilardan degilseniz, bu mesajin herhangi bir sekilde ifsa 
edilmesi, kullanilmasi, kopyalanmasi, yayilmasi veya mesajda yer alan 
hususlarla ilgili olarak herhangi bir islem yapilmasi kesinlikle 
yasaktir. Bu durumda hemen mesajin gondericisini bilgilendiriniz ve 
mesaji sisteminizden siliniz. Elektronik mesajlar uzerinde yapilmis 
herhangi bir degisiklik veya sonuclari uzerinde Anadolu Bilisim 
Hizmetleri A.S.'nin sorumlulugu yoktur. Ayrica, e-posta 
mesajlarindaki hata ve/veya eksiklikten, virus icermesinden ve 
bilgisayar sisteminize verebilecegi herhangi bir zarardan Sirket 
olarak sorumluluk kabul etmeyecegimizi de bildiririz.
> 
> This e-mail and any information included within any attached 
document are private and confidential and intended solely for the 
addressee. Anadolu Bilisim Hizmetleri A.S. does not accept any legal 
responsibility for the contents of this message and any attached 
documents. If you are not the intended addressee, it is forbidden to 
disclose, use, copy, or forward any information within the message or 
engage in any activity regarding the contents of this message. In 
such case please notify the sender and delete the message from your 
system immediately. Anadolu Bilisim Hizmetleri A.S. also denounces 
any legal responsibility for any amendments made on the electronic 
message and the outcome of these amendments, as well as any error 
and/or defect, virus content and any damage that may be given to your 
system.
>







Sharing the knowledge on Axapta.
Visit www.frappr.com/axapta for axapta friends. 
Yahoo! Groups Links



 





Bu e-posta ve muhtemel eklerinde verilen bilgiler kisiye ozel ve gizlidir. 
Anadolu Bilisim Hizmetleri A.S. bu mesajin icerigi ve ekleri ile ilgili hicbir 
hukuki sorumluluk kabul etmez. Yetkili alicilardan degilseniz, bu mesajin 
herhangi bir sekilde ifsa edilmesi, kullanilmasi, kopyalanmasi, yayilmasi veya 
mesajda yer alan hususlarla ilgili olarak herhangi bir islem yapilmasi 
kesinlikle yasaktir. Bu durumda hemen mesajin gondericisini bilgilendiriniz ve 
mesaji sisteminizden siliniz. Elektronik mesajlar uzerinde yapilmis herhangi 
bir degisiklik veya sonuclari uzerinde Anadolu Bilisim Hizmetleri A.S.'nin 
sorumlulugu yoktur. Ayrica, e-posta mesajlarindaki hata ve/veya eksiklikten, 
virus icermesinden ve bilgisayar sisteminize verebilecegi herhangi bir zarardan 
Sirket olarak sorumluluk kabul etmeyecegimizi de bildiririz.

This e-mail and any information included within any attached document are 
private and confidential and intended solely for the addressee. Anadolu Bilisim 
Hizmetleri A.S. does not accept any legal responsibility for the contents of 
this message and any attached documents. If you are not the intended addressee, 
it is forbidden to disclose, use, copy, or forward any information within the 
message or engage in any activity regarding the contents of this message. In 
such case please notify the sender and delete the message from your system 
immediately. Anadolu Bilisim Hizmetleri A.S. also denounces any legal 
responsibility for any amendments made on the electronic message and the 
outcome of these amendments, as well as any error and/or defect, virus content 
and any damage that may be given to your system. 



Sharing the knowledge on Axapta.
Visit www.frappr.com/axapta for axapta friends. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/Axapta-Knowledge-Village/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to