I have a flow field that I want to show the account number for the bank account selected in a payment journal. What I would like to do is actually just show the last 4 digits of the field. Is there a way to do that within my AL code?
Hi,
Can you try this instead of Flow field?
trigger OnAfterGetRecord()
var
BankAccount: Record "Bank Account";
begin
lastDigit := '';
if BankAccount.get(<youraccountno.>) then
lastDigit := CopyStr(BankAccount."Bank Account No.", 1, 4);
end;
var
lastDigit: Code[4];
Hi, You can't do it with Flowfield, you need to add another field.
Then use the following two methods should be able to get the last four digits.
Text.CopyStr(Text, Integer [, Integer]) Method
Text.MaxStrLen(Variant) Method
Hope this can give you some hints.
Thanks.
ZHU
You have the extended data type property that you can use to mask a field:
Hi,
The Calcformula doesnt allow for functions like "Trim" to work inside or outside the Lookup function.
I would suggest to create a new field Bank Account called "Last Digits". Let this field populate on the Onvalidate Trigger of the Account No.
Let the lookup look to the new field created.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,219 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156