I dont know which table you are using for your journal line so for
this example I will just call it Journal Line and the datasource for
your lookup I will call LookupTable
Suppose you have a field on that table called CompanyID that
contains the company identifier you wish as the basis of your Lookup.
In your Lookup form, create an Init method someting like this:-
Public Void Init()
{
JournalLine JournalLine;
Super();
Jounalline=element.args().record();
LookupTable_DS(JournalLine.CompanyID);
}
This will cause your lookup form to present records from the company
specified on your Journal Line. Isn't that what you want?
--- In [email protected], "axapta_coder"
<[EMAIL PROTECTED]> wrote:
> Hi Alla,
> Thanks for your reply. My issue is not setting a default comany of
a
> data source.
> My issue is inter-company transactions.
> Imagine doing a GL journal entry where your debit balance is
posted
> to a designated GL account in company "100", while the Credit
> balance must be posted to another GL account in company "200".
> standard Axapta let's you lookup and select an account based on
your
> company selection. Using the same logic, I need my custom field to
> look up company dependent records. It curently looks up records
> based of my curExt() and not the company I'm selecting on the
> journal line!
>
> // Thanks a bunch.
>
>
> --- In [email protected], "allanwallis"
> <[EMAIL PROTECTED]> wrote:
> > When you specify a datasource in a form, you can specify which
> company
> > the data is derived from.
> > So you could for example have one datasource for each company
and
> put
> > each on a separate tab of your lookup form.
> >
> > I believe that you can also set the company for the datasource
in
> the
> > init method of your lookup form, e.g. LedgerTable_DS.company
('aaa')
> >
> > Hope this helps
> >
> >
> >
> > --- In [email protected], "axapta_coder"
> > <[EMAIL PROTECTED]> wrote:
> > >
> > > I have a table from which I'm looking up a field value via a
> Journal
> > > Line (LedgerJournalTransDaily).
> > >
> > > This value is used in relation to an Inter-Company transaction
> and
> > > therefore needs to be a company specific lookup. Pretty much
> like
> > > standard Inter-Co entries where a GL account is looked up
based
> on
> > > account type but most importantly by company account.
> > >
> > > I need to make my table lookup to be company dependent and not
> > looking
> > > up values from the current company I'm standing on.
> > >
> > > Any suggestions will be greatly appreciated.
YAHOO! GROUPS LINKS
- Visit your group "development-axapta" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

