Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

Want to remove hyperlink from form control

Posted on by 2,430

Hi All,

when the form is in edit mode the control has lookup behavior which is required but when it is in non-edit mode, it is hyperlinked which I don't want.

The following picture represents edit mode behavior.

0842.1.JPG

The following picture represents non-edit mode behavior and contain hyperlinked data.

1018.2.png

I just want to remove hyperlink from the text in non-edit mode.

Thanks,

Raziq

  • krishna.rao@dax Profile Picture
    krishna.rao@dax 2,947 on at
    RE: Want to remove hyperlink from form control

    Also you could make " Enable Form ref " property of control to - No

    Forum_5F00_D365FO_5F00_DisableHyperLink.png

  • Suggested answer
    Mohammad Raziq Ali Profile Picture
    Mohammad Raziq Ali 2,430 on at
    RE: Want to remove hyperlink from form control

    Yes, I have done it.

    I coded this in run method of form and got black color text.

    if(!this.inViewMode())

    {

     Control.colorScheme(FormColorScheme::RGB);                                        Control.backgroundColor(WinAPI::RGB2int(255,255,255)); 

     Control.foregroundColor(WinAPI::RGB2int(0,0,0));

     }

    Thanks for douglas for your hint...

    Thanks,

    Raziq

  • Mohammad Raziq Ali Profile Picture
    Mohammad Raziq Ali 2,430 on at
    RE: Want to remove hyperlink from form control

    Hi Douglas Noel,

    That's what I want exactly which you have posted but the text should be in black color.

    Thanks,

    Raziq

  • Verified answer
    Douglas Noel Profile Picture
    Douglas Noel 3,905 on at
    RE: Want to remove hyperlink from form control

    Hi Mohammad,

    a dirty solution (for this one control could be the following:

    overwrite the mothods jumpref, mousenter, mouseleave, the hyperlinks isn't shown anymore

    public void mouseEnter(int _x, int _y, int _button, boolean _Ctrl, boolean _Shift)
    {
        if (!element.inViewMode())
        {
            super(_x, _y, _button, _Ctrl, _Shift);
        }
    }
    
    public void mouseLeave()
    {
        if (!element.inViewMode())
        {
            super();
        }        
    }
    
    public void jumpRef()
    {
        if (!element.inViewMode())
        {
            super();
        }
    }


    regrads

    Douglas

  • sohaibcheema Profile Picture
    sohaibcheema 46,592 User Group Leader on at
    RE: Want to remove hyperlink from form control

    in addition to what I suggested before do one thing more i.e you can add what Bhaskar has told i.e set ViewEditMode = Edit (on control properties)

  • Mohammad Raziq Ali Profile Picture
    Mohammad Raziq Ali 2,430 on at
    RE: Want to remove hyperlink from form control

    Hi Sohaib bhai,

    I don't want blue color hyperlink itself.

    Thanks,

    Raziq

  • 5400 Profile Picture
    5400 7,160 on at
    RE: Want to remove hyperlink from form control

    Hi Raziq,

    I can say one workaround, If edit mode it is going to correct master table, you can set default property of control as "Edit" instead of "Auto".. it will be always edit mode.

    Thanks

    Bhaskar

  • sohaibcheema Profile Picture
    sohaibcheema 46,592 User Group Leader on at
    RE: Want to remove hyperlink from form control

    The requirement is not making much sense, but can be achieved as following

    Go on DataSource, Reach to field where you want to stop "View Details"

    and write method as under

    public void jumpRef()

    {

       //super();

    }

    this should make hyperlink non-workable. you would not be able to "View Details". also nothing will happen if you will click hyperlink

  • Mohammad Raziq Ali Profile Picture
    Mohammad Raziq Ali 2,430 on at
    RE: Want to remove hyperlink from form control

    Hi André Arnaud de Calavon,

    I just don't want this field to be hyperlinked.

    Is it feasible?

    Thanks,

    Raziq

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 288,420 Super User on at
    RE: Want to remove hyperlink from form control

    Hi,

    I assume this is a customization? Then check if the correct menu item is used as FormRef on the table and also if the relation is setup correctly between this field and the reference table.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,420 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,672 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans