Converting numbers to text in a trigger

I have created a custom form which inserts a record and sends an e-mail using the developer Toolbox "send e-mail to recipients from a records set ". Most of the form elements are drop-down boxes which return a numeric value. My problem is that when I come to sending the e-mail I want to send human readable information rather than just numeric values.
I think I need to create a trigger which will take the insert transactions fields and select equivalent values to my drop-down boxes. it will then update the transaction fields with the text versions of the database record. this should alow me to email a text version of the email.
Here is the trigger
function Trigger_Custom_translate_advert_for_email(&$tNG) {
$query = "SELECT *
FROM
tire_quality
WHERE
tire_quality.unique_id = 1";
// THE QUERY HAS BEEN REDUCED FOR SIMPLICITY
$select_result = $tNG->connection->execute($query);
//HOW DO I RETRIEVE THE THE DATA FROM THE QUERY
$tNG->addColumn("tire_quality_translated","STRING_TYPE","VALUE",$newValue);
//I AM CREATING A NEW TRANSACTION FIELD TO PLACE THE TRANSLATED VALUE INTO
if(!$select_result) {
$updateError = new tNG_error("Error setting the initial message ID",array(),array());
return $updateError;
} else {
return NULL;
Does my strategy seem correct to you?

Chris,
Your strategy seems fine. I don't think there is any reason to do a database query though? Unless I am missing something.
I think you can just do a custom trigger set to execute AFTER the Insert transaction, but before the Email trigger. Make sure the transaction order of execution is correct so that the values are changed in the Custom Trigger AFTER the Insert transaction, but before the Email trigger.
Something like this should work(lets say you use a numeric value for colors that you want to swap for the email):
function Trigger_Custom_Swap_Colors(&$tNG) {
// Get the submitted data from the form
$color = $tNG->getColumnValue("color");
// Conditional if statement to change number to color
if($color == 1) { $color = 'Red'; }
elseif($color == 2) { $color = 'Blue'; }
else { $color = 'undefined'; }
// Set the column value for the ADDT transaction variable
$tNG->setColumnValue("color", $color);
So in short, all you do is grab the data from the form using getColumnValue, change the data to what you want the email to show, and then use setColumnValue to change the ADDT column value. Then when you email is sent it should use the modified column values.
Hope this helps,
Shane

Similar Messages

  • [JS,CS3,CS4] Converting Paragraph numbering to text

    I'm trying to add line numbers by applying paragraph numbering to selected text (which I call "myText"), then converting numbers to text (then later I'll use GREP to remove the period and shift them to the right).
    I'm new to scripting, and wonder why the following doesn't work:
    myText.bulletsAndNumberingListType=1280601709;
    myText.convertBulletsAndNumberingToText();
    The first line seems to add the numbering as I'd like, but the second line just makes them disappear again!
    Thanks for any help you can give -- Jeremy

    I just had a similar problem.
    I have no idea whether my solution works in CS3.
    ( function() {
         var doc = app.activeDocument;
         // the image page item
         var r = doc.rectangles.item(0);
         // the destination textframe to hold the inline
         var tf = doc.textFrames.item(0);
         // it should already be tagged.
         // create a nested, blank tag
         var xe = tf.associatedXMLElement.xmlElements.add("bla");
         // copy the rect as inline
         xe.placeIntoInlineCopy(r,true);
    Dirk

  • Need help in converting numbers to Italian text

    Need help in converting numbers to text in Italian language. I want to knw is there any method other than SE63 to translate these text in one shot. I have tried with LSMW also (as the sheet is in XLS format ).Plz reply if anyone is aware of this ..

    hi,
    chk this code.
    CALL FUNCTION 'SPELL_AMOUNT'
    EXPORTING
    amount = amount
    currency = 'EUR'
    filler = ' '
    language = 'E'  => give the language as italian
    IMPORTING
    in_words = amountrs.
    rgds
    anver
    pls mark all hlpful answers

  • After saving a pdf as Excel workbook the numbers remain text and cannot be used in calculations. Is there a better way to convert into real digital numbers?

    After saving a pdf as Excel workbook the numbers remain text and cannot be used in calculations. Is there a better way to convert into real digital numbers?
    I have tried to convert the pdf to Word instead but same difficulty with numbers: look like numbers but not usable for calculations

    Excel has a 'text to numbers' function, I would use that.
    Convert text to numbers. Microsoft Excel.

  • Problem deleting cross-references: Deleted cross-references do not convert to correct text

    This helpful page states that, "When you delete a cross-reference, the source cross-reference is converted to text."
    I use InDesign to create user's manuals, which are full of cross-referenced page numbers.
    The cross-references are all internal to a single document, they do not link to other documents. Each cross-reference is linked to paragraph text and the cross-reference format is Page Number.
    I find that whenever I delete a cross-reference, the cross-reference does convert to text; however, the text—which in this case is a page number—is wrong.
    For example, this sentence is on page 16:
    "You can measure your heart rate using either the handgrip heart rate monitor or an optional chest heart rate monitor (see page 21 for information about the optional chest heart rate monitor.)"
    Screenshot:
    However, when I delete the cross reference, the sentence now reads:
    "You can measure your heart rate using either the handgrip heart rate monitor or an optional chest heart rate monitor (see page 16 for information about the optional chest heart rate monitor.)"
    Screenshot:
    Now, to my mind, the cross-reference should have converted to the text "21," since that is what the cross-reference said (and it is the correct page number for the optional heart rate monitor text that is being referred to).
    Instead, the cross-reference converted to the text "16," which is the number of the page that the sentence is actually on, but is most definitely not what the cross-reference said and is not the correct page number to boot.
    Do any of you know the reason this happens?
    Is there a way to make the text convert to the correct page number when the cross-reference is deleted?

    Update: The cross references work when I export the book as Print PDF. Sadly this solution does not work in my case, because all my interactive element are disabled when exporting as Print PDF.

  • UFL to convert numbers to Turkish words

    Happy New Years to everyone and all that stuff.
    I have had a look through a couple posts that refer to Turkish characters and a am hoping my idea of
    creating a UFL that converts a number (passed in as a string) and then outputs the Turkish words for
    the number, is possible or atleast on the right track.
    This is my Turkish.properties file
    0=su0131fu0131r
    1=bir
    2=iki
    3=üç
    To get Eclipse to accept these characters I tried setting the encoding to UTF-8 but eclipse said
    UTF-8 conflicts with the encoding defined in the content type (ISO-8859-1)
    Do you with to set it anyways?
    Which I did and it seemed to keep the correct format for all that characters
    I then created my UFL to just take a str_Key which is the number and the resBundleName (Turkish)
    and I output the correct string. Just for testing I only worked with single digit numbers.
    I then made my UFL avaliable to all my reports and created a test report.
    The only problem was when previewing the output, it was no longer the correct UTF-8 characters
    but the incorrect ISO-8859-1 characters ( I assume its this encoding as I tested what happens if
    I save my properties file in that encoding and they seem the same messed up characters)
    I have tried setting the "Text file encoding" for the report (right click - properties) but that makes
    no difference.
    So my question is:
    Is it possible to create a UFL that will convert a number to Turkish words?
    If so, where am I going wrong, is there another encoding setting I need to set?
    Will I have future problems when trying to export to PDF?
    Does anyone else have another idea on how best to convert numbers to Turkish words
    if using a UFL and resource bundle is not the best idea?
    Sorry thats 4 questions not 1 but hey, its my first post of the new year
    Thanks all.

    Thanks Ted,
    I did a simple test (which I really should have done before) where I placed Turkish characters in a report
    formula and it displayed the correct characters, so that confirms what you said in that its not the report
    error, but rather on the java side of things.
    I will try fiddle with things and work out how to get the Java side of things accepting the Turkish characters.
    I might come back here to ask a few questions if I get stuck, so will leave this open as it still deals with the topic.
    Thanks again
    Darren
    Right Ted, thanks for that advice, I have managed to get correct characaters using the \u0131 format
    for example
    0=\u0131
    1=\u00D0
    2=\u00D0\u0131
    Now the big question is where can i find a list of all the Unicode escapes (\u....) for Turkish equivilant?
    Even though this is a real pain, to convert from English to Turkish to Unicode, would have thought
    there would be an easier why, but this does do the job.
    So I will continue looking for a list of all Unicode numbers (any body know if there is a app out there
    that can do it all for  me??)
    Edited by: Darren Jackson on Jan 6, 2009 1:36 PM

  • How to convert numc to text

    Hi,
    Char lenght is 8 and numc length is 20.
    I am passing numc to char. Can you all please suggest me, how to write routine for converting numc to text?
    .Regards,
    Ram

    Define routine for that Infoobject in transformation and use move statement in the routine.
    MOVE SOURCE_FIELDS-NUMCFIELD TO RESULT.
    NOTE:  since NUMC field length is 20 and the target CHAR field length is 8, only the first 8 numbers would be moved to CHAR field.

  • How to replace numbers with text in tax return pdf using Adobe Acrobat X Pro

    How do I replace numbers with text in tax return pdf using Adobe Acrobat X Pro? The tax return was created using CCH software. Thanks for your review.

    Thanks Bill for your quick reply. CCH software is one of the major
    suppliers of tax return software. I found an internal source that helped me
    make the changes from numbers to text i.e. "$123,456" to "See Schedule O".
    I am not sure if I am working in form or final text. Thanks again! Kelly

  • Attachments converted to plain-text when using redirect rule

    When I redirect emails using a Mail rule, any attachments (as well as the entire message) are converted to plain text with extra control character, rendering the attachment unviewable. This does not happen when I manually redirect an email. Any help you can provide would be welcome.

    When I redirect emails using a Mail rule, any attachments (as well as the entire message) are converted to plain text with extra control character, rendering the attachment unviewable. This does not happen when I manually redirect an email. Any help you can provide would be welcome.

  • HT2523 one of my documents suddenly converted to plain text can't get it back. it had charts etc all over it. have been working on it for about 5 months lost a lot of work. Help. can i get it back?

    One of my documents on textedit suddenly converted to plain text and i can't get it back. Help. Spent over 5 months working on it. Had tables etc. Can i get it back?

    TextEdit/Preferences/New Document - Rich Text selected?
    Open & Save/When Opening a file - the 2 settings unchecked?

  • Can I convert Facebook time Text to Project Siena's Date value ?

    Can I convert Facebook time Text to Project Siena's Date value ?
    I want to show create_time on screen by my Localtime formatted text.
    Facebook time Text = 2014-07-14T11:22+0000
    I want to show = 2014/07/14 18:22
    My Time Zone is +09:00, Osaka/Japan.
    Currently I try it by Text/Replace/Replace/Replace/Left/DateValue/+ , etc.
    And I ask more simple way.
    Regards,
    Yoshihiro Kawabata

    Thank you Andy , and Robin, I can.
    Text(TimeValue(Substitute(ThisItem!created_time,"+0000",".000Z")),"yyyy/mm/dd hh:mm")
    At Facebook Albums's Gallary, I can convert from Facebook created_time to Localtime Text DateTime.
    and I hope more easy way like Excel Power Query's one.
    Regards,
    Yoshihiro Kawabata

  • Can I convert Twitter time Text to Project Siena's Date Value ?

    Can I convert Twitter time Text to Project Siena's Date Value ?
    I want to show localtime of Twitter created_at.
    Twitter time text = ThisItem!created_at , ex: Tue Jul 15 17:19:00 +0000 2014
    I want to show 2014/07/16 02:19 by Japan localtime.
    Regards,
    Yoshihiro Kawabata

    Siena uses JavaScript to parse date/times, via the TimeValue function. A good specification regarding what is acceptable can be found here:
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse
    The example above is truly bizarre: I thought I had seen it all. You will need to turn that form into one of those listed on the above site, using string functions to chop it up and reassemble it into a saner form.

  • PDF file shows different numbers of text blocks in CC 2014 and CS6

    Hi,
    I've inherited a file at work that displays different numbers of text blocks, depending on the version of Acrobat used to view the file. Here's the specific issue:
    As viewed in CC 2014:
    "Chapter 1 - Chapter One Title": Appears as two text blocks -- one for "Chapter 1 - " and one for "Chapter One Title"
    As viewed in CS 6:
    "Chapter 1 - Chapter One Title": Appears as a single text block -- "Chapter 1 - Chapter One Title"
    This occurs only with regard to single-digit chapter numbers that are whole numbers. So:
    Chapter 1, Chapter 5, and Chapter 7 entries appear as two blocks in CC 2014, one block in CS6.
    Chapter 2.0, Chapter 6.1, Chapter 10, entries appear in single blocks in both CC 2014 and CS6.
    The PDF file was created -- I believe -- through the save-to-PDF feature in Word 2010.
    Any idea what's happening here?
    Thanks.
    David

    The Cloud forum is not about using individual programs
    The Cloud forum is about the Cloud as a delivery & install process
    If you will start at the Forums Index https://forums.adobe.com/welcome
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll

  • Convert XML to text file and sending the same via Mail receiver adapter

    Dear All,
    I have a requirement like....
    I am getting a XML file as a result of mapping and it needs to be converted to a TEXT file and
    the converted file needs to be sent to a mail address in text format.
    Any body has idea how to achieve this?
    Thanks in advance for your help.
    Regards
    Hari

    >
    HP CReddy wrote:
    > Dear All,
    >
    > I have a requirement like....
    >
    > I am getting a XML file as a result of mapping and it needs to be converted to a TEXT file and
    > the converted file needs to be sent to a mail address in text format.
    >
    > Any body has idea how to achieve this?
    >
    > Thanks in advance for your help.
    >
    > Regards
    > Hari
    use the StructXML2Plain or XML2Plain from the standard MessageTransformBean
    Add the module to you Mail adapter before the mail adapters standard module itself
    Ref: http://help.sap.com/saphelp_nw04/helpdata/en/24/4cad3baabd4737bab64d0201bc0c6c/content.htm

  • How do I see the numbers I texted on my verizon?

    I have a prepaid iPhone plan. Im the only number on the account, and the acct owner. I need to see the numbers I texted/ texted me at certain times and when I go to usage the number fields are left blank? Thank you so much for your time and God bless:)

        xoangelheartxo,
    Keeping a tab on numbers you've contacted or numbers that have contacted you is often times very useful. So, we want to make that happen. At your convenience, I'd recommend contacting our prepaid department directly at 888-294-6804. While prepaid won't be able to verbally provide you with your request due to privacy policy, prepaid can definitely come up with a course of action to suit your needs.
    Evan_VZW
    Please follow us on twitter @VZWSupport

Maybe you are looking for

  • I have a new appreciation

    I have a new appreciation for those that actually create Linux distributions.  I am so used to using already created distributions that have every thing set up just so.  I wanted to try out different desktops since arch linux makes this so easy.  I t

  • Pls Hlp with error message code - epub3 upload

    Hi, i only have one error message from my epub upload to ibooks, can anyone tell me exactly how i would rectify this in the manifest (the exact line of code i need to enter?) Thanks! 1 package(s) were not uploaded because they had problems: /Users/se

  • Is there a way to automatically jump to a certain frame in a stacked sequence?

    I am working with stacked sequence structures.  I would like to have a condition in some of the frames, such that if the condition is false, the sequence proceeds normally, and if the condition is true, the sequence jumps to a certain frame.  Is this

  • Webutil_file_transfer.db_to_client  does not work

    I am using the following piece of code to display and read images stored in a database IF webutil_file_transfer.db_to_client (lv_file_name, 'TPPP_IMAGES', 'IMAGE_FILE','TPPPI_ID = '||:b_tdpi.tdpi_id) THEN -- Open using extension reporting.preview_out

  • How to allow user to see salary button in assignment Window

    Dear, We wanted to dis-appear Salary button in assignment window; therefore we used task flow to visible or un-visible salary button and working fine but by clicking salary button showing error "Function not available for this responsibility. Change