Related Selects

I'm trying to get a couple of related selects working based
on Dan Bracuk's code. Below I'll write my interpretation.
1 - On top of cfm page:
<cfquery name="Cliente" datasource="intraartis">
SELECT ClienteID, ClienteNome
FROM dbo.cliente_tbl
ORDER BY ClienteNome
</cfquery>
<cfquery name="Contacto" datasource="intraartis">
SELECT ClienteID, ContactoID, ContactoNome
FROM dbo.contactos_tbl
ORDER BY ContactoNome
</cfquery>
2 - Within the Head tags:
<script language="javascript">
<cfset
idArray=ListToArray(ValueList(Contacto.ContactoID))>;
<cfset
compareArray=ListToArray(ValueList(Contacto.ClienteID))>;
<cfset
descriptionArray=ListToArray(ValueList(Contacto.ContactoNome))>;
function selectChange(selectedValue)
<cfoutput>
var #toScript(idArray, "theIdArray")#;
var #toScript(compareArray, "theCompareArray")#;
var #toScript(descriptionArray, "theDescriptionArray")#;
</cfoutput>
var i=0;
var j=0;
var len=theIdArray.length;
document.forms['ProjectoFrm'].Contacto.options.length=0;
for(i=0;i<len;i++)
if(theCompareArray==selectedValue)
document.forms['ProjectoFrm'].Contacto.options[j]=new
Option(theDescriptionArray,theIdArray);
j++;
return true;
</script>
3 - Inside of the form tags:
<cfselect query="Cliente" name="ClienteID"
onChange="selectChange(this.Value);" value="ClienteID"
display="ClienteNome" selected="#selectedCliente#"/>
<cfif existingrecord>
<cfselect query="Contacto" name="ContactoID"
value="ContactoID" display="ContactoNome"
selected="#selectedContacto#"/>
<cfelse>
<select name="ContactoID">
<option value="1">Not Updated</option>
</select>
</cfif>
4. It comes up with the COLDFUSION error: Variable
SELECTEDCLIENTE is undefined.
Viewing the source of the page, the arrays are built.
Could Dan Bracuk or someone else give me some help?
Thanks.
Manuel

Thanks Dan for your reply.
I´m pasting your code as it is on the post of
02/26/2007:
I only had to do this once, and it works. Here it is
<cfquery name="Etiology" datasource="burns">
select EtiologyID, Etiology
from burns_Etiology
where show = <cfqueryparam cfsqltype="cf_sql_char"
value="Y">
</cfquery>
<cfquery name="EtiologyDetail" datasource="burns">
select EtiologyID, EtiologyDetailID, detail
from burns_EtiologyDetail
where show = <cfqueryparam cfsqltype="cf_sql_char"
value="Y">
</cfquery>
// arrays to make selectcontrol script work
idArray =
ListToArray(ValueList(EtiologyDetail.EtiologyDetailID));
compareArray =
ListToArray(ValueList(EtiologyDetail.EtiologyID));
descriptionArray =
ListToArray(ValueList(EtiologyDetail.detail));
another query for the current value, if applicable
<script language="JavaScript">
function selectChange(selectedValue)
// changes the options for etilogy detail based on selection
of etiology
<cfoutput>
var #toScript(idArray, "theIdArray")#;
var #toScript(compareArray, "theCompareArray")#;
var #toScript(descriptionArray, "theDescriptionArray")#;
</cfoutput>
var i = 0;
var j = 0;
var len = theIdArray.length;
// clear the detail select control
document.forms['dataForm'].EtiologyDetail.options.length = 0;
for ( i = 0; i < len; i++)
if (theCompareArray == selectedValue)
document.forms['dataForm'].EtiologyDetail.options[j] = new
Option(theDescriptionArray,theIdArray);
j++;
} // end if
} // end loop
return true;
} // end function
</script>
Function gets called here
<th>Etiology</th>
<td><cfselect query="Etiology" name="Etiology"
onChange="selectChange(this.value);"
value="Etiologyid" display="Etiology"
selected="#selectedEtiology#" />
</td>
<th>Detail</th>
<td colspan="3">
<cfif existingrecord>
<cfselect query="etdetail" value="EtiologyDetailID"
display="detail"
name="EtiologyDetail" selected="#selectedEtiologyDetail#"
/>
<cfelse>
<select name="EtiologyDetail" >
<option value="1">Not Updated</option>
</select>
</cfif>
I don´t see where you set the variable
"selectedEthiology".
Hope this helps.

