Hello.
I'm new to Nav coding, so please don't be mad at me. And i'm not native english speaker.
So, I have a task:
I need to show different bank accounts of my company in a report (MS Word), it depends of Customer Agreement Line (seems like it was added by previous IT-dude) containment. Table Customer Agreement Line contain rows like Building, Floor, Item, Area etc.
For example - I need to print a report for customer AAA, which is renting an item at Building Delta, so I need to use Bank Account 1. Then I need to make a report for customer BBB, which is renting an item at Building Bravo, so I need to use Bank Account 2 for same report.
As I see, I need to check a building code in "AfterGetRecord" trigger. I can do that. But how can I choose one of Bank Accounts for report?
I understand IF ELSE logic, but I still not figured out how can I work with selections from tables. I see something like this:
IF CustAgreementLine.Building='Delta" THEN BEGIN
Select * From BankAccounts where BankAccounts.No=1
BankName:=BankAccounts.Name
BankBIC=BankAccount.BIC
END;
Obviously, standard SQL queries ain't work like this in NAV, I think there must be some temporary table, which is filled with records, that match my query terms. And the records from temp table will be shown in a report.
So I need help with it-)
*This post is locked for comments