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

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Not able to receive value in primary key

(0) ShareShare
ReportReport
Posted on by 72

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;

I have the same question (0)
  • Suggested answer
    Suresh Kulla Profile Picture
    50,233 Super User 2025 Season 2 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

Responsible AI policies

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

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 4,132

#2
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 3,615

#3
Sumit Singh Profile Picture

Sumit Singh 2,912

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans