Is it possible to change the color of a linkFied ?

Certified Senior Developer

Hi,

I would need to colorise a a!linkField. I've tried with a!richTextDisplayField() and a!richTextItem(color: ...) but it does not work.

How would you do (if it is possible)?

a!gridColumn(
  label: "contract",
  value: a!linkField(
	links: {
	  a!recordLink( 
		label: ...,
		recordType: ...,
		identifier: ...,
	  )
	},
	align: "CENTER"
  ),
  align: "START",
  width: "NARROW_PLUS"
),               

Regards

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Senior Developer

    Hi cedric,

    Your thinking of using the a!richTextDisplayField actually should work.
    Maybe you forgot to set the text parameter and just used the link. This example should work:

    a!gridField(
    data: local!data,
    columns: {
      a!gridColumn(
    	label: "contract",
    	value: a!richTextDisplayField(
    	  value: a!richTextItem(
    		text: "Your link text in purple",
    		link: a!recordLink( 
    		  label: ...,
    		  recordType: ...,
    		  identifier: ...
    		),
    		color: "#800080" /*purple*/
    	  ),
    	  align: "CENTER"
    	),
    	align: "START",
    	width: "NARROW_PLUS"
      )
    }
    )

    It's important to pass the apperaing text as the parmeter (text) of the a!richTextItem().

    Hope that helps!

    //Kai

  • 0
    Certified Senior Developer
    in reply to kais

    Thank you Kais, yes it works because you've removed the a!LinkField function.
    I already used this workaround, but I would like to know if you can make it working, keeping the LinkField ? 

Reply Children