Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Converting returned ID in code to link

Posted on by 65

Hello,

I have a info bar being generated that holds a value (ClaimId) that I would like to see returned as a hyperlink. Currently, the value is just being inserted into the info bar and being returned as a static value. 

public List frgetUsingClaimList()
{
    List                cl =   new List(Types::String);
    VMClmClaimHeader    clHe;
    VMClmClaimOperation clmOp, thisop;

    while select thisop where thisop.ClaimId == this.RecId
    {
        while select ClaimId from clHe
        // 4273
        where clHe.VINNumber == this.VINNumber && clHe.frPortalLock == NoYes::No
        join clmOp
            where clmOp.ClaimId     ==   clHe.RecId
            &&    clmOp.ClaimId     !=   thisop.ClaimId
            &&    clmOp.OperationId == thisop.OperationId
            &&    !clmOp.SubOperation
            &&    !thisop.SubOperation
        {
            cl.addEnd(strFmt("@VMS758",clHe.ClaimId,clmOp.authOperation().OperationId));
        }
    }

    return cl;
}

cl is the info bar list

clHe is where I'm grabbing all messages for the infobar related to the claim

clmOp is the current claim record instance that is being used to find the related claim messages. 

cl.addEnd is where I'm thinking I'd like to convert the value (clHe.ClaimId) to a hyperlink. I've seen mentioning of a URL extended data type and wondered if that was reusable for this particular code solution.

Also, a bridge I'll have to cross once I figure out if my question is even possible, strfmt might not take a hyperlink as it's input even though the hyperlink is just a string. I'm not sure if the system will recognize that once it's converted and passed.

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,188 Most Valuable Professional on at
    RE: Converting returned ID in code to link

    I don't think that there is proper documentation, but you'll surely be able to find some blog post or so. Also, don't forget that you have the whole standard application available, therefore you can use cross-references to find out some real examples.

    I'm not sure what exactly you want to achieve, but at least try something like this:

    aRecordToFilterBy = ... find a record based on clHe.ClaimId ...
    
    SysInfoAction_FormRun infoAction = SysInfoAction_FormRun::newFormName(formStr(VMClmClaim));
    infoAction.parmCallerBuffer(aRecordToFilterBy);
    
    info("A message", '', infoAction));

  • JGjinx321 Profile Picture
    JGjinx321 65 on at
    RE: Converting returned ID in code to link

    Do you have a link to the documentation around SysInfoAction???

  • JGjinx321 Profile Picture
    JGjinx321 65 on at
    RE: Converting returned ID in code to link

    Yes, a windows application. Thanks for the response and help! The link should point to a claim within the windows application itself. It should take you to another form within AX specifically my VMClmclaim form. This form will show a list of claims all related to a specific VIN number. So I'll probably have to do a search on my table containing VIN's to find all related claims once this hyperlink is clicked.

  • Martin Dráb Profile Picture
    Martin Dráb 230,188 Most Valuable Professional on at
    RE: Converting returned ID in code to link

    Where do you want to show it? If in AX 2012, a hyperlink as such isn't likely going to help you, because AX 2012 client is a Windows application, not a web application. I think you'll need an infolog action instead. It means creating an instance of a class inheriting from SysInfoAction, populating it with data (if applicable) and using it as the third argument of info().

    Or do you mean Enterprise Portal? That's a web application, therefore putting a hyperlink direcly to infolog might work. But you'd need to know how which URL to use. An infolog action may still be a better way.

    If you need a more specific answer, please tell us also what the link should point to.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans