AL icon indicating copy to clipboard operation
AL copied to clipboard

Cannot access "Default Role Center" field for Tenant Profile table even after issue #500 resolved

Open yandko opened this issue 8 years ago • 10 comments

I created profile through profile object as below but still cannot make it default. How I can access Default Role Center field from AL. Thank you.

profile "Power Accountant" { Description = 'Power Accountant'; RoleCenter = "Power Accountant Role Center"; Customizations = MyCustomization; }

yandko avatar May 19 '18 06:05 yandko

Hi @yandko, There are no property on the profile object to set that, but you can change it from code, for instance using the onInstall triggers .

thpeder avatar May 22 '18 14:05 thpeder

hi @thpeder, thank you for the reply. I tried to define record variable to point to Profile table (record 2000000072) but it looks like the system doesn't allow me to do this saying

"The type or method 'Profile' cannot be used for 'Extension' development. Error: The package could not be created."

Maybe it is because Profile is a reserved system keyword for defining Profile object.

local procedure HandleFreshInstall(); var r: Record 2000000072; begin // Do work needed the first time this extension is ever installed for this tenant. // Some possible usages: // - Service callback/telemetry indicating that extension was install // - Initial data setup for use end;

yandko avatar May 22 '18 16:05 yandko

Hi @yandko, The table was made available in the anniversary update, which was released about half a year ago. What version are you running?

thpeder avatar May 23 '18 07:05 thpeder

hi @thpeder, thank you for not leaving this along. I use the latest AL Language VCODE extension 0.15.18771 and NAV Platform Build 21441.

yandko avatar May 24 '18 10:05 yandko

@yandko, Could you try and redownload the symbols in VSCode. Ctrl + Shift + P then type: AL: Download Symbols.

thpeder avatar May 24 '18 14:05 thpeder

@thpeder I did this previously and tried one more time

[2018-05-24 19:57:07.92] Using reference symbols cache path: c:\Users\yandko\Documents\AL\ALProject1./.alpackages [2018-05-24 19:57:07.95] Sending request to http://localhost:7059/Dev110/dev/packages?publisher=Microsoft&appName=Application&versionText=11.0.1441.0&tenant=default [2018-05-24 19:57:07.95] Sending request to http://localhost:7059/Dev110/dev/packages?publisher=Microsoft&appName=System&versionText=11.0.0.0&tenant=default [2018-05-24 19:57:08.06] All reference symbols have been downloaded.

no luck

local procedure HandleFreshInstall();
    var
        r: Record 2000000072;
begin
    // Do work needed the first time this extension is ever installed for this tenant.
    // Some possible usages:
    // - Service callback/telemetry indicating that extension was install
    // - Initial data setup for use
end;

gives

error AL0296: The type or method 'Profile' cannot be used for 'Extension' development. Error: The package could not be created.

yandko avatar May 24 '18 17:05 yandko

AL VsCode extension versions do not work with any server versions. You have to use the AL VsCode extension that was released for the given server version,

kalberes avatar May 24 '18 21:05 kalberes

Hi @yandko, As Kalman pointed out, you should be using the VSIX that came with the DvD. I found the problem and it is that the system symbol file doesn't allow you to use that table and NAV 2018 didn't get that update since it got in after we branched for NAV 2018, so please have a look at: Will features from the latest Dynamics 365 releases be back-ported to NAV 2018? and I found an issue on NAV 2018, what do I do?

thpeder avatar May 25 '18 07:05 thpeder

hi @thpeder, I have reinstalled NAV2018 from "CU 05 NAV 2018 W1" and visual studio code Al Language extension from VSIX file that is coming with this CU (AL Language 0.12.20065). Than re-Downloaded Symbols. Same issue. Neither definition works. It can't create a reference to Profile table.

       r1: Record 2000000072;
       r2: Record 2000000177;
       r3: Record "Tenant Profile";
       r4: Record "Profile"; 

yandko avatar Jun 03 '18 17:06 yandko

Hi @yandko, It wasn't backported to Nav 2018 only Business Central, so I'll fix that.

thpeder avatar Jun 04 '18 14:06 thpeder