Hi Robert,

Add the following display method to the PriceDiscTable:

display CustName CustomerName()
{
    CustName retVal = "";

    ;

    if (PriceDiscTable.AccountCode == TableGroupAll::Table)
    {
        retVal = CustTable::find(PriceDiscTable.AccountRelation).Name;
    }

    return retVal;
}

Then drag and drop the method onto the grid in the PriceDiscTable. Make sure
you set the DataSource of the control to PriceDiscTable. Each time you
change the AccountCode, the correct customer name should display.

Hope this helps. --Tom

Tom Kim
Microsoft Business Solutions Certified Professional
Advanced Systems Integration, Inc.
26449 Rancho Parkway South
Lake Forest, CA 92630
949-597-2170
949-597-0720 (Fax)
[EMAIL PROTECTED]
www.advancedsystemsintegration.com

-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of drescher_r
Sent: Monday, August 29, 2005 2:50 PM
To: [email protected]
Subject: [development-axapta] Refreshing Values in Form's DataFields

I need to display the customers name in the Trade Agreement form,
like if i enter the account number, the next field shows the matching
name... i thought about using a display method, which gets the Name
by find from CustTable...

return CustTable::find(PriceDiscTable_AccountRelation.valueStr
()).Name;

The Field containing the Account Number has AutoDeclare, so it should
be accessible by this method...

Since the display method is initialized when opening the form, it
needs to be updated whenever the AccountNumber changes... That's why
i wrote a leave method for PriceDiscTable_AccountRelation which
updates the Name-Field (called AccountName)...

    boolean ret;

    ret = super();
    AccountName.update();
    return ret;

According to my (obviously wrong) logic, the form should take the
value from PriceDiscTable_AccountRelation, look it up in CustTable
and return the Account Name to the next Data Field. Whenever I select
PriceDiscTable_AccountRelation and leave it again, the value of
AccountName should be refreshed...

but AccountName stays empty... Could anyone tell my why?

Thanks a lot from a X++ newbie

Robert









Yahoo! Groups Links













SPONSORED LINKS
Microsoft business solution Microsoft axapta Basic programming language
Computer programming languages Programming languages Java programming language


YAHOO! GROUPS LINKS




Reply via email to