Creating target field based on input node

Hi all,
  I'm facing a problem in creating the target node based on input node. See if the input node value is repeated I don't want to create the target field for the second occurrence.
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_temp xmlns:ns0="urn:test">
   <row>
      <temp_id>1002</temp_id>
   </row>
   <row>
      <temp_id>1002</temp_id>
   </row>
</ns0:MT_ItemEvent>
In the above structure you can see the temp_id is repeated , I want to create only one target node. Plz help me to solve this.

HI,
Use the UDF and in that use Vector to create the result list with the values.
use temp_id as imput and before that remove context
after the UDF use the Splitbyvalue
See the below code
String () a;
Vector prod = new Vector();
for (i=0;i<a.length;i++){
if(!prod.contains(a(i))) prod.add(a(i));
Collections.sort(prod);
for(i=0;i<prod.size();i++){
result.addValue((String) prod.get(i));
Regards
Chilla

Similar Messages

  • Mapping Issue. Parsing problem to target Fields based on condition.

    Hi All,
    File to Idoc scenario.
    My file looks like below.
    HD 89650 28/01/11 "Presciber tan"
    AF "disc-rsn"
    RK "007287001" A
    KE disc-code "007287"
    KE addr-num "001"
    DF fax-num ""
    DF in-out "I"
    DF phone-2 "23221"
    AF "drs"
    RK "007287" A
    KE dr-num "00221"
    KE addr-num "001"
    DF affil "OPSM"
    DF rec-stat "A"
    DF phone-2 "12444"
    AF "disc-rsn"
    RK "dr-addraddress-1 17287|1EN" A
    KE disc-code "008287"
    KE field-name "address-1"
    KE element " 1"
    DF in-out "I"
    DF phone-2 "1232"
    DF post-code "3109"
    DF provider-num "5349201J"
    DF rec-stat "A"
    T         24
    I need to capture and create target segments only for the values "AF "disc-rsn"".And pass all the relavant rows (RK,KE,DF...) which are under "AF "disc-rsn"" to the target fields.
    I'm struggling to parse the value to the output structure as RK,KE,DF will be present under anywhere like "AF drs", "AF disc-rsn" etc.
    I'm able to create the target segments (2 Zdisc segments as 2 "AF disc-rsn" present in the file), but unable to parse the field values to the target fields.
    Ex: DF phone-2 is present in 8th, 15th,22nd row. I need to pass only 8th and 22nd rows to the target fields.
    After content conversion, My Source XML looks like below.
    <?xml version="1.0" encoding="utf-8" ?>
    - <MT_DiscountDetails>
    - <HD>
      <KeyField>HD</KeyField>
      <HDRow>89650 28/01/11 "Presciber tan"</HDRow>
      </HD>
    - <AF>
      <KeyField>AF</KeyField>
      <AFRow>"disc-rsn"</AFRow>
      </AF>
    - <RK>
      <KeyField>RK</KeyField>
      <RKRow>"007287001" A</RKRow>
      </RK>
    - <KE>
      <KeyField>KE</KeyField>
      <KERow>disc-code "007287"</KERow>
      </KE>
    - <KE>
      <KeyField>KE</KeyField>
      <KERow>addr-num "001"</KERow>
      </KE>
    - <DF>
      <KeyField>DF</KeyField>
      <DFRow>fax-num ""</DFRow>
      </DF>
    - <DF>
      <KeyField>DF</KeyField>
      <DFRow>in-out "I"</DFRow>
      </DF>
    - <DF>
    Is there any way I can acheive my  mapping based on the above condition?? Kindly suggest me.
    Thank you for your time.
    Regards
    Deepthi

    Not required. Using Java function. Solved the issue.

  • Need to create Target substructure if invoice number node has a value.

    I only want to create Target substructure if Source node <Invoice Number> has a value and is not blank. Can not use Exists function because <Invoice Number> node is 1..1 so it will always be there but it may be empty. Thank you.

    Hi Glenn,
    If you are getting the source from idoc and if you dont have invoice number from idoc then you will not at all have the field. So it will not be empty until unless somebody manually sends from we19. So you should not run into those kind of issues.
    Anyways you can check both blank and length. So check lenght greater than zero and equal to blank which is a space. It should work.
    Regards,
    ---Satish

  • End Routine - populating Target Field based on Master Data

    Hi,
    I have an issue with my End Routine in BI 7.0. The scenario is as follows....
    The Target-Fields ZSALES_OFFICE , 0SALES_CHANNEL etc. are being mapped 1:1 from their respective source fields. In addition to these target fields I have a target field 0SALESORG which I need to populate based on the values from 0COMP_CODE which is an attribute of ZSALES_OFFICE. The values of 0COMP_CODE are 9000, 9001, 9002 and 9003 respectively. The end routine condition needs to be implemented as follows...
    For every 0COMP_CODE which has value 9000, 0SALESORG should be populated with the value "EAST". Similarly for every 0COMP_CODE which has value 9001, 0SALESORG should be populated with the value "WEST",  for every 0COMP_CODE which has value 9002, 0SALESORG should be populated with the value "NORTH" and  for every 0COMP_CODE which has value 9003, 0SALESORG should be populated with the value "SOUTH". I tried the following code but it doesnt seem to work. Could you pls help!!
    Thanks,
    SD
    DATA: it_tab4 TYPE TABLE OF /BIC/PZF31SALOFF,
              wa_tab4 TYPE /BIC/PZF31SALOFF.
        SELECT *
          FROM /BIC/PZF31SALOFF
        INTO CORRESPONDING FIELDS OF TABLE it_tab4.
        sort it_tab4 by /BIC/ZF31SALOFF.
        LOOP AT RESULT_PACKAGE
          INTO <result_fields>.
          read table it_tab4
          with key /BIC/ZF31SALOFF = <result_fields>-/BIC/ZF31SALOFF
          into wa_tab4
          binary search.
          if sy-subrc eq 0.
            CASE wa_tab4-comp_code.
              WHEN '9000'.
                <result_fields>-salesorg = 'EAST'.
              WHEN '9100'.
                <result_fields>-salesorg = 'WEST'.
              WHEN '9200'.
                <result_fields>-salesorg = 'NORTH'.
              WHEN '9300'.
                <result_fields>-salesorg = 'SOUTH'.
              MODIFY it_tab4 FROM wa_tab4.
            ENDCASE.
          endif.
        ENDLOOP.

    Replace your select statement ,
    SELECT *
    FROM /BIC/PZF31SALOFF
    INTO CORRESPONDING FIELDS OF TABLE it_tab4.
    instead of selecting all the fields , pick only the fields which are required.(one good performance improvement)
    SELECT    /BIC/PZF31SALOFF  comp_code
    FROM /BIC/PZF31SALOFF
    INTO CORRESPONDING FIELDS OF TABLE it_tab4.
    Remove the line below , this is not required
    MODIFY it_tab4 FROM wa_tab4.

  • How to create a field based on DFF on a Page

    Guys,
    I do have a page where I do have three user enterable columnn. I want to add one more column on the page that should be based on DFF using personalization. I do not want to click this column and then let it direct to some other region or page. I need to enter the value directly as I am entering rest of other three columns. I hope I make you understand my requirement.
    Thanks
    Sunil

    Hey Anand,
    I have followed everything that is mentioned in the link. But I am not able to view it as a field on my page.Can you please guide me if I have forgot to follow something
    App Shot Name -> WIP
    Display Context Field -> True
    Name -> WIP_TRANSACTION (registered Flex Field name)
    Prompt -> PO Number
    Read Only - False
    Rendered -> true
    Segment List -> Attribute1
    Type -> Descriptive
    View Instance -> ChargeDetailsVO
    Waiting for your reply.
    Thanks
    Sunil

  • Using Javascript to show/unshow a field based on input in another field

    I want to display/not display a field in a JSP depending on what is selected in another field.
    I am using <div></div> element currently which is displayed/not displayed using a Javascript invoked by the first field.
    the problem with div is that I have to put it inside a <tr><td> otherwise it doesn't work. This makes the field look aloof from the rest of the page, and is also not aligned with the other fields.
    Is there anything other than <div> that can be used? or is there a way to correct the look of the field inside a div?
    Thanks

    You shouldn't have to put it inside a <tr><td> to get it to work. I've done what you are trying to do with <span></span> and it worked fine. I haven't tried it with a <div> but I can't image why that wouldn't work. Maybe you could post your code.

  • Need to hide the field based on input to other field on screen

    Hi All,
    I enhanced the std. infotype 1029.Now I need to display one custom field only if another custom field (check box) is enabled, otherwise no.
    I tried writtinf code in PBO of ZP102900 in subscreen 0200.
      loop at screen.
      if screen-name = 'fld1'.
        if 'fld1' = 'X'.                      -
    >if chk box is selected then it shud display the fld2 on the screen along with fld1
          screen-name = 'fld2'.
        endif.
      endif.
      endloop.
    But no results:-(
    Can you please help me out in this ASAP.
    Thanks in advance.
    Regards,
    Ashwini

    Hi All,
    Finally I got the results:-)
    Solution:
    in PBO module:
      LOOP AT SCREEN.
        if SCREEN-NAME = 'P1029-<FLD2>'.
          IF P1029-FLD1 = 'X'.
            SCREEN-ACTIVE = 1.
            MODIFY SCREEN.
          ELSE.
            SCREEN-ACTIVE = 0.
            MODIFY SCREEN.
          ENDIF.
        endif.
      ENDLOOP.
    in PAI module:
    LOOP AT SCREEN.
      if SCREEN-NAME = 'P1029-<FLD2>'.
          IF P1029-<FLD1> = 'X'.
            SCREEN-ACTIVE = 1.
             MODIFY SCREEN.
          ELSE.
            SCREEN-ACTIVE = 0.
          ENDIF.
      endif.
    ENDLOOP.
    Thanks for your valuable time.
    Regards,
    Ashwini

  • XSLT for dynamic target field names

    Hello,
    I got a requiremt where I need to create target field names from input values.
    Input XML -
    <?xml version="1.0" encoding="UTF-8"?>
    <Createelement_MT>
    <Field Name="A">
    <Value>1</Value>
    </Field>
    <Field Name="B">
    <Value>1</Value>
    </Field>
    </Createelement_MT>
    Expected OutPut XML -
    <?xml version="1.0" encoding="UTF-8"?>
    <Createelement_MT>
    <Statement><TableName><table>XYZ</table>
    <access>
    <A> 1 </A>
    <B> 2 </B>
    </access>
    </Statement></TableName>
    </Createelement_MT>
    The value of the attribute 'Name' of field 'Field' should be the name of target field.
    XSLT:
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml"/>
    <xsl:template match="@*|node()">
    <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
    </xsl:template>
    <xsl:template match="Createelement_MT">
    <xsl:element name="statement">
    <xsl:element name="TableName">
    <xsl:element name="table">ABC</xsl:element>
    <xsl:element name="access">
    <xsl:for-each select="Field">
    <xsl:element name="{@Name}">
    <xsl:value-of select="Value"></xsl:value-of></xsl:element></xsl:for-each>
    </xsl:element>
    </xsl:element>
    </xsl:element>
    </xsl:template>
    </xsl:stylesheet>
    Error:
    Error: at xsl:element on line 15 of file:///......: XTDE0820: Invalid element name. Invalid QName {}
    Please help me with the xslt code for this requirement.
    Thanks!

    Hi,
                Please try this code
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:output method="xml"/>
         <xsl:template match="/">
              <Createelement_MT>
                   <Statement>
                        <TableName>
                             <table>XYZ</table>
                        <access>
                             <xsl:for-each select="Createelement_MT/Field">
                                  <xsl:variable name="field" select="@Name"></xsl:variable>
                                  <xsl:element name="{$field}">
                                  <xsl:value-of select="Value"></xsl:value-of>
                                  </xsl:element>
                             </xsl:for-each>
                        </access>
                        </TableName>
                   </Statement>
              </Createelement_MT>
         </xsl:template>
    </xsl:stylesheet>
    input xml
    <?xml version="1.0" encoding="UTF-8" ?>
    - <Createelement_MT>
    - <Field Name="A">
      <Value>1</Value>
      </Field>
    - <Field Name="B">
      <Value>1</Value>
      </Field>
      </Createelement_MT>
    output xml
    <?xml version="1.0" encoding="UTF-8" ?>
    - <Createelement_MT>
    - <Statement>
    - <TableName>
      <table>XYZ</table>
    - <access>
      <A>1</A>
      <B>1</B>
      </access>
      </TableName>
      </Statement>
      </Createelement_MT>
    One small request, if you think your question has been answered,could you please kindly, if possible, close this thread.
    regards
    Anupam

  • Create target group for contacts does not work

    Hi Experts,
    I am working on a Markting solution for a University with CRM 5.0.
    We need to contact certain Teachers in Schools (they have an orientation function for pupils that might study in the University in the future).
    I can segment for schools in Segmentbuilder. Now, I need to generate "new target group from contact". In my case the contact person of the school is the Teacher (function type is contact person). This does not work.
    Am I missing some parametrization, or is there a relation to sales area (wich we do not have).
    Hoping for your help. I will regard points generously.
    cristina

    Hi Cristina,
    I understand Schools are crated as Org and Teacher as Persons. There exist a Relationship between these similar to Contact Person (BUR001).
    Now, Follow the process
    1) Create a Data Source in CRMD_MKTDS.
    2) Assign an Infoset Query, as per your scenario.
    3) Assign Function Module "CRM_MKTTG_PF_BP_TAB_TO_CP" to data source
    4) Save, and then create an Attribute List.
    Go to Segment Builder and create target group based on above Attribute List.
    You'll get a list of all the contact persons. For your case, Teachers.
    Hope this helps......
    Regards,
    Vikas
    PS: This will only work if Schools - Org, Teacher = Person and Relationship = BUR001. If you have other criterias please copy Function Module "CRM_MKTTG_PF_BP_TAB_TO_CP" and edit it as per your business case. Then assign this FM in Data Source.

  • Creating a target group based on the BP email address only in CRM

    Hi there,
    I am currently trying to create a target group based on the business partner email address only.
    I have a list of over 1000 email addresses - these email addresses equate to a BP in our CRM system, however I do not have a list of the equivalent business partner numbers, all I have to work on are the email addresses.  With these 1000 BP email addresses I need to update the marketing attributes of each of these 1000 BP records in CRM.
    What I need is a method to find the 1000 BP numbers based on the email addresses and then use the marketing expert tool (tx. CRMD_MKT_TOOLS) to change the marketing attributes on all of the 1000 BPs.
    The issue I am having is how can I find the list of BP numbers just based on the BP email address, I tried creating an infoset based on table BUT000, BUT020 and ADR6 but I after creating attribute list & data source for this I am stuck on what to do next. In the attribute list the selection criteria does not allow me to import a file for the selection range.  I can only enter a value but I have 1000 email addresses and cannot possibly email them manually in the filter for the attribute list.   I also looked at imported a file into the target group but I do not have any BP numbers so this will not work.
    Does anyone know a method where I can create a target group based on the email addresses only without having to do any code?
    Any help would be most appreciated.
    Kind regard
    JoJo

    Hi JoJo ,
    The below report will return you BP GUID from emails that is stored in a single column .xls file and assign the BP to a target group.
    REPORT  zexcel.
    * G L O B A L D A T A D E C L A R A T I O N
    TYPE-POOLS : ole2.
    TYPES : BEGIN OF typ_xl_line,
    email TYPE ad_smtpadr,
    END OF typ_xl_line.
    TYPES : typ_xl_tab TYPE TABLE OF typ_xl_line.
    DATA : t_data TYPE typ_xl_tab,
           lt_bu_guid TYPE TABLE OF bu_partner_guid,
           ls_bu_guid TYPE  bu_partner_guid,
           lt_guids TYPE TABLE OF bapi1185_bp,
           ls_guids TYPE  bapi1185_bp,
           lt_return TYPE bapiret2_t.
    * S E L E C T I O N S C R E E N L A Y O U T
    PARAMETERS : p_xfile TYPE localfile,
                  p_tgguid TYPE bapi1185_key .
    * E V E N T - A T S E L E C T I O N S C R E E N
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_xfile.
       CALL FUNCTION 'WS_FILENAME_GET'
         IMPORTING
           filename         = p_xfile
         EXCEPTIONS
           inv_winsys       = 1
           no_batch         = 2
           selection_cancel = 3
           selection_error  = 4
           OTHERS           = 5.
       IF sy-subrc <> 0.
         CLEAR p_xfile.
       ENDIF.
    * E V E N T - S T A R T O F S E L E C T I O N
    START-OF-SELECTION.
    * Get data from Excel File
       PERFORM sub_import_from_excel USING p_xfile
       CHANGING t_data.
       SELECT but000~partner_guid FROM but000 INNER JOIN but020 ON
    but000~partner =
       but020~partner
         INNER JOIN adr6 ON but020~addrnumber = adr6~addrnumber INTO TABLE
    lt_bu_guid FOR ALL ENTRIES IN t_data WHERE adr6~smtp_addr =
    t_data-email.
       CLEAR: lt_guids,ls_guids.
       LOOP AT lt_bu_guid INTO ls_bu_guid.
         ls_guids-bupartnerguid = ls_bu_guid.
         APPEND ls_guids TO lt_guids.
       ENDLOOP.
       CALL FUNCTION 'BAPI_TARGETGROUP_ADD_BP'
         EXPORTING
           targetgroupguid = p_tgguid
         TABLES
           return          = lt_return
           businesspartner = lt_guids.
    *&      Form  SUB_IMPORT_FROM_EXCEL
    *       text
    *      -->U_FILE     text
    *      -->C_DATA     text
    FORM sub_import_from_excel USING u_file TYPE localfile
    CHANGING c_data TYPE typ_xl_tab.
       CONSTANTS : const_max_row TYPE sy-index VALUE '65536'.
       DATA : l_dummy TYPE typ_xl_line,
              cnt_cols TYPE i.
       DATA : h_excel TYPE ole2_object,
              h_wrkbk TYPE ole2_object,
              h_cell TYPE ole2_object.
       DATA : l_row TYPE sy-index,
              l_col TYPE sy-index,
              l_value TYPE string.
       FIELD-SYMBOLS : <fs_dummy> TYPE ANY.
    * Count the number of columns in the internal table.
       DO.
         ASSIGN COMPONENT sy-index OF STRUCTURE l_dummy TO <fs_dummy>.
         IF sy-subrc EQ 0.
           cnt_cols = sy-index.
         ELSE.
           EXIT.
         ENDIF.
       ENDDO.
    * Create Excel Application.
       CREATE OBJECT h_excel 'Excel.Application'.
       CHECK sy-subrc EQ 0.
    * Get the Workbook object.
       CALL METHOD OF h_excel 'Workbooks' = h_wrkbk.
       CHECK sy-subrc EQ 0.
    * Open the Workbook specified in the filepath.
       CALL METHOD OF h_wrkbk 'Open' EXPORTING #1 = u_file.
       CHECK sy-subrc EQ 0.
    * For all the rows - Max upto 65536.
       DO const_max_row TIMES.
         CLEAR l_dummy.
         l_row = l_row + 1.
    * For all columns in the Internal table.
         CLEAR l_col.
         DO cnt_cols TIMES.
           l_col = l_col + 1.
    * Get the corresponding Cell Object.
           CALL METHOD OF h_excel 'Cells' = h_cell
             EXPORTING #1 = l_row
             #2 = l_col.
           CHECK sy-subrc EQ 0.
    * Get the value of the Cell.
           CLEAR l_value.
           GET PROPERTY OF h_cell 'Value' = l_value.
           CHECK sy-subrc EQ 0.
    * Value Assigned ? pass to internal table.
           CHECK NOT l_value IS INITIAL.
           ASSIGN COMPONENT l_col OF STRUCTURE l_dummy TO <fs_dummy>.
           <fs_dummy> = l_value.
         ENDDO.
    * Check if we have the Work Area populated.
         IF NOT l_dummy IS INITIAL.
           APPEND l_dummy TO c_data.
         ELSE.
           EXIT.
         ENDIF.
       ENDDO.
    * Now Free all handles.
       FREE OBJECT h_cell.
       FREE OBJECT h_wrkbk.
       FREE OBJECT h_excel.
    ENDFORM. " SUB_IMPORT_FROM_EXCEL
    Just copy paste the code and run the report select any local xls file with emails and pass the target group guid.
    snap shot of excel file:
    Let me know if it was useful.

  • How to enable/disable the input fields based on the data entered/user action in the web dynpro abap?

    How to enable/disable the input fields based on the data entered in the web dynpro application abap?  If the user enters data in one input field then only the next input field should be enabled else it should be in disabled state. Please guide.

    Hi,
    Try this code.
    First create a attribute with the name readonly of type wdy_boolean and bind it read_only property of input field of which is you want to enable or disable.
    Next go to Init method.
    Set the readonly value as 'X'.
    DATA lo_el_context TYPE REF TO if_wd_context_element.
         DATA ls_context TYPE wd_this->element_context.
         DATA lv_visible TYPE wd_this->element_context-visible.
    *   get element via lead selection
         lo_el_context = wd_context->get_element( ).
    *   @TODO handle not set lead selection
         IF lo_el_context IS INITIAL.
         ENDIF.
    *   @TODO fill attribute
    *   lv_visible = 1.
    *   set single attribute
         lo_el_context->set_attribute(
           name =  `READONLY`
           value = 'X').
    After that Go to the Action  ENTER.
    First read the input field ( first input field, which is value entered field) , next give a condition
    if input value is not initial  then set the readonly value is '  '.
    DATA lo_nd_input TYPE REF TO if_wd_context_node.
         DATA lo_el_input TYPE REF TO if_wd_context_element.
         DATA ls_input TYPE wd_this->element_input.
         DATA lv_vbeln TYPE wd_this->element_input-vbeln.
    *   navigate from <CONTEXT> to <INPUT> via lead selection
         lo_nd_input = wd_context->get_child_node( name = wd_this->wdctx_input ).
    *   @TODO handle non existant child
    *   IF lo_nd_input IS INITIAL.
    *   ENDIF.
    *   get element via lead selection
         lo_el_input = lo_nd_input->get_element( ).
    *   @TODO handle not set lead selection
         IF lo_el_input IS INITIAL.
         ENDIF.
    *   get single attribute
         lo_el_input->get_attribute(
           EXPORTING
             name =  `VBELN`
           IMPORTING
             value = lv_vbeln ).
    if lv_vbeln IS not INITIAL.
        DATA lo_el_context TYPE REF TO if_wd_context_element.
        DATA ls_context TYPE wd_this->element_context.
        DATA lv_visible TYPE wd_this->element_context-visible.
    *  get element via lead selection
        lo_el_context = wd_context->get_element( ).
    *  @TODO handle not set lead selection
        IF lo_el_context IS INITIAL.
        ENDIF.
    *  @TODO fill attribute
    *  lv_visible = 1.
    *  set single attribute
        lo_el_context->set_attribute(
          name =  `READONLY`
          value = ' ' ).

  • COPA Derivation based with target field as non-copa field

    Hello experts,
    There is a requirement to derive the Characteristic maintained in Classification view(AUSP table) in Material master based on material number.The target field into which the characteristic value needs to be populated is not in COPA(it is a non-copa field).
    I tried to use table look up with AUSP table, but it is asking for values of certain key fields like
    ATZHL(Characteristic value counter)  MAFID(Indicator: Object/Class) and
    KLART(Class Type), which are not there in COPA.
    With the Enhancement in KEDR transaction, EXIT_SAPlKEDRCOPA_001 and Include ZXKKEU11, I  created an enhancement step by giving  the material as the key in the source fields.With that material number I can do a select on the AUSP table inside the include ZXKKEU11 and get the characteristic value. The problem i am facing is that the target field which stores the internal characteristic value is not there in COPA?And while creating a derivation rule, I can only select the COPA fields as target fields.
    It's urgent....any suggestions  please? Points will be rewarded for any useful answer.
    Thanks,
    Anky

    Hi,
    As far as I know the derivation functionality in COPA is meant for derivation of characteristic values to store them in a characteristic field.
    If you splitt up the derivation in two steps it might be possible to use the USERTEMP fields, to store the information needed and to pass it on to an other lookup step as a key-reference.
    Regards,
    Roy

  • Changing field text color and fill based on input value.

    I am trying to create a field that can be red, yellow or green.  In the end, what I need is a box that can be made red, yellow or green by the form user.  My strategy is to use a validation script to change the field and text color based on the field input.  So if you type "red", the text and field turn red, essentially making a red box.  The field is named "GoalColor".
    Am I headed in the right direction to get make this dynamic colored box?
    This script works but you must type "red" into the field(including quotation marks).  Any ideas on why the word red alone isn't triggering it? 
    var vcolor = this.getField("GoalColor").value;
    if (vcolor == "red") {
        this.getField('GoalColor').fillColor = color.red;
    } else {
        this.getField('GoalColor').fillColor = color.white;
    I have also tried - works if you type 'red'
    var vcolor = this.getField("GoalColor").value;
    if (vcolor == 'red') {
        this.getField('GoalColor').fillColor = color.red;
    } else {
        this.getField('GoalColor').fillColor = color.white;
    and  - does not work
    var vcolor = this.getField("GoalColor").value;
    if ( vcolor == red ) {
        this.getField('GoalColor').fillColor = color.red;
    } else {
        this.getField('GoalColor').fillColor = color.white;
    Thanks!

    And you don't need to add the quotation marks in the text field. In fact, doing it will cause the script not to identify the word.

  • In BI how to filter the selection options based on inputs on top field

    Hi Friends,
    In BI, How to filter the selection options based on inputs on top field.
    The system should automatically filter the lower level drop downs based on the selection of a higher level.
    For e.g. :
    If a user selects a Country then the States drop down should only display the State's belongs to the Country. Similarly when a State is selected, the District drop down should display only those District's belongs to the State.
    Thanks in Advance.
    Regards
    Jayaram M

    Hi Anil,
    Thanks for reply but I couldn't use Compounding Characteristic here. Need some other solution.
    Regards
    Jayaram M

  • I created boolean references in my main vi block diagram and copied them to my sub vi front panel. when wire my reference in my main vi to one the input node of the sub vi the wire is broken. the error says its a class conflict why?

    i created boolean references in my main vi block diagram and copied them to my sub vi front panel. when wire my reference in my main vi to one the input node of the sub vi the wire is broken. the error says its a class conflict why?

    Expanding and clarifying what BJD said;
    After you create the temporary sub-VI that BJD mentioned, open its front panel and copy the reference control that LV created when it created the sub-VI.
    This reference control will be correct class etc that you need. Use the control to replace the original control that you were attempting to wire up.
    The technique of "create sub-VI...copy" always works for me.
    There is one more thing that you should watch out for.
    The mechanical action of the boolean can not be set for latch action when attempting to read the value using a value property node.
    Trying to help,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

Maybe you are looking for