How to create a link on a field in a table component

AvinashAvinash Member
edited February 4 in Questions
HI community, I have a text field (Asset_id__c) which generates a unique string when a record is created. I have a table which shows the Asset_id__c text field on it. Now this just a custom field and doesn't act a link to navigate to the detail view of the record. Is there any way to show it as a link and navigate to the detail view of the record when clicking on the link. thank you

Comments

  • Tom ScalzoTom Scalzo Member
    edited February 4
    Avinash,
    Have you tried a template field in it's place with the {{ }}?

    Double “{{  }}” - subject to Field Rendering Code. Will display as a link

    Triple   “{{{ }}}” - Not subjected to Field Rendering Code. Just shows the data (no link)

    -- Tom Scalzo

  • AvinashAvinash Member
    edited December 2016
    I tried it. But it is not working image The unique code field is not working as a link image
  • Mark DeSimoneMark DeSimone Skuid Mod admin
    edited December 2016
    Building on Tom's suggestion, if the field's metadata wouldn't normally result in a link to your desired page (which may be what's getting in your way here), you would need to wrap the triple brackets in an HTML tag, like this:

    <a href="/apex/skuid__ui?page=YourSkuidDetailPageName">{{{Asset_id__c}}}</a>

    You'll want to make sure you check the box in the template's properties to "Allow HTML" too. 

    -Mark DeSimone
  • AvinashAvinash Member
    edited December 2016
    Hi Mark,

    It din't work. I used the following tag
    image
    when i preview the page the whole column is not populating any values.
    image

    Can you tell me where am i going wrong?

    thank you
  • Tom ScalzoTom Scalzo Member
    edited December 2016
    Avinash,

    Question: Is there a Skuid page called Asset_Detail (exact spelling)?

    The id is missing from the syntax.  Here is the formula (assuming you're passing the 'id' parameter in this example)

    <a href="/apex/skuid__UI?page=[name of page]&id={{{[local Id field name]}}}">{{{name you want displayed}}}</a>

    Does this help?

    --Tom

  • AvinashAvinash Member
    edited December 2016
    Yes. There is a skuid page called Asset_Detail and that is the detail page i wanted to redirect from this field. Correct me if i am wrong. {{{[local Id field name]}}} --> here within these brackets i am going to have the field API Name which is Asset_Id__c. and in this area {{{name you want displayed}}} i will populate the Label of that field. On the whole my href tag looks like this. {{{Asset id}}} is this correct?
  • Tom ScalzoTom Scalzo Member
    edited December 2016
    Correct, however the displayed name should also point to a field.
    Here's an example of passing Account Details to a page.

    <a href="/apex/skuid__UI?page=AccountDetail&id={{{Account_vod__c}}}">{{{Account_vod__r.Name}}}</a>
  • AvinashAvinash Member
    edited December 2016
    I used this HTMl. {{{Asset_id__c.Asset Id}}} Nothing worked. I want to mention a point here. The string populated on this field is generated by trigger behind it. Is that causing any issue?
  • Tom ScalzoTom Scalzo Member
    edited January 2017
    Hmm, that is a possibility.  The Template is taking the current value of field and passing it as an argument.  If the trigger is changing this value when the Detail page is rendered, then it is possible.
    Here's some things we can check:
    1) What is the URL results when clicking the displayed link?
    2) If you inspect the model  (inspect page, console, skuid.model.map()), look at the data, what is an example value that you are seeing for this field?

    Once you have this value, are you able to insert this into the URL to see that the value is actually a detail record?
    Example: if your SF URL Prefix is na99, and the field value is '000999888' you would go to:
    https://na99.visual.force.com/000999888?nooverride=1
  • AvinashAvinash Member
    edited December 2016
    There is only one string generated on a record and it will not change. So the trigger i have before insert trigger. I exactly did not understand what do you meant by displayed link. Can you explain me about it?
  • RichardRichard Member
    edited December 2016
    Avinash, as has already been mentioned above, you will need to use a template an
    <a href=URL_to_link_to>{{Field_you_want_the_link_display_name_to_be}}</a> type structure.

    URL_to_link_toDependent on whether you have set up a visualforce page to redirect to your detail page or not this will change what you write here. If you have set up the visualforce redirect, all you will need to place here is /{{{Id field of your record}}}. If you have not setup the redirect, then you will need something like Tom wrote above: /apex/skuid__UI?page=[name of page]&id={{{Id field of your record}}}

    Field_you_want_the_link_display_name_to_be: This will be a field you have in your model, or simply text, that you would like the link to show up as.


    For example: When we generate quotes from our opportunity pages we use this. We have a Skuid page called Quotes_View (that we needed because Salesforce used to not have their own Quote View that you could redirect). We had this template running on a table for our Quote model:

    <a href="/apex/ui?page=Quotes_View&id={{{Id}}}">{{{Name}}}</a>

    It redirects us to the Quote View page of the quote we selected but the link shows up in the table as the name of the quote.

    image
  • AvinashAvinash Member
    edited February 2017
    Working. Thank you so much guys!!!
  • RichardRichard Member
    edited December 2016
    Great :)
Sign In or Register to comment.