Skip to main content
Known Participant
Jan 15, 2022 6:35 PM UTC
Question

Is it possible to change the color of a linkFied ?

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

8 replies

New Participant
Jan 15, 2022 8:37 PM UTC

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

Known Participant
Jan 15, 2022 9:27 PM UTC

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 ? 

New Participant
Jan 15, 2022 9:31 PM UTC

Hi cedric,

Sure, because the a!linkField() doesn't support colouring. Therefore, you need to use the richText Object if you want to have control over the clour. May I ask why you want to use the linkField insted of the richText?