RE: [Axapta-Knowledge-Village] Modifying lookups forms

2007-02-14 Thread p.saravanakumar
Dear Friends
 
Any body have SQL Query for using custtrans, custtransopen and
custsettlement table for taking age wise customer outstanding data from
the database directly.
 
If yes please send it me, my customers wants the data urgently.
 
 
 
Regards
 
P Saravanakumar
09894999281
 


[Non-text portions of this message have been removed]



Re: [Axapta-Knowledge-Village] Modifying lookups forms

2007-02-07 Thread Marko Salonen
Thank you Anil, this is just what I was after :)

I'm off to test this right away.

--Marko

On 06/02/07, Anil Ozay [EMAIL PROTECTED] wrote:
 Hi Marko,

 You can extend the SysTableLookup class. This class uses container to store
 fieldId and returmItem values, to create a lookup grid.


Re: [Axapta-Knowledge-Village] Modifying lookups forms

2007-02-06 Thread Marko Salonen
In 06/02/07, Amit Jain [EMAIL PROTECTED] wrote:
 Cant you do this, on your field ? Why do you want to change properties from
 lookup method?

On the field, where?


Re: [Axapta-Knowledge-Village] Modifying lookups forms

2007-02-06 Thread Anil Ozay
Hi Marko,

You can extend the SysTableLookup class. This class uses container to store
fieldId and returmItem values, to create a lookup grid.

If you look at buildGrid function of this class, you can see :

[fieldId, returnItem, method] = conpeek(lookupItems, i);

This means that : get the i'th item of container and set values to fieldId,
returnItem and method variables.

After that, you can see this lines in the same method :

if (!method)
{
 formBuildControl =
_formBuildGridControl.addDataField(_formBuildDataSource.id(), fieldId);
 .

This is the critical part! You used addLookupField method to insert
fieldId and returnItem values to container. And AX creates a
formBuildControl object belongs to your fieldId. When you look at the
methods of formBuildControl, you can't see the width() method! But you can
solve this problem, too.

If you want to try the solution, let's continue to these steps in
SysTableLookup class :

*1.* Extend addLookupField method, or write a new method :

void addLookupfield(fieldId _fieldId, boolean _returnItem = false,int
_width=0)
{
lookupItems += [[_fieldId, _returnItem,_width]];
}

2.  Extend buildGrid method to use width value :

protected FormBuildGridControl buildGrid(FormBuildGridControl
_formBuildGridControl,
 FormBuildDataSource
_formBuildDataSource)
{
FormBuildControlformBuildControl;
Object  obj;
boolean returnItem;
boolean method;
int fieldId;
int i;
int width;
;


for (i = 1; i = conlen(lookupItems); i++)
{
[fieldId, returnItem,width, method] = conpeek(lookupItems, i);

if (!method)
{
formBuildControl =
_formBuildGridControl.addDataField(_formBuildDataSource.id(), fieldId);
if(width != 0)
{
obj = formBuildControl;
obj.width(width);
}

if (i == 1 || returnItem)
{
controlIdx = formBuildControl.id();
lookupField = fieldId;
}
.

I tested it and it is working pretty.. But it can be necessary another test
scenarios, because we changed the execution of system class.

If you want to test this,you can give width property on third parameter. If
you don't, standart width will be used.

sysTableLookup.addLookupfield(fieldNum(CustTable, AccountNum),true,*150*);
I hope, this method can help you. If you decide to use it, please test
carefoully.


Best regards,
Anil Ozay
MVP Dynamics AX


On 2/6/07, Marko Salonen [EMAIL PROTECTED] wrote:

   In 06/02/07, Amit Jain [EMAIL PROTECTED] amitjain_in%40yahoo.com
 wrote:
  Cant you do this, on your field ? Why do you want to change properties
 from
  lookup method?

 On the field, where?
 



[Non-text portions of this message have been removed]



[Axapta-Knowledge-Village] Modifying lookups forms

2007-02-05 Thread Marko Salonen
Hello.

I've created a lookup form in 4.0 using Axeptapedia's code example
(http://www.axaptapedia.com/SysTableLookup_class). The lookup works
just fine, but is it possible to modify its properties, like column
widths or form height?

Regards,

-- Marko Salonen


Re: [Axapta-Knowledge-Village] Modifying lookups forms

2007-02-05 Thread Amit Jain
Cant you do this, on your field ? Why do you want to change properties from 
lookup method?

Marko Salonen [EMAIL PROTECTED] wrote:  Hello.

I've created a lookup form in 4.0 using Axeptapedia's code example
(http://www.axaptapedia.com/SysTableLookup_class). The lookup works
just fine, but is it possible to modify its properties, like column
widths or form height?

Regards,

-- Marko Salonen


 

 
-
Have a burning question? Go to Yahoo! Answers and get answers from real people 
who know.

[Non-text portions of this message have been removed]