Skip to main content

Notifications

Microsoft Dynamics NAV forum
Suggested answer

Not able to receive value in primary key

Posted on by 70

As per the screen i have 3 field in primary key and i want to retrieve the field value in primary key .Below code i have written to get the values in primary key where Bankaccreconcileheader is record type of Bank Acc. Reconciliation table.when i am executing my code i am not to get values from the Bank Acc. Reconciliation table.

can anyone suggest for the same.through i have use get function but i got an error 'The type navoption is unknown'.

pastedimage1581073913855v1.png

Bankaccreconcileheader.RESET;
Bankaccreconcileheader.VALIDATE("Bank Account No.",bankacc."No.");
Bankaccreconcileheader.SETRANGE("Bank Account No.",Bankaccreconcileheader."Bank Account No.");
Bankaccreconcileheader.SETRANGE("Statement No.",Bankaccreconcileheader."Statement No.");
IF Bankaccreconcileheader.FINDFIRST THEN BEGIN REPEAT
BankaccReconciline.INIT;
//BankaccReconciline.VALIDATE("Bank Account No.",bankacc."Bank Account No.");
//BankaccReconciline.VALIDATE("Bank Account No.",Bankaccreconcileheader."Bank Account No.");
BankaccReconciline."Bank Account No.":=Bankaccreconcileheader."Bank Account No.";
BankaccReconciline."Statement No.":=Bankaccreconcileheader."Statement No.";
BankaccReconciline."Statement Line No."+=10000;
//EVALUATE(BankaccReconciline."Statement Line No.",GetvalueAtCell(RowNo,1));
EVALUATE(BankaccReconciline."Transaction Date",GetvalueAtCell(RowNo,2));
EVALUATE(BankaccReconciline.Description,GetvalueAtCell(RowNo,3));
EVALUATE(BankaccReconciline."Check No.",GetvalueAtCell(RowNo,5));
EVALUATE(BankaccReconciline."Statement Amount",GetvalueAtCell(RowNo,6));
EVALUATE(BankaccReconciline."Applied Amount",GetvalueAtCell(RowNo,7));
EVALUATE(BankaccReconciline."Value Date",GetvalueAtCell(RowNo,9));

BankaccReconciline.INSERT(TRUE);
UNTIL Bankaccreconcileheader.NEXT=0;
END;

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,640 on at
    RE: Not able to receive value in primary key

    You get that error when you don't filter the option field.  You need to apply the SETRANGE not validate

    Bankaccreconcileheader.VALIDATE("Bank Account No.",bankacc."No.");

    and to SETRANGE you are using the same table to filter, you need to replace the below with bank account no. you want to filter

    Bankaccreconcileheader.SETRANGE("Bank Account No.",Bankaccreconcileheader."Bank Account No.");

    to

    Bankaccreconcileheader.SETRANGE("Bank Account No.",BankAcc."No."); and statement from BankAcc table

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,524 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,493 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans