Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

I have trouble getting the look up value.

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all,

I have trouble getting the look up value. 

 When I look up RM Item from Transfer number, I have item, voucher, avaible qty. I would like to take a voucher corresponding to the RM Item.

Pc1404.png

PC1403.png

Can anyone help me?

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: I have trouble getting the look up value.

    Hi Chaitanya Golla,

    thanks for your reply.

    I want to retrieve all column values ​​when looking for RM items. when i looked up , i want get value of voucher, Avaible qty

  • Suggested answer
    Chaitanya Golla Profile Picture
    Chaitanya Golla 17,225 on at
    RE: I have trouble getting the look up value.

    Hi,

    Please use the following code in your lookup method(modified your query):

    Query                   query = new Query();

       QueryBuildDataSource    qbdsJourLine, qbdsBHS;

       SysTableLookup          sysTableLookup = SysTableLookup::newParameters(tableNum(InventTransferJourLine), _formControl);

       qbdsJourLine = query.addDataSource(tableNum(InventTransferJourLine));  

       qbdsBHS = qbdsJourLine.addDataSource(tableNum(BHS_MaterialUsedForNewProductJournal));

       qbdsBHS.addLink(fieldNum(InventTransferJourLine, TransferId), fieldNum(BHS_MaterialUsedForNewProductJournal, TransferNumber));

       qbdsJourLine.addRange(fieldNum(InventTransferJourLine,

      QtyReceived)).value(strFmt('(%1 > 0)', fieldStr(InventTransferJourLine, QtyReceived)));

       SysTableLookup.addLookupfield(fieldNum(InventTransferJourLine, ItemId), true);

       SysTableLookup.addLookupfield(fieldNum(InventTransferJourLine, VoucherId));

       SysTableLookup.addLookupfield(fieldNum(InventTransferJourLine, BHS_AvaiableQty));

       SysTableLookup.parmQuery(query);

       SysTableLookup.performFormLookup();

    It generates the following query :

    SELECT * FROM InventTransferJourLine(InventTransferJourLine_1) WHERE (((QtyReceived > 0)))

    JOIN * FROM BHS_MaterialUsedForNewProductJournal(BHS_MaterialUsedForNewProductJournal_1)

    ON InventTransferJourLine.TransferId = BHS_MaterialUsedForNewProductJournal.TransferNumber

    Hope this helps you.

    Thanks,

    Chaitanya Golla

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: I have trouble getting the look up value.

    thanks for your reply.

    I had the solution. I will use lookup form. I will create ok button when I want to get the current value

  • Fredrik Sætre Profile Picture
    Fredrik Sætre 12,644 on at
    RE: I have trouble getting the look up value.

    This looks like some special customization based off of some customized data that all ready exist. If you want help with this you probably would have to explain more what you are doing...  You won't normally have a FG-RM relationship in Transfer journals. That is something that production orders are used for.

    You find the relationship between production order in ProdBOM, but ProdCalcTrans can give you insights to actually consumed and estimated item consumption.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans