How to Get Account Name in RDLC and add 3rd and 4th Dimensions

Dears, Good day to all…

Thanks in advance for your support,

I am creating a new Layouts like the below:

I tried to get the Account Name (it should be getting from several tables based on the Account type)

Also, I need to add the Third and Fourth Dimensions.

Here al the codes and rdlc file https://github.com/mahmoud-algindy/Gindy-Business-Central-Extensions

Dear Mahmoud,

For the Name you can use this to get it,

case “Source Type” of “Source Type”::Customer: IF Customer.READPERMISSION THEN IF Customer.GET(“Source No.”) THEN SourceName := Customer.Name;

“Source Type”::Vendor: if Vendor.READPERMISSION then if Vendor.GET(“Source No.”) then SourceName := Vendor.Name;

“Source Type”::Employee: if Employee.READPERMISSION then if Employee.GET(“Source No.”) then SourceName := Employee.“Last Name”;

“Source Type”::“Fixed Asset”: if FixedAsset.READPERMISSION then if FixedAsset.GET(“Source No.”) then SourceName := FixedAsset.Description;

“Source Type”::“Bank Account”: if BankAccount.READPERMISSION then if BankAccount.GET(“Source No.”) then SourceName := BankAccount.Name;

As for the dimensions

GLSetup.GET; DimensionSetEntry.RESET; DimensionSetEntry.SETRANGE(“Dimension Set ID”, " Gen. Journal Line " .“Dimension Set ID”); DimensionSetEntry.SETRANGE(“Dimension Code”,GLSetup.“Shortcut Dimension 3 Code”); IF DimensionSetEntry.FINDFIRST THEN BEGIN DimensionSetEntry.CALCFIELDS(“Dimension Value Name”); Dimension3Name := DimensionSetEntry.“Dimension Value Name”; END;

Dear [mention:c631451bdb884042a91594b4c8f131b8:e9ed411860ed4f2ba0265705b8793d05]

Thanks so much, but where I shall put this code, do I require to add in a Codeunit ?

I added in the Codeunit and I got this error

Add it on “OnAfterGetRecord” in the GL Entry Datatem

Dear [mention:c631451bdb884042a91594b4c8f131b8:e9ed411860ed4f2ba0265705b8793d05]

Thanks so much still I am not able to achieve it, I did the following to understand the concept with only Vendor and Customer “later I will add the rest”

case "Source Type" of
"Source Type"::Customer:
IF Customer.READPERMISSION THEN
IF Customer.GET("Source No.") THEN SourceName := Customer.Name;

"Source Type"::Vendor:
if Vendor.READPERMISSION then
if Vendor.GET("Source No.") then SourceName := Vendor.Name;
end;

But the VS did not recognize what is Customer and Vendor, hence I added a global var as per the below:

        Var
        
        SourceName: Text;
        Customer: Record Customer;
        Vendor: Record Vendor;

Now the errors disappeared and I am able to add a new Column here

dataitem(DataItemName; "Gen. Journal Line")

        {

            RequestFilterFields = "Journal Template Name", "Journal Batch Name", "Document No.";
            // RequestFilterHeading 

            column(SourceName; SourceName)
            {

            }

As I am a beginner in AL I’m not sure what I did is correct or not,
I added the new filed to the RDLC file and Published but the, unfortunately, the value appeared on the Preview is BLANK

Thanks for the help in advance.

I watched most of DLP courses but I saw it’s just quick start and not enough at all.

Mr Erik

[mention:61b2aa9ce72e429baa1ef43208ddbea4:e9ed411860ed4f2ba0265705b8793d05]

Could you please help, also how I can become good in Business Central AL Coding

Join a training-class. You are spending way to much time on trying to figure out how things work. And it will literally take you months if not years to learning on your own. A trainingclass with an instructor will speed up that process in so many ways that you cant’t even imagine it.

Its more or less like, getting a drivers permit… It an only be done with a driving-instructor and a number of training classes.

There are unfortunately no shortcut to learn the development with only reading blogs and watching youtube videos.

Did you find a solution for this ???

A CASE always need an

END;

This is basic development, so this is something you really should have found out by know. Also hovering over the word CASE should also tell you that the END is the problem.

Thank you [mention:74275055534c437ab13054c27a1ed5fb:e9ed411860ed4f2ba0265705b8793d05]

I sent you a private message