Similar Messages

  • Array problem - Related Selects

    Good Morning,
    I'm a newbie when it comes to this so I apologize ahead of time.
    I'm trying to build a Year/Make/Model related select search. I found a HTML, PHP, and the JQuery Related Select Plugin that i'm trying to convert to use with CF.
    It looks like i can use an array to replace the PHP page that supplies static data:
    <?php
    $stateID = $_GET['stateID'];
    $countyID = $_GET['countyID'];
    $townID = $_GET['townID'];
    $html = $_GET['html'];
    $states = array();
    $states['MA'] = "Massachusetts";
    $states['VT'] = "Vermont";
    $states['SC'] = "South Carolina";
    $counties = array();
    $counties['MA']['BARN'] = 'Barnstable';
    $counties['MA']['PLYM'] = 'Plymouth';
    $counties['VT']['CHIT'] = 'Chittenden';
    $counties['SC']['ANDE'] = 'Anderson';
    if($stateID && !$countyID && !$townID){
              echo json_encode( $counties[$stateID] );
    } elseif( $stateID && $countyID && !$townID ) {
              echo json_encode( $towns[$stateID][$countyID] );
    } elseif( isset($villages[$stateID][$countyID][$townID]) ) {
              echo json_encode( $villages[$stateID][$countyID][$townID] );
    } else {
              echo '{}';
    ?>
    I'm tryiing to convert the following into an array so that i can access it from the index.cfm page:
    <cfquery name="qYear" datasource="MyDS" username="MyUser" password="MyPass">
        select distinct YearRange
        from ExactFit2012
        order by YearRange
    </cfquery>
    <cfquery name="qMake" datasource="MyDS" username="MyUser" password="MyPass">
        select distinct Make
        from ExactFit2012
        order by Make
    </cfquery>
    <cfquery name="qModel" datasource="MyDS" username="MyUser" password="MyPass">
        select distinct Model
        from ExactFit2012
        order by Model
    </cfquery>
    <cfset myYear = ListToArray(ValueList(qYear.YearRange)) />
    <cfset myMake = ListToArray(ValueList(qMake.Make)) />
    <cfset myModel = ListToArray(ValueList(qModel.Model)) />
    <Cfoutput>
    #myYear#<br>
    #myMake#<br>
    #myModel#
    </Cfoutput>
    When i do this i get the error:
    Error Occurred While Processing Request
    Error Executing Database Query.
    [Macromedia][SQLServer JDBC Driver][SQLServer]Invalid column name 'Ford'.
    index.cfm:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>jQuery Related Selects</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
    <script src="src/jquery.relatedselects.min.js" type="text/javascript"></script>
    <style type="text/css">
    body { font:12px helvetica, arial, sans-serif; }
    </style>
    <script type="text/javascript">
    $(function(){
              $("#example-1, #example-3").relatedSelects({
                        onChangeLoad: 'MyArray.cfm',
                        defaultOptionText: 'Choose an Option',
                        selects: {
                                  'Make':                    { loadingMessage:'Loading Year...' },
                                  'YearRange':                    { loadingMessage:'Loading Make...' },
                                  'Model':                    { loadingMessage:'Loading Model...' },
                                  'OverallSize':          {}
    </script>
    </head>
    <body>
    <form id="ymm">
              <select name="YearID">
              <option value="">Choose Year &raquo;</option>
              <cfoutput query="qYear">
              <option value="#YearRange#">#YearRange#</option>
        </cfoutput>
              </select>
              <select name="Make">
              <option value="">Choose Make &raquo;</option>
              </select>
              <select name="Model">
              <option value="Model">Choose Model &raquo;</option>
              </select>
              <select name="OverallSize">
              <option value="">Choose Size &raquo;</option>
              </select>
    </form>
    </body>
    </html>
    I may be going avout this all woring, but i have tried 3 cfc tutorials with no luck so i'm hoping the JQuery Related Select will do the trick.
    Cheers,
    Aaron

    good

  • Reporting: using operators with relative selection

    Dear all,
    i am facing an problem when trying to create a certain report.
    The requirement is to gather all opportunities for which the sales phase has started more than 1 month ago.
    Phase start date is a characteristic you can use using data sources for opportunity header.
    However, to select on phase start  date (an any other type of date characteristic) you can only use operators (is, is less than, is greater than, ...) with a fixed date (for example: is less than 01.03.2015) or you can use a relative selection (last week, last month, last 4 days, ...).
    I need to be able to achieve the following: "phase start date" "is less than" "last month"
    Is there a way we can do this?
    Regards,
    Michael

    Hi Michael,
    You should design the new reporting using existing data source 'OPPORTUNITY HEADER'.
    Step 1. Define report and data source
    Step 2. Select Key Figures
    Step 3. Select Characteristics
    Step 4. Characteristics Properties : In this step you select Phase start date and make the value selection as 'FIXED VALUE SELECTION', in fixed value selection click on more option button ( +-> sign) now this will give the option for relative selection.
    Step 5, 6 and 7 as standard steps as you  have to follow them.
    I have attach the screenshot of Phase start date, just follow as defined in the screenshot:
    This will the issue that you have.
    Cheer! Anil Poply

  • Relative Selections in reports

    Hi everybody,
    we want to use relative selections in reports e.g. to select the current quarter and the next three.
    The standard relative selection doesn't contain this option, but it is possible to define own relative selections. But these are only "quite relative", that means there is no logic to calculate the current quarter and the following from today's date. I can only enter fixed values e.g. Q3/2014 for the current quarter and have to change it when the next quarter starts. This is also described in the documentation. That's not really what we are looking for.
    Is there any PDI-way to create own relative selections with really calculations? I didn't find anything.
    kind regards,
    Frank

    Frank,
    I don't believe so as of 1405 - I've asked support about this and they recommend that i post an idea to the ideas forum.
    We'll have to see what the 1408 SDK information contains, but from what i see, there's nothing in the 1408 ByDesign "What's New" documentation related to this.

  • Related Selects - Cannot get it to work

    I am creating a report and need to use related selects,
    second pulldown dependent of first pulldown selection.
    I found this example off the internet and it does exactly
    what I want to do :
    http://www.webtricks.com/code/code.cfm?CodeID=18
    However, when I attempt to make my substitution in the code,
    all I get for my second pulldown is the id numbers, no names. I am
    frustrated beyond belief ! Seems simple enough but I just cannot
    get it to work and I have been playing with this for over two weeks
    now.
    Can somebody please show me how to do it ? Here is my query
    (the example uses two but I think it can be done in one)
    <cfquery name="GetSites" datasource="dbName">
    select distinct
    s.siteID,
    s.site,
    a.siteID as areaID,
    a.area as depot
    from table1 s, table2 a
    where s.siteID = a.siteID
    and s.siteID <> 1
    My first pulldown will be the site, and depending on what is
    selected, the second pulldown will be populated with the area
    (depot) for that site. I tried to substitute my varialbes into the
    url code and it did not work, Can somebody please show me the
    proper way to do this ? Thanks

    Hi,
    I think when you are using JS code then you are assigning the
    value to the second Drop down box in this way:
    "document.formname.second_combo_box_name[n].
    text" = some_value
    So check "document.formname.second_combo_box_name[n].
    text" should be assigned area (depot) name in java script.
    It should not be number but area name.
    I hope this solves your query. Let me know on this.

  • Multiple Related Selects

    I'm trying to create three related select boxes. I want the
    user to make a selection in box one, and then display data in box
    two based upon their selection from box one, etc. I don't want the
    page to refresh. I'm on ColdFusion 7. Here's the code I'm trying,
    but I can't get data into box two or three. Any suggestions?

    CF_ThreeSelectsRelated is AWESOME! Works Great. Does exactly
    what I needed.
    http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&loc=en_us&extid=1000 298

  • Related selects using radio button

    Hi All,
    I wanna use radio button with three options and one dropdown
    box .
    my problem is i wanna choose option from radio button and run
    the related query to get the values into dropdown box and then
    choose the value from drop down and submit it to another page.
    Any ideas ? please help me.
    Thanks in advance

    Google coldfusion related selects and adjust the javascript
    so that you are using radio buttons instead of a select.
    I recently posted my own code. Look for the keyword
    etiologydetail.

  • Related selects in JS

    I'm trying to build an email list for parents to receive
    school- and grade-specific emails. I'm building related selects to
    choose the school, and then the grades at that school (which vary
    based on elementary/middle/high). I've grabbed working JS code and
    changed it, and of course it doesn't work for me. :) It displays
    the schools fine, but doesn't change the grades box. When I view
    the source, it is creating the appropriate arrays, but they're not
    being implemented.
    I'm attaching the code with the handy "attach code" button.
    :) I can provide the source data as well if that would help.
    And next, of course, I'll need to pass these values to
    another page to use. If anyone has insight on *that*, I'd
    appreciate being pointed in a good direction.
    (I feel like such a moron)

    I only had to do this once, and it works. Here it is
    <cfquery name="Etiology" datasource="burns">
    select EtiologyID, Etiology
    from burns_Etiology
    where show = <cfqueryparam cfsqltype="cf_sql_char"
    value="Y">
    </cfquery>
    <cfquery name="EtiologyDetail" datasource="burns">
    select EtiologyID, EtiologyDetailID, detail
    from burns_EtiologyDetail
    where show = <cfqueryparam cfsqltype="cf_sql_char"
    value="Y">
    </cfquery>
    // arrays to make selectcontrol script work
    idArray =
    ListToArray(ValueList(EtiologyDetail.EtiologyDetailID));
    compareArray =
    ListToArray(ValueList(EtiologyDetail.EtiologyID));
    descriptionArray =
    ListToArray(ValueList(EtiologyDetail.detail));
    another query for the current value, if applicable
    <script language="JavaScript">
    function selectChange(selectedValue)
    // changes the options for etilogy detail based on selection
    of etiology
    <cfoutput>
    var #toScript(idArray, "theIdArray")#;
    var #toScript(compareArray, "theCompareArray")#;
    var #toScript(descriptionArray, "theDescriptionArray")#;
    </cfoutput>
    var i = 0;
    var j = 0;
    var len = theIdArray.length;
    // clear the detail select control
    document.forms['dataForm'].EtiologyDetail.options.length = 0;
    for ( i = 0; i < len; i++)
    if (theCompareArray
    == selectedValue)
    document.forms['dataForm'].EtiologyDetail.options[j] = new
    Option(theDescriptionArray,theIdArray
    j++;
    } // end if
    } // end loop
    return true;
    } // end function
    </script>
    Function gets called here
    <th>Etiology</th>
    <td><cfselect query="Etiology" name="Etiology"
    onChange="selectChange(this.value);"
    value="Etiologyid" display="Etiology"
    selected="#selectedEtiology#" />
    </td>
    <th>Detail</th>
    <td colspan="3">
    <cfif existingrecord>
    <cfselect query="etdetail" value="EtiologyDetailID"
    display="detail"
    name="EtiologyDetail" selected="#selectedEtiologyDetail#"
    />
    <cfelse>
    <select name="EtiologyDetail" >
    <option value="1">Not Updated</option>
    </select>
    </cfif>

  • Related selects and showing CFQUERY value

    I have a form that works well. Using a CFC, I have two CFSELECTS that are related. A selection on the first determines the display on the second. So far so good. But then I started thinking that users need to be reminded of what they are selecting. In the first CFSELECT the value is a user ID. I want to use that to populate a CFINPUT or simply a CFOUTPUT, but this has to be bound to the CFSELECT. So the user chooses her name. That populates a second CFSELECT with choices for her to select. But in between, I want to show her a choice she made months ago, and this is a value that I grabbed in the CFFUNCTION that is bound to that CFSELECT.
    Is there a way to display another value after the CFSELECT? Another value that my CFQUERY in the CFC has already grabbed?
    That would be really good. I could then, once a user has selected her name, show her user ID and other information and also show her this selection of some hardware that she made months ago and forgot about.
    Then the form would go on to the second CFSELECT where she would select a date for tech service. But I think that part is unrelated to what I want to do in between.
    I've Googled this scenario and the most likely solution is something like this.
    Within a component and a CFFUNCTION, I would put something like this
    <cfset var userModel=[queryname].userModel> (I'm just guessing here)
            <cfreturn userModel>
    And then I'd be able to bind a CFINPUT to this component and function and display the userModel.
    The user would see this and remember what hardware she chose and then go on to choose a date to get it.
    I've tried variations on this but always get a message to the effect that the parameter has not been passed in.

    Here's the CFC, followed by the form. The Name and Date CFSELECTS work. The model CFSELECT is the problem. I used the HTML view to paste the code.
    SELECT Name, Emp_Id, SelectionDate, ModelSelected FROM machine_Selection WHERE SelectionDate > '2012-05-31 00:00:00.000' ORDER BY Name         SELECT convert(varchar(6),lr.session_date,107) as session_date FROM Laptop_Rollout lr inner join laptop_selection ls on left(ls.modelselected, 2) = left(lr.session_name, 2) OR left(ls.modelselected, 2) = right(lr.session_name, 2) WHERE ls.emp_id = #arguments.emp_id# AND lr.session_date NOT IN ( select SelectionDate from laptop_selection where year(selectiondate) = 2012 group by SelectionDate having count(SelectionDate) >= 25 ) ORDER BY CONVERT(datetime, Session_Date, 103) ASC          <
    ************** the form *************************
    Select Name:
    Model Selected: 
    Rollout Date:    select date  

  • How to make site root-relative links work in DW and Server both?

    See details on buggy DW image link behavior, below. My question is:
    1) how to make site root-relative links work in DW and Server both? Or…
    2) how to reliably automate the change of several hundred legacy root-relative links of the form
    /images/image.jpg  to document-relative?
    That is, to
    ../images/image.jpg or
    ../../images/image.jpg or
    ../../../images/image.jpg etc…depending on where the directory is.
    The old format (/images/image.jpg ) used to work fine in my previous DW 8 configuration but appear grey in DW after “upgrading” to DW cs5.5 mac. (they look fine on the server, but it’s hard to edit image-heavy pages locally when they are all grey).
    I tried changing the files to how DW creates root relative links now:
    /public_html/images/image.jpg, which is a very easy, attractive root flow since there’s a one-to-one mapping. These look great in DW but are broken on the server!
    I looked at the “advanced” site setup, and it looked like it might be possible to nuke the /public_html/ part of my server info…but it also looked like there was the potential for doing damage changing these settings, which are automatically generated from our server connection settings, which seem to work.
    The “links relative to document/ site root” toggle…does that change how DW interprets existing links, or just change the default when you are adding a link?  I have made 80% of the file links document relative…before wondering if root-relative isn’t better?
    It sure seems less ambiguous for all those images if theres a way to make root relative work for DW design view, DW link check, and server.
    Summary of buggy behavior: (see test with images here)
    "old style" site root link
          /images/img_book/WScover120x150_NEW.jpg
          Design veiw in DW: broken (grey w/ broken icon)
          Link check in DW: "external link" (i.e., uncheckable, + file could appear orphaned)
          Browser: good
          Ease of switching: n/a (existing format)
    "new style" site root relative link
          /public_html/images/img_book/WScover120x150_NEW.jpg
          Design veiw in DW: good
          Link check in DW: good
          Browser: broken
          Ease of switching: easy
    Document relative link
          ../../images/img_book/WScover120x150_NEW.jpg
          Design veiw in DW: good
          Link check in DW: good
          Browser: good
          Ease of switching: hard (how to automate?)
    Absolute link
          http://www.oasisdesign.net/images/img_book/WScover120x150_NEW.jpg
          Design veiw in DW: broken (grey w/ broken icon)
          Link check in DW: external (i.e., uncheckable, + file could appear orphaned)
          Browser: good
          Ease of switching: n/a...not a real option
    Thanks!
    Similar discussion on "/"

    Hello again Jon!
    Thanks for jumping on this.
    All clear and understood about where publc_html is etc.
    No contemplation of nuking the actual public_html directory on the server, just the "/public_html" text string at the start of the DW-generated links.
    "/public_html" is automatically added to the front of the link in DW if I create the link with any of the GUI tools, if I have "site root relative" selected. And ""/public_html" ends up in the code, and gets uploaded that way to the server, where it (obviously) doesn't work.
    Doesn't sound like it is supposed to work this way. Also, what seems to be the usual root relative format (/images/image.jpg) shows as a broken link in the GUI and an external link in the DW link check. All this togther makes me thinkI have some obscure setting incorrect?
    The setting that caught my eye is manage sites/ site setup/ advance settings/ local info/ web url,  which is automatically set to http://www.oasisdesign.net/public_html/
    it gives an option to change it but it makes every effort to make this NOT look like something users should mess with:
    Having gone through the more careful thought process during this post, I'm ready to do the experiment of changing the remote server web URL (why is it wrong by default?)...think I'll eat dinner first so there's 45 min to avert disaster if anyone knows this to be a bad idea!
    Art
    PS--don't  have a local testing server...don't think this will solve the GUI broken link/ link shows as external problems.
    Is there an easy, automated way to change links sitewide from document to root relative?

  • How to get related entities in lightswitch RIA domain service?

    I have set up my DomainService and here is the data structure(one CombinedStadium may
    have many CombindeEcoStatus)
    public class CombinedStadium
    [Key]
    public int SiteId { get; set; }
    [Include]
    [Association("Stadium_EcoStatus", "SiteId", "StadiumId")]
    public IQueryable<CombindeEcoStatus> EcoStatus { get; set; }
    public class CombindeEcoStatus
    private CombinedStadium _combinedStadium;
    [Key]
    public int EcoId { get; set; }
    public int Year {get;set;}
    public int StadiumId { get; set; }
    [Include]
    [Association("Stadium_EcoStatus", "StadiumId", "SiteId", IsForeignKey = true)]
    public virtual CombinedStadium Stadium
    get { return this._combinedStadium; }
    set
    this._combinedStadium = value;
    if (value == null)
    this.StadiumId = value.SiteId;
    the query is
    [Query(IsDefault = true)]
    public IQueryable<CombinedStadium> GetAllStadiums()
    var stadiumsQuery = from stadium in this.Context.StadiumSet
    select new
    SiteId = stadium.Id
    return stadiumsQuery;
    When I consume this RIA service in my lightswitch app as datasource,and the result looks as same as the Original lightswitch Data Source.
    Question:When I query the "CombinedStadium" in HTML client. I can't use the "expand" keyword to get the "EcoStatus" Items which belong to the selected
    "CombinedStadium" items.the query code is below:
    //streetIds, openIds are query parameters
    //streetIds is parameter for query the "CombinedStadiumItem" table
    //openIds is parameter for query the "CombindeEcoStatusItem" table
    myapp.activeDataWorkspace
    .WCF_RIA_ServiceData
    .CombindedStadiumQuery(streetIds, openIds)
    .expand('EcoStatus')
    .execute()
    .then(function(proItems) {
    var test = proItems.results;
    addPin2Map(test);
    loadStadiumInfoGrid(test);
    the browser throw "error 501".
    So I query the "CombinedStadiumItem" table alone.the code is below: 
    //streetIds, openIds are query parameters
    //streetIds is parameter for query the "CombinedStadiumItem" table
    //openIds is parameter for query the "CombindeEcoStatusItem" table
    myapp.activeDataWorkspace
    .WCF_RIA_ServiceData
    .CombindedStadiumQuery(streetIds,openIds)
    .execute()
    .then(function(proItems) {
    var test = proItems.results;
    addPin2Map(test);
    loadStadiumInfoGrid(test);
    myapp.activeDataWorkspace
    .WCF_RIA_ServiceData
    .RiaEcostatusQuery(streetIds,openIds)
    .execute()
    .then(function(proItems) {
    var test = proItems;
    and the query code in server :
    partial void CombindedStadiumQuery_PreprocessQuery(string streetPara, string openPara, ref IQueryable < CombinedStadiumItem > query) {
    var street = ParseParaStr(streetPara);
    if (street != null) {
    query = query.Where(e => street.Contains(e.Street));
    var open = ParseParaStr(openPara);
    if (open != null) {
    //when I try to access "EcoStatus" property in "CombindedStadiumItem" table,it throws error
    query = query.Where(e => e.EcoStatus.Any(eco => open.Contains(eco.OpenStatus)));
    //when I try to access "Stadium" property in "CombindedEcoStatusItem" table,it throws error
    partial void RiaEcostatusQuery_PreprocessQuery(string streetPara, string openPara, ref IQueryable < CombindeEcoStatusItem > query) {
    var street = ParseParaStr(streetPara);
    if (street != null) {
    //when I try to access "Stadium" property in "CombindedEcoStatusItem" table,it throws error
    query = query.Where(e => street.Contains(e.Stadium.Street));
    var open = ParseParaStr(openPara);
    if (open != null) {
    query = query.Where(e => e.EcoStatus.Any(eco => open.Contains(eco.OpenStatus)));
    Now, I can not get "CombindedEcoStatusItem" that related selected "CombindedStadiumItem" respectively.
    How can I  get related entities when I use lightswitch RIA service in  HTML Client query?
    Thanks!!!

    How to write to the event log is not a WPF topic. Please ask C# questions in the C# forum:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=csharpgeneral
    There is an example of how to the event log using C# code available here:
    https://support.microsoft.com/en-us/kb/307024?wa=wsignin1.0
    This sample code should work:
    string sSource;
    string sLog;
    string sEvent;
    sSource = "My application name";
    sLog = "Application";
    sEvent = "Log initialization";
    if (!System.Diagnostics.EventLog.SourceExists(sSource))
    System.Diagnostics.EventLog.CreateEventSource(sSource, sLog);
    System.Diagnostics.EventLog.WriteEntry(sSource, sEvent);
    System.Diagnostics.EventLog.WriteEntry(sSource, sEvent,
    System.Diagnostics.EventLogEntryType.Warning, 234);
    The event will get added to Event Viewer->Windows Logs->Application.
    Please remember to close your threads by marking helpful posts as answer and then start a new thread in the appropriate forum if you have a new question. And please don't ask several questions in the same thread.

  • XPath query works with CLOB but not with object relational

    hi all
    i have the following queries,the XQuery work with all, but XPath queries work with XMLType CLOB and Binary XML, but they do not work with XMLType as Object relational,
    select extract (object_value,'movies/directorfilms/films/film [studios/studio = "Gaumont"]')
    from xorm;
    select extract (object_value,'movies/directorfilms[director/dirname = "L.Cohen"]/films/film[position()=2]/t')
    from xorm;
    they shows this message
    ORA-00932: inconsistent datatypes: expectd SYSTEM.name683_COLL got CHAR
    thanks

    Hi Marco
    fisrt here is my RO
    BEGIN
    DBMS_XMLSCHEMA.registerSchema(
    SCHEMAURL=>'http://......../ORMovies.xsd',
    SCHEMADOC=>bfilename('DB','Movies.xsd'),
    LOCAL =>false,
    GENTYPES=>true,
    GENTABLES=>FALSE,
    CSID=>nls_charset_id('AL32UTF8'));
    END;
    create table XORM of xmltype
    xmltype store as object relational
    XMLSCHEMA "http://......../ORMovies.xsd"
    ELEMENT "movies";
    INSERT INTO XORM
    VALUES(XMLType(BFILENAME('DB','ORMovies.xml'),nls_charset_id('AL32UTF8')));
    here the XQuery format that work fine with the OR
    A/D
    select XMLQuery ('for $a in movies/directorfilms/films/film
              where $a/studios/studio = "Gaumont"
              return $a'
         passing object_value
         returning CONTENT)"TitleX"
    from xorm;
    child element query
    select XMLQuery ('for $a in movies/directorfilms/director[dirname = "Feyder"]
              let $b:=$a/../films/film[position()=2]
              return $b/t'
         passing object_value
         returning CONTENT)"TitleX"
    from xorm;
    here is the XPath format which doesn't work
    select extract (object_value,'movies/directorfilms/films/film [studios/studio = "Gaumont"]')
    from xorm;
    select extract (object_value,'movies/directorfilms[director/dirname = "Feyder"]/films/film[position()=2]/t')
    from xorm;
    by the way all queries work fine with the CLOB or Binary XML
    many thanx Marco

  • How to add Material type(MTART) field on Selection screen of MB5B transaction code.

    Hi All,
        Please let me know how to add material type field on selection screen of MB5B transaction
    For that i made copy ZMB5B_COPY of original report RM07MLBD.
    Thanks in adv .
    Samadhan

    Hi,
    Once you copied the standard report to Z report, you can MTART in selection screen like below.
    and in order to inlcude the same in programming logic, we have three option.
    1) Check all related select queries, and include MTART in SELECT query using inner join with MARA.
    2) In START-OF-SELECTION event fill MATNR as shown below.
    3) If user entered any value in MTART, then before displaying the report just check material type of each material in the final internal table(which is used to display report) delete enteries from internal table accordingly.
    START-OF-SELECTION.
    IF MTART[] IS NOT INITIAL AND MATNR[] IS INITIAL.
        SELECT MATNR FROM MARA INTO MATNR-LOW WHERE MTART IN MTART.
          MATNR-OPTION = 'EQ'.
          MATNR-SIGN = 'I'.
          APPEND MATNR.
          CLEAR MATNR.
        ENDSELECT.
    ENDIF.
    The above option has one limitation: The selection screen variables has some restriction, please read the below thread.
    Facing problem in select statement dump DBIF_RSQL_INVALID_RSQL CX_SY_OPEN_S
    Getting Dump in the select query has more than 2000 entries
    Hope this will work for you .
    regards,
    Rajesh Sadula.

  • Detail data in relational, summary in OLAP?

    Hi, I've had a lot of practice now with the new AW wizards (version 10.1.0.3) and loading from a relational star schema. However, what I really want to do is build an AW that only has the "summary" levels, and have queries against the AW drill down into the RDBMS for the detailed level transactions.
    This used to be possible using RAA / RAM - is it still possible now? If so, how would I do this?
    Thanks,
    Scott

    Scott,
    Two ways in which I would approach this.
    If you've got Oracle 10g, you could use the new query equivalence feature (http://www.dbazine.com/rittman2.shtml) to map a relational select statement that uses a GROUP BY clause to a summary within an analytic workspace. See the article for an illustrative example at the end.
    The other approach would be for your query to go directly against the analytic workspace, which would retrieve data directly from data in variables for summary level data, but would use a formula to retrieve relational, detail level data from Oracle tables when lower-level data is required. In other words, you'd "reach through" to the relational tables as required to get hold of detail level data.
    Just a couple of thoughts. Option 1 is more (from a personal point of view) purely theoretical at the moment, though it should be possible. Option 2 (storing detail level in an AW or Express variable, and retrieving detail level data via SQL "on the fly") is well used in several projects we've worked on.
    hope this helps
    Mark
    p.s. of course at some point in the future, no doubt the Oracle RDBMS will handle this automatically, as this is I suppose one of the key drivers for having ROLAP and MOLAP storage available as options with the OLAP Option.

  • FireFox Select List not working with Spry XML Data set.

    I am having a problem with FireFox.  I have a set of related select lists that allows a user to pick a state and then a market.  The work in all browsers except FireFox.  I'm totally stumped.  Here is the link. Any assistance greatly appreciated!
    http://myxpertise.pointinspace.com/create.php
    Thanks,
    Joe

    <span spry:region="dsCities dsStates dsStates" id="citySelector">
         <select spry:repeatchildren="dsCities" id="citySelect" name="citySelect" tabindex="5" >
          <option spry:if="{ds_RowNumber} == {ds_CurrentRowNumber}" value="{name}" selected="selected" tabindex="5" >{name}</option>
          <option spry:if="{ds_RowNumber} != {ds_CurrentRowNumber}" value="{name}" tabindex="5" >{name}</option>
        </select>
    that should be a spry:detailregion, and you have a double dsStates
    And when you are using multiple datasets inside a region, it might wise to prefix you template tags with the correct dataset
    {ds_RowNumber} => {dsStates::ds_RowNumber}

Maybe you are looking for