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 ? 

  • 0
    Certified Senior Developer
    in reply to cedric01

    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?

Reply Children