0

add Rich Text Fields

Hi there 

I have several rich text fields I want to combine with the format they have. To make it easy let's say that I have RT1, RT2 and Endresult.

If I say  Endresult := RT1+RT2 I get all the text but with no formatting

If I say Endresult := RT1 or Endresult := RT2  - I get the text over from the respective field with formatting

If I play with Endresult := html(RT1)+ html(RT2)  I get the text over with no formatting

If I try to say :

let Xtext:= RT1+RT2; Endresult:= Xtext  -  both with or without html() I still not get the formatting over.

 

I can not take the text and do the html in the script as I don't know if it is bold or headlines or other formatting

Anyone who knows how to combine 2 or more rich text field and still have the formatting.

 

Rghds

Leo

5 replies

null
    • Fred
    • 5 days ago
    • Reported - view

    try:

    html(raw(RT1) + raw(RT2)

    If you just use raw(), you will see the html code that is the backbone of the RichText field. So we need to first get the raw() data from each RichText field, then we can use the html() command to properly display it.

      • Leo_Woer
      • 5 days ago
      • Reported - view

       Super - that worked perfectly - as always with your answers. here is an example of my script, which works :

      let Xurl := 'Link til trænerguiden';
      let NRid := first(select 'Globale Variable').'ID til overførsel fra idekatalog';
      let tempid := (select tennis where number(Id) = NRid);
      let RT1 := tempid.'Træningens indhold';
      let RT2 := 'Verbal beskrivelse';
      let Xindhold := html(raw(RT1) + raw(RT2));
      tempid.('Videolink til trænerguiden' := Xurl);
      tempid.('Træningens indhold' := Xindhold);
      closeRecord()

       

      Can I in this connection ask you if there is a smarter way to use a number as id in the workaround I do in line 2 and 3 ? The case is that in the button where I go to the table idekatalog I set a global variable which is the id of the record I am leaving and returning to, which end in the Global variables as a number.?

       

      rgds

      Leo

    • Fred
    • 4 days ago
    • Reported - view
     said:
    if there is a smarter way to use a number as id in the workaround I do in line 2 and 3 ?

     I'm not sure what you are asking? Scripts in buttons never "leave" the table they are in.

    One thing you may want to consider is using the record() command when calling your Globale Variable table. If you only have 1 record in the table, then you know the recID so just call it directly with the record() command. If the recID is 1 then it would look something like:

    record('Globale Variable',1).'ID til overførsel fra idekatalog';
    • Leo_Woer
    • 4 days ago
    • Reported - view

    This is in fact what I am looking for Thank You Fred

    thds

    Leo

      • Fred
      • 3 days ago
      • Reported - view

       When you get a chance please mark the post “answered”. 

Content aside

  • Status Answered
  • 3 days agoLast active
  • 5Replies
  • 31Views
  • 2 Following