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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

EP encryption from X++

(0) ShareShare
ReportReport
Posted on by 815

Dear All,

 

Does anybody know how to generate encrypted URLs from X++?

 

What I need to do is, from X++ to generate EP record context strings to specific records.

When the EP encryption is on, strings have to be encrypted.

 

Any ideas how to achieve that from X++?

 

Best regards,

Sasha.

 

*This post is locked for comments

I have the same question (0)
  • Luegisdorf Profile Picture
    1,930 on at

    Hi Sasha

     Have you already tried to build the link with the WebLink class?

        WebLink webLink;
    
        ;
    
        webLink = new WebLink();
    
        webLink.record(YOUR_RECORD)
        webLink.menufunction(new WebUrlMenuFunction(weburlitemstr(YOURPAGE)));
    
        webSession().redirect(webLink);
    

       

    Regards

  • Sasha Profile Picture
    815 on at

    Hi Luegisdorf, 

     

    Yes, indeed I was trying this. 

     

    Basically this is what I was trying:

     

    str         url;
     

    WebLink     webLink = new WebLink();
    ;

    webLink.menufunction(new WebUrlMenuFunction(weburlitemstr(My_url)));
    webLink.record(my record);

     

    url = webLink.url();

     

    As you can see, I'm trying to get an encrypted url as a string.

     

    The problem is that inside webLink.url() it throws an error if there is no webSession():

     

    WebSession webSession = webSession();

     

    if (!webSession)
        {
            throw error('No web session.');
        }
     

     

    ... I might be wrong of course, but my understanding of the webSession() is that it exists when BC connects to AOS(not client) (Please correct me if I'm wrong)))

     

    But I need to generate URL from the client, any ideas?

     

    Thanks in advance,Sasha. 

     

  • Luegisdorf Profile Picture
    1,930 on at

    webSession should be available if you are working inside Dynamics AX web framework, it's not aviailable in debug-mode in Visual Studio (say if you are trying to debug a web part control).

    Is this your case?

  • Sasha Profile Picture
    815 on at
    Hm... What exactly you mean by working inside AX web framework? Well, again I might have a limited knowledge in this area as recently started EP development :) But I thought that basically only EP stuff will be executed by AX web framework. 

    But in my case I need use WebLink from Axapta.

      

    Is that possible?

    Another question, how could I work inside web framework? :)

    Thanks in advance.

    Sasha. 

     

     

     

     

  • Luegisdorf Profile Picture
    1,930 on at

    Ah, that means, that you are trying to build the link with a program which is executed by the AX Windows Client, right?

     Well, without a web session you cannot create encrypted links, because the encryption is based on web session object properties (the encription key is dynamic).

    I think the only possiblity to use predefined links is to use a own argument, f.ex: https://yourEP/yourSite.aspx?YOURQUERYPARM=777,123

    And in the target you process the YOURQUERYPARM. You can select or view the related record using your new url query expression.

    May be you need to encrypt and decrypt your '777,123' (which could contain tableid, recId or whatever) on your own, if you need maximum security.

    Regards
    Patrick

  • Sasha Profile Picture
    815 on at

    Hi Patrick,

     Yes, I'm doing this from the client :) Basically, what I'm trying to do is to generate email messages with urls to specific records.

    Say, for example, we have Customer Detail form.

     

    Once you click on the URL I'm trying to generate, the EP Customer Detail form should be open for that specific customer.

     

    So, my idea was inside AX client to generate record context say for a specific customer, encrypt it, generate URL and send as an email message.

     

    But it seems to be a problem as far as I understand.

     

    But on the other hand I don't think that's impossible....

     

    What do you think?

     

    Sasha. 

     

    P.S. Best regards from Patrick Bovens  from NL ;)

     

     

  • Luegisdorf Profile Picture
    1,930 on at

    Hi Sasha

    I think it's possible with the suggested custom url query expression. I know this will raise development issue on enterprise portal components. But I definitly think it's impossible to create encrypted links without the dynamic property values from a web session object. I don't know exactly what the encryption ingredents in case of AX are, but for sure there will be IIS/Sharepoint session id and stuff like this ... which are dynamic and which you just don't know if you havent no websession available.

    What do you think?

    Yes, but not with the default record parameters ...

    Regards
    Patrick

  • Sasha Profile Picture
    815 on at

    Thanks Man,

    I will try to investigate in more details then.

    BR,

    Sasha. 

     

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans