Using variable/s in SOM expression... how?

Hello all,
Sometimes its the simplest things that are the most confusing (for me anyway). For example:
I have a static table in a form in which the cells in one column each contain a checkbox.
The reference for each checkbox would be:
Table1.Row1.ckbox[0]
Table2.Row2.ckbox[0]
Table3.Row3.ckbox[0]
and so on.
I have a button elsewhere on the form, which when clicked would set each of the checkboxes in the table to "1" or checked, and would uncheck them all when clicked again.So I'm thinking a simple for loop would do the trick.
var i
for i = 1 upto 12 do
     Table1.Row[i].ckbox = 1
endfor
               ---OR---
for (var row = 1; row < 13; row++)
    form1.main.front.Table1.Row" + row + ".CheckBox = 1;
Neither works.
Is it the syntax, or something else entirely? Any pointers to examples of how and when to use variables in SOM references would be extremely appreciated.
Thanks
Harry Ohm.

Hi Harry,
You need to resolve the node in Javascript, so the following should work:
for (var i=1; i< 13; i++)
    xfa.resolveNode("form1.main.front.Table1.Row" + i + ".ckbox).rawValue = 1;
The way you have stated the name of the checkbox "Table1.Row1.ckbox[0]", indicates that there may be more than one ckbox in each row. If that is the case then you may need to replace .ckbox in the script with .ckbox[0].
Hope that helps,
Niall
Assure Dynamics

Similar Messages

  • How to use Variable in interface for Mapping in ODI 11g

    Hi,
    I want to use Variable 'Year' in interface mapping. how i can do that? I define a variable YEAR1 = '2001' and in interface i put #YEAR1 but it didn't work for me. is there any other way?
    Example.
    I m using 'Year' column in mapping and it is having different 3 constant values so i was think to define 3 variable Year1= '2001' & Year2= '2005' & Year3= '2010'.
    In interface i just want to put variable name insted giving fix value.
    regards
    Sher

    Thank u
    I m trying with all the options & when i create Variable i and set Default value to ''2001'
    '#YEAR'
    #YEAR
    '#PROJECT_NAME.YEAR'
    #PROJECT_NAM.YEAR
    #PROJECT_NAME.'YEAR'
    and setting to Stagging Area
    But still it is not working out.
    I m suing ODI11.1.1.3
    is it any issue?

  • How best to use TWO Time Capsules, Airport Express and Apple TV?

    Hello
    I have the following Apple equipment and am wondering how best to plug it all together. At the moment I am not using some items at all because I do not know how to best use!
    1. MacBook Pro (2012 model) 'Mac1'
    2. MacBook Pro (2009 model) 'Mac2'
    3. MacBook Air (2011 model) 'Mac3'
    4. Time Capsule 1TB (model A1355)  'TC1'
    5. (another!) Time Capsule 1TB (model A1355)  'TC2'
    6. Airport Express (2008 model)
    7. Apple TV (2013 model)
    8. LaCie 1TB USB Hard Drive
    9. Apple iPhone
    10. Sonos system
    CURRENTLY
    TC1 is plugged into the Virgin Media modem to provide a WiFi network called 'Amer's Apple Network' around the house. The Virgin Media wifi has been switched off to reduce interference.
    TC2 is not being used. The Airport Express is plugged in upstairs (or sometimes near garden) to extend the 'Amer's Apple Network' and this seems to work fine.
    Apple TV is plugged into main TV and is plugged into 'Amer's Apple Network' directly using Ethernet to TC1 but often runs slowly and does not work if Mac1 is not awake (or iTunes is not running on Mac1).
    LaCie is plugged directly into TC1 and currently has a old copy of my iTunes library stored on it which my Sonos system access. However, there seems to be a problem in that iTunes randomly uses that LaCie library and/or local Mac library. Often we get a pop up message on Mac1 saying "Library cannot be found" and we have to manually navigate to the LaCie drive (via the TC1 folder) to open iTunes. Also connecting iPhone to Mac1 seems to work very slowly as it appears to be trying to back up to LaCie drive.
    QUESTION
    What would be the best, most efficient way of using all (or if some is redundant equipement then which), to set up the following:
    1. A shared home network which enables all three computers (and any future Macs and/or iPads etc) to access one master shared iTunes library, which is the one that is updated with any new music, films etc added via any of those machines
    2. A shared home network that enables a shared files folder but also allows each user to keep their own personal hard drive (eg locally on whichever machine they are using).
    3. A fast (as possible) iTunes back up process when connecting iPhone to computer
    4. Usage of both TC1 and TC2 (and Airport Express) to extend network around the house (several weak spots exist) and also to maximise storage using the 1TB of each TC1 and TC2.
    5. Would it then also be possible to attach the LaCie USB drive for an additional 1TB storage? If so how and would it be very slow? From existing usage it appears to be very slow when used as a regular access drive, so perhaps better as a 'slow' drive that is just occassionaly used for back up and nothing else
    Main question is (to the networking experts!), how would you personally set up all above to give best wifi coverage, fastest back ups, access to Sonos for iTune library, access to Apple TV, and shared folders etc etc. I basically seem to have lots of kit (albeit some quite old) and nothing seems to be working together particularly well.
    Happy also to ditch any bottlenecks in the above equipment list (eg LaCie USB drive?) and add something which would better bring together the other components?
    Any thoughts much appreciated!
    Best
    Amer

    So ... FINALLY ... I found some time to implement this!
    Steps taken and results:
    1. Moved my entire music library to Mac1. Used the opportunity to also share my other Mac2 onto HomeShare and copy across any music files from Mac2 onto Mac1 that were not already there.
    Result:  Mac1 now holds my whole music library locally. Works incredibly fast whenever playing a track, adding a new track or updating info on existing track. Good!
    2. LaPastenague's instructions for bridging TC1 with TC2 worked a dream. Only thing is they are basically next to each other as I don't have the energy (or cabling expertise) to install (cleanly) long runs of ethernet cable.
    Result: Got a clear Wifi signal, not sure if any faster than before but I assume two TCs next to each other both sending out the same network signal can't be any worse than one. Main thing is that I have an extra 1Tb network drive (i.e. TC2) connected to TC1 which I can access from all my Macs now.
    3. Copied the entire Mac1 Music library over to TC2 drive into the Data folder. This happened relatively quickly (I think!) ... but would welcome any comments on whether slower than expected, to highlight if I might be able to improve the connection. 12,000 songs in 2 hours, with Mac1 sending the files to TC2 wirelessly. I know I could probably have connected Mac1 to TC2 by ethernet cable to speed up, but I had run out of Ethernet cables by now!
    Result: All my music (as of today anyway) now on Mac1 AND on TC2 in normal readable format (i.e. by Sonos and as a simple back-up that can just be carried around and copied anywhere in the event of loss of Mac1 drive
    4. Set up TC2 Music Library in Data folder to be the networked music folder for Sonos using "\\TC2\Data" (ps. why doesn't Sonos allow a simple click and select option for choosing drive and instead force us to go back to the 80s and type in drive path which isn't always clear, especially on a Mac!)
    Result: Sonos can access all my music (as of today anyway) on TC2 and no need for Mac1 or any other Mac to be open.
    BUT: As you may have guessed, the issue with the above set up is that as soon as I buy a new song, it will get added to my Mac1 quickly and smoothly ... but the area where I really use my music (i.e. Sonos via TC2) will have the older music library.
    QUESTION: Is there any way in which I can adjust the above set up, so that whenever I add new music to my Mac1 it also copies across to TC2? Don't mind if this is done slowly and later (eg in middle of night) but of course don't want to have to copy across manually each time. Would prefer it to just update newly added tracks regularly.

  • How to dynamically get the SOM expression of a field?

    As a follow up to the note below, I would really appreciate any help as of how to get the SOM expression of a field dynamically, by this, I mean how to get the SOM expression of a field at running time using JavaScript.
    Thanks,
    Isis
    That does make things clearer.  You will have to save the change  information in the XML.  I realize that you don't want to save an xml  node for every field, but there is a better way.  You can use scripting  to add data nodes to the XML data in the form.  I'm thinking of the  following:
    Include an empty container node in your XML schema: <HighlightedFields></HighlightedFields>
    When  a field is changed, in the field's change event call a common script:  HighlightChangedField, passing in the object.  The script will highlight  the field (set the border a certain color or whatever).  It will also  add node underneath the HighlightedFields data node with the SOM  expression of the field.  The SOM expression is the "path" of the object  in the form heirarchy, sort of like an xpath.  So if you have a subform  named Subform1 and you change the Name and Address textfields, you  might end up with something like:
    <HighlightedFields>
        <HighlightedField>
            <SOMExpression>xfa[0].form[0].myform[0].Subform1[0].Name[0]</SOMExpre ssion>
         </HighlightedField>
        <HighlightedField>
            <SOMExpression>xfa[0].form[0].myform[0].Subform1[0].Address[0]</SOMEx pression>
         </HighlightedField>
    </HighlighedFields>
    The  upside of this is that you only store XML nodes for what is changed  instead of needing a specific XML node for each field.  The downside is  that you will need a call to the common script in every field's change  event: HighlightChangedField(this);
    Now, to make this work  when a form is loaded the next time, in the initialize event at the  topmost subform in the hierarchy you add a script that walks the  HighlightedFields data node, and for each HighlighedField entry you  highlight the contained object.  You can get a reference to an object  using its SOM expression, so just take the SOM expression from each  entry and do an xfa.resolveNode(SOMExpression) to get the object, then set whatever attributes you want to highlight the field.
    The  big issue I see with this would be if you have dynamically added  objects on your form.  In that case you would probably need to store the  instance index along with the SOM expression for each changed object,  then use that instance number when highlighting on form load.

    As a follow-up, I had said I would try to put together an example for you.  The setting of the change indications and the highlighting of the fields is not a problem, but I did have an issue that perhaps one of the experts on the forum can help with:
    The problem is how to detect a change in a text field without a lot of overhead.  You can't just place a call to the highlight method in the Exit event without checking for a change, since the user can just tab from field to field without changing anything. Unfortunately the properties that show the old text and new text of a field are not valid on the Exit event.  An alternative is to use the Change event, but with a text field the event fires for every character typed.  This seems like a lot of extra processing..
    Anyone know a better way?  I went as far as using the extras collection on fields to hold the last value, but that adds a lot of complexity since it needs to be set to the initial raw value when the form is first loaded. I'd like to find a solution that doesn't require a lot of code to be added to every field on the form.

  • How to get a field that using variable in order to create a query

    Hi,
    I found a difficulty when creating a query. so, I would like to ask you some question.
    1. How to get a field that using variable which that field I want to put it in my query?
    For example, I would like to take quantity field in inventory audit report. And when I put my cursor in
    quantity field, there was only variable, item, etc. How to get this and put it in query?
    2. How to combined the invoice quantity with inventory audit report quantity?
    3. I have a query like this:
    SELECT distinct T0.[DocDate] as 'Tanggal', T0.[DocNum] as 'No.Faktur', T1.[ItemCode] as 'Kode Barang',
    T1.[Dscription] as 'Deskripsi', T1.[Quantity] as 'Quantity', ((T1.[LineTotal])/(T1.[Quantity])) as 'Harga
    Satuan', T1.[LineTotal] as 'Harga Total', T3.[CalcPrice] as 'HPP Satuan', ((T3.[CalcPrice]) * (T1.
    [Quantity])) as 'HPP Total', T4.[ItmsGrpNam] as 'Jenis Barang', T5.[SlpName] as 'Nama Sales', T1.
    [WhsCode] as 'Kode Gudang' FROM [dbo].[OINV] T0 INNER JOIN [dbo].[INV1] T1 ON T0.DocEntry =
    T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OINM T3 ON T2.ItemCode
    = T3.ItemCode INNER JOIN OITB T4 ON T2.ItmsGrpCod = T4.ItmsGrpCod INNER JOIN OSLP T5 ON
    T0.SlpCode = T5.SlpCode WHERE T3.[TransType] = '13' and T3.[CreatedBy] = T1.[DocEntry] and T0.
    [DocDate] >=[%0] and T0.[DocDate] <=[%1] and T4.[ItmsGrpNam] =[%2] and T1.[WhsCode] =[%3]
    Is it possible if I just take one invoice with invoice quantity and only show up at once although I have a
    lot item cost for that item? (because I'm using FIFOmethod).
    Please help me.. cause I'm stuck with this thing :l.
    Thank you very much, and I'm waiting your respon soon.
    Regards,
    Sisca

    Try this one:
    SELECT distinct T0.DocDate as 'Tanggal', T0.DocNum as 'No.Faktur', T1.ItemCode as 'Kode Barang',
    T1.Dscription as 'Deskripsi', T1.Quantity as 'Quantity', ((T1.LineTotal)/(T1.Quantity)) as 'Harga
    Satuan', T1.LineTotal as 'Harga Total', T3.CalcPrice as 'HPP Satuan', ((T3.CalcPrice) * (T1.
    Quantity)) as 'HPP Total', T4.ItmsGrpNam as 'Jenis Barang', T5.SlpName as 'Nama Sales', T1.
    WhsCode as 'Kode Gudang'
    FROM dbo.OINV T0 INNER JOIN dbo.INV1 T1 ON T0.DocEntry =T1.DocEntry
    INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode
    INNER JOIN OINM T3 ON T2.ItemCode = T3.ItemCode AND T3.TransType = '13' and T3.CreatedBy = T1.DocEntry AND T3.Warehouse = T1.WhsCode
    INNER JOIN OITB T4 ON T2.ItmsGrpCod = T4.ItmsGrpCod
    INNER JOIN OSLP T5 ON T0.SlpCode = T5.SlpCode
    WHERE T0.DocDate >=[%0\] and T0.DocDate <=[%1\] and T4.ItmsGrpNam =[%2\] and T1.WhsCode =[%3\]
    Thanks,
    Gordon

  • How to use @variable(bouser) in Universe to get BOE userid in Xcelsius

    Dear Expert,
    I have request that need to display BOE userid to displayed in Dashboard using Xcelsius,
    after searching in Internet, i found that it can be done by using @variable(bouser) in an object in the Universe, and use the object in Qaaws, but i don't how to use it.
    already tried insert /* @variable('BOUSER') */ in END_SQL universe parameter, but still no luck.
    my question is :
    how to use @variable(bouser) in universe? and then my Xcelsius can display the BOE userid?
    thanks in advance for any answer.
    I Using SAP Integration KIT to create universe from Query BEX
    Luqman
    Edited by: luqman hakim on Jun 29, 2010 4:03 PM

    >
    Didier Mazoue wrote:
    > Hi,
    >
    > You are mentioning that you are using SAP Integration Kit.
    > Does it mean that the source you are targeting is SAP BW?
    >
    > If it is the case, this is unfortunately not supported.
    > SAP BW MDX does not support calculated expressions that return string or date: this is a limitation of SAP BW engine.
    > This is one of the reason why a lot of user exit are used to address these needs.
    >
    > Regards
    > Didier
    Didier Mazoue 
    yes, my Data source is SAP BW, and connected to BOE via SAP INT KIT.
    It's too bad that SAP doesn't support so simple requirement.
    you said : user exit 
    are used to address these needs.
    so there are possibility to solve my problem.
    would you give me the logic of user exit?  which part I should create the user exit
    I'm quiet familiar with user exit in BW
    thanks

  • How to use variable in rule script in HFM

    I'm now writing VB script for HFM rule, and have something to ask about the use of variables in rule.
    The script below generates the following error.
    -Error description-
    Line: 4, Error: Invalid Expression
    HS.Exp "S#Actual.A#77300.I#[ICP None] = cur"
    An error has occurred in Hyperion Financial Management.
    -Rule script-
    Sub Allocate()
    Dim cur
    cur = 500
    HS.Exp "S#Actual.A#77300.I#[ICP None] = cur"
    End Sub
    On the other hand, the script below works properly.
    -Rule script-
    Sub Allocate()
    HS.Exp "S#Actual.A#77300.I#[ICP None] = 500"
    End Sub
    Probably I'm not using variables in proper way, but have no idea how to correct it.
    Does anyone have any idea?
    Thanks in advance.

    Hello,
    try this in the sub calculate:
    HS.Exp "S#Actual.A#77300.I#[ICP None]=" & cur
    For the sub allocate, I suppose that you do not have the issue because the allocate is not launch during the consolidation process. Allocate is launched separatly by a right click, and can only be done when calculation status = "OK", which means that all calculation have been done (that could not be the case if you have an error like this in sub calculate).
    Hope it helps

  • Explain how to implement prompt functionality using @variable

    Hi all,
    Anyone please explain how to implement prompt functionality using @variable.
    We got some sql reports.Those reports have to be converted into BO free hand sql report.
    Please provide any best practices for converting sql reports into BO free hand SQL.
    Thanks & Regards,
    James Charle

    Hi
    Please refer "@Variable" section  in page number 601, in http://help.sap.com/businessobject/product_guides/boexir31SP3/en/xi31_sp3_designer_en.pdf
    Regards
    Ashwini

  • How Can I Use Variables to Score Interactions?

    I've created a course. Each slide as a question/scenario and three buttons. Two wrong answers and one right. When you choose any of the buttons you get a feedback box that explains why you were right or wrong. These are not quiz slides, but I would like to use variables to score the slides if I could.
    My idea was to create a variable and call it congrats. The variable as a sum of zero. Is it possible for me to add a numerical value to that variable each time a person chooses one of the buttons?
    For example:
    I wanted to add 10 to the variable if you choose the right answer. I wanted to give the incorrect answers a  value of -5. In other words. You could either end up with 10 points on a slide if you choose the correct answer or 0 points if you choose the 2 incorrect answers and the correct answer, or 5 points if you choose a incorrect and correct answer.
    At the end, I would like you come to a slide. this slide will be based on the value of that variable at the end. Either you have a 100 or lower depending on how you did.
    I hope this isn't too confusing.
    Any and all help is appreciated.
    Thanks!

    You forgot one important detail: has the score to be transmitted to a LMS or is it only meant to be shown in the Captivate file?
    And which version are you using? The easiest way to achieve this is to use the partial scoring (and penalty) that is already available for MCQ slides with multiple correct answers.
    I have a lot of stuff on my blog about that type of scoring. Besides question slides, only interactive objects can have a score, everything you can find in the Advanced Interaction panel (F9). Here are some articles I wrote:
    Report Custom Questions - part 1 - Captivate blog
    Report Custom Questions - part 2 - Captivate blog

  • TS4009 I seem to have 2 iCloud accounts with different names - a free storage that came with my Macbook and one I used when I bought some iCloud space. How can I cancel the free account?

    I seem to have 2 iCloud accounts with different names - a free storage that came with my MacBook and one I used when I bought some iCloud space. How can I cancel the free account? Because of this I can't access iMatch and the ICloud account I paid for on my MacBook
    Any ideas cos its frustrating that I can't access something I paid for!

    Sign out of the account you do not wish to use, sign into the one that you do wish to use.

  • How do I use a Mac Mini + Airport Express + Time Machine disk to backup another iMac

    How do I use a Mac Mini + Airport Express + Time Machine disk to backup another iMac?
    The question pretty much says it all.
    I have a Mac Mini with an attached 3TB Hard Drive used for Time Machine Backups.
    I have an Airport Extreme base station which services that machine plus several others.
    I would like to backup my new iMac and a MacBook Pro to the Mac Mini.
    What do I need to do on the mini to export that hard drive so that it can be used as a Time Machine target from the other systems?
    All systems are running 10.6.8.

    Well you would have to do backups over a network which is much slower and has highest chance of becoming corrupt. I think your best option would be to get an apple time capsule to act as a network and back if thats how you wanna do that

  • How to use variables with

    I need to get the number of lines in internal table, which would
    be easy, using DESCRIBE TABLE itab LINES lines. But the problem
    is, that I get the name of this internal table in the field of
    another internal table, so I have to use the name of internal
    table as variable, but I don't know how to use variables with
    DESCRIBE TABLE (or if this is possible).

    Hi,
    REPORT ZPRUEBA782 .
    define two tables with diferent structures.
    data: begin of table1 occurs 0,
    registro type i,
    end of table1.
    data: begin of table2 occurs 0,
    registro type i,
    repid like sy-repid,
    end of table2.
    data: rows type i.
    start-of-selection.
    fill them with data
    do 1000 times.
    table1-registro = sy-tabix.
    append table1.
    enddo.
    do 1757 times.
    table2-registro = sy-tabix.
    table2-repid = sy-repid.
    append table2.
    enddo.
    call a form that receives as input the table and returns the number
    of rows as output.
    perform howmanyrows tables table2 changing rows.
    break-point. "evaluate the number of rows
    perform howmanyrows tables table1 changing rows.
    break-point. "evaluate the number of rows
    end-of-selection.
    form howmanyrows tables itable changing rows.
    rows = 0.
    loop at itable.
    add 1 to rows.
    endloop.
    endform.
    You can try it if you don't find a better solution.
    Cheers,
    Chaitanya.

  • How do I get my entire photo stream to my new iPad. I use my ICloud and some of them showed up but most if them did not. I am trying to sync the photos from my phone to an iPad 1 and iPad mini.

    How do I get my entire photo stream to my new iPad. I use my ICloud and some of them showed up but most if them did not. I am trying to sync the photos from my phone to an iPad 1 and iPad mini.

    Photostream in the cloud only keeps photos from the last 30 days (subject to a 1,000 photo limit). When photostream syncs the photos to your device they will stay there until deleted, which means you may well have more photos in your photostream album on your device than there are in photostream in the cloud.
    The consequence of this is that if you turn photostream off and on again on your device (or enable it for the first time), it will only be populated with photos from the last 30 days, which may not be all the photos that were previously in the photostream album on that device.

  • Using Variable within Filter expression will not parse.

    IN ODI 11.1.1.3.0, I defined a Variable (SelectionDate) of type "Alphanumeric", Default Value = 01-JAN-1970 with the select query: select to_char( SYSDATE , 'DD-MON-YYYY') from dual.
    I intend to use this variable as a scenario variable (parameter) that receives a value in the form of 'DD-MON-YYYY', from the execution environment.
    I refreshed the variable and it received the value 16-JUN-2011 (today's date). So far so good.
    I then defined an Interface and used the variable in a filter expression:
    Active Filter: Checked
    Implementation Tab:
    SOURCE_VIEW.SELECTION_DATE BETWEEN TO_DATE('#PROJECT1.SelectionDate', 'DD-MON-YYYY') AND (TO_DATE('#PROJECT1.SelectionDate', 'DD-MON-YYYY') + 1)
    Execute on :Source
    When verifying the expression (click on the checkmark in the implementation tab) I always get: Expression is not valid for this DBMS. java.sql.SQLDataException: ORA-01858: a non-numeric character was found where a numeric was expected.
    I cannot get the filter to parse. Thank you for your ideas of what might be wrong.
    Jose.

    Yes, it worked when placed in the package.
    I think the expression editor is sending the string as it is written to the database in order to parse it, without replaceing the #variable for the actual value. Anyway thanks.
    Jose

  • How to use variables in data slices?

    Hello,
    in BI-IP I have tried to use variables in a data slice.
    The user should fill these variables.
    How can one use and fill these variables?
    Thank you
    Daniel

    Hello Horst,
    data slice is a very strong system lock. It is normally not a good decission to allow users to control this part becuse it sould be in administration of a responsible person.
    If you allow users in the web to open or close data slices, this is like a "open period" funtion in financials: Think about what could happen, if anyone else than the responsible person could do that....
    This is my point of view.
    I would do it in anoter way: Create an User exit and fill a variable like desribed above. You read each line and make a decission whether the user might see this line or not (e. g. period open? yes or no?). The period and the status for the period could be maintained in a table or in a characteristic. table might be easier.
    regards
    Eckhard

Maybe you are looking for