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)

how to get bank account num using salestable.WorkerSalesResponsible ?

(0) ShareShare
ReportReport
Posted on by 335

this not working for me

info(strFmt("%1",  HcmWorkerBankAccount::find(HcmWorker::find(salestable.WorkerSalesResponsible).RecId).AccountNum)) ;

advance thanks

zeeshan

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    because HcmWorkerBankAccount::find( is expecting some other values than what you provided.

    if you want to get primary bank of worker use following

    HcmWorkerBankAccount::findPrimaryBankAccount

  • Zeeshan Adeel Profile Picture
    335 on at

    there is no method with the name 'findPrimaryBankAccount'

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    not sure which version of AXC your are using.

    can you mention your application version

  • Zeeshan Adeel Profile Picture
    335 on at

    AX 2012 R3

  • Verified answer
    Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    you are right. I missed the point, as I just checked on my Box where an ISV solution was installed.

    Okay, let talk about your initial post, you are not getting results because method find of HCMWokerBankAccount is asking you RecId of  HCMWokerBankAccount, you are providing RecId of Worker. So don't expect an output.

    you can write a query to get all/first only record which is related to workerusing where clause as under

    HCMWokerBankAccount.Worker == _ProvidedValue

    or another option can be if you want to use findByWorkerAccount(method) of HCMWokerBankAccount, which will ask you for Woker and AccountId, because structure allows to save multiple bank accounts for same worker

  • Verified answer
    Zeeshan Adeel Profile Picture
    335 on at

    static void WorkerBankDetails(Args _args)

    {

       HcmWorkerBankAccount hcmWorkerBankAccount;

       select * from hcmWorkerBankAccount

       where hcmWorkerBankAccount.Worker== 5637146180;

       info(strFmt("%1", hcmWorkerBankAccount.AccountNum ));

       info(strFmt("%1", hcmWorkerBankAccount.AccountId ));

       info(strFmt("%1", hcmWorkerBankAccount.BankAccountType ));

       info(strFmt("%1", hcmWorkerBankAccount.Name ));

    }

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
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans