web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Lookup Fixed Asset in Purchase Order Ax 2012

(0) ShareShare
ReportReport
Posted on by

Hi experts,

Im making lookup for asset number because the standard setting for asset number cannot do any filter while the user need the asset number can be filter.

0181.1.png

Above is the standard lookup for the asset number in purchase order.

Here is the picture after Im doing the custom

7532.2.png

The lookup can be filter, below is the code I made to do the lookup

public void lookup()
{
    //AssetTable::lookupInvoiceAsset(this, curext());
    SysTableLookup          sysTableLookup  = SysTableLookup::newParameters(tablenum(AssetTable), this);
    Query                   query           = new Query();
    QueryBuildDataSource    queryBuildDataSource;
    QueryBuildRange         queryBuildRange;
    ;
    sysTableLookup.addLookupfield(fieldnum(AssetTable, AssetGroup));
    sysTableLookup.addLookupfield(fieldnum(AssetTable, AssetId));
    sysTableLookup.addLookupfield(fieldnum(AssetTable, Name));

   //BP deviation documented
    queryBuildDataSource = query.addDataSource(tablenum(AssetTable));
    queryBuildRange = queryBuildDataSource.addRange(fieldnum(AssetTable, AssetId));
    //queryBuildRange.value(Global::queryNotValue(TableName.fieldname));

    sysTableLookup.parmQuery(query);
    sysTableLookup.performFormLookup();
}


But after Im choosing one item there is an warning. Below is the warning info log

41131.3.png

What should I check first when the warning is showing up?
I already check some method that contain "Asset" word in the form but there is none that explain about the table Fixed Assets.
Can some one tell me what should I check to repair the warning?
Your help mean a lot to me

Thanks and Regards,
Enggar

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mea_ Profile Picture
    60,284 on at

    Hi Putri Enggar Ningrum Ika Pamulat,

    You getting this error because your lookup selects Asset group, not Asset id. To fix it you need to change code from

    sysTableLookup.addLookupfield(fieldnum(AssetTable, AssetId));

    to

    sysTableLookup.addLookupfield(fieldnum(AssetTable, AssetId), true);
  • Community Member Profile Picture
    on at

    Hello ievgen,

    Yes you are right, I need to change my code.

    Thanks for your help, now the lookup run smootly

    Thanks and regards,

    Enggar

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans