How does CRM 2011 auto-wire the StringMapBase table in for Option List picks in Advanced Finds? - dynamics-crm-2011

The StringMapBase SQL table is the table that holds Option List values that have been added to an entity. When using an Advanced Find in CRM 2011, if you select a pick list column (Option List) value from an entity to be added to the resultset, the Advanced Find mechanism somehow auto-wires in the string value of the pick list from the StringMapBase table instead of showing the StringMapBase's Primary Key value that's actually stored on the record.
I'm in the process of creating SSRS reports that hinge on some Option List values:
// SQL psuedocode
Select...
...
Where Value = 'Some String Value of Interest'
However, I very much dislike the fact that, so far, it looks like I basically have to write in some ad-hoc SQL in order to get the applicable StringMapBase value. In order to do so, I have to hard-code some magic values, which I despise.
Does anyone know by what mechanism the CRM Advanced Find engine auto-wires these values in? Or does it simply do its own join to the StringMap system view or use a SPROC somewhere?

When you use the Filtered views (the only supported way to read data in your report) there will be an additional "logical" column for Bit, Picklist, and Lookup columns. For an attribute named "new_option" you should be able to add "name" to the end of the column name and query "new_optionname".
select new_option, -- Integer
new_optionname -- StringMap joins generated by Filtered Views
from Filterednew_test

Related

How do I use a power apps form for a lookup column?

I have a SharePoint List (say "List-A") with plenty of columns, some of which are lookup columns.
These are just used to construct a choice columns, where the items in the choice drop down are the items of a column in a different List ("List-B").
I have used the function on SharePoint to integrate List-A with Power Apps Form. This creates a Power Apps form that is readily available.
For the Lookup choice columns, I have added List-B as the data source, and am using the items from the correct column as items in the choice that is linked to the lookup column. This correctly populates the drop down menu as expected.
Now when I publish this form and fill it from sharepoint (it pops up as it should hafter clicking New in the List view) I can fill the entire form and submit with no issue. However all the lookup columns remain blank, as if the form returned a null value instead of the selected.
I have both datasources set up:
The update property of the datacard connecting to the SharePoint List is equal to the Selected of the datacard containing the combobox (combobox is called DataCardValue43).
The items property of the combobox is equal to the correct column of List-B.
As an alternative solution, I have attempted to make a different column that is just one line of text. For this column, I have made a combobox once again setting the items property to the column in List-B. The intention was to return the selected value as a string. It was attempted thus:
where combobox1 once again manages to give the correct options in the drop down box but returns only Null.
To study it further, I have made a power apps flow that takes Create New Sharepoint List object as input. Here I see that the values are indeed Null
The one called "Return" is the text column that I made, and the other being the lookup column. I do notice that the Lookup column isn't called Value, but id. I don't know what to do with that information though.
I really just want to have a column in my power apps form that lets you choose and the choices are values from a column in a different List. What do I do, and why doesn't what I've already done work?
Thank you.
Please follow the steps below to solve the issue.
1: Add a Lookup column in SharePoint List.
2: Open that list in Power Apps by using the Customise Forms Option From SharePoint.
3: The Item property of Lookup field will be by default as follow:
Choices([#'CustomisingSharePointList'].LookupColumnListName)
4: There is no need to change/delete the lookup field with any custom dropdown or combo box. This is the point, where you are doing mistake by adding a custom combobox and replacing the original Lookup dropdown. If you want to change datasource, apply filter or sort the data, you can do all these thing to the same original lookup column.
e.g I have applied filter and sort functions to the existing data:
Sort(Filter(Choices([#'CustomisingSharePointList'].'LookupColumnListName'), Value in Filter(LookupColumnListDataSoure,Progress.Value = "Open").ID),Id)
5: When you will publish the list, it will work fine.
Note:
CustomisingSharePointList: List in which we have added a lookup column.
LookupColumnListName: List to which the lookup column actually belongs to.
LookupColumnListDataSoure: You need to add the original list as data source in power apps to use the above filter. This step is optional and applicable only if you apply filter like I did in step 4

Table with variable number of rows in MS Office mail merge [duplicate]

I'm creating a compliance mailing for my organization, the mailing will include merge fields that identify the office location, physician, and SiteId. The mailing will also include a table of information that is dependent upon the particular SiteId.
I'd like to use the import table function of MS word and set up a query that references a merged field (SiteId) so that the inserted tables populate the appropriate data for the particular site. I'm unable to do this.
How can I set up this document so that I can import only records from my source (an ms access query) that match the SiteId merge field?
Word's mail merge does not support one-to-many relationships. There are ways to coerce it, but only one of them can yield a table as a result and over the years it has become less and less reliable as Microsoft has not regarded it as important enough to maintain...
What you need to do is set up a query that provides ONLY the information you want displayed in the table, plus the key (SiteId). It's best to sort it so that all the SiteId entries list together, and are in the order the data will come through in the mail merge data source.
On the Insert tab go to Text/Quick Parts/Insert Field and select the Database field from the list in the dialog box. Click "Insert Database" and follow the instructions in the dialog box to link in the data. Be sure to set the Query Options to filter on the first SiteId from the data source. When you "Insert Data" make sure to choose the option to "Insert as a field".
This inserts a DATABASE field in the document which you can see by toggling field codes (Alt+F9). The field code can be edited and what you need to do is substitute the literal SiteId value you entered for the query with its corresponding MergeField.
When you execute the merge to a new document that should generate a table for each data record corresponding to the SiteId for the record. But, as I said, Microsoft hasn't done a great job of maintaining this, so it may require quite a bit of tweaking and experimenting.
If the results are not satisfactory then you should give up the idea of mail merge and use automation code to generate and populate the documents.
You can find more (albeit somewhat out-dated) information on this topic at http://homepage.swissonline.ch/cindymeister/mergfaq1.htm

How do you view the table structure for the relational data used in XPages JDBC?

The XPages JDBC application uses the derby1 connection and the examples show being able to sort the columns in ascending/descending order. The design elements show the column headings with sortable="true" which is what I have in my app, but my columns won't sort. You can see a table structure using the Table Meta Data listing, but that doesn't say if the data element is indexed. Our DBA says that the index doesn't allow/disallow sorting and that I have to use the order by.
So, how is sorting being accomplished in this application when there is no event tied to the columnheader?
Your dba is right, you can order by a unindexed column (use ORDER BY YourColumnName in your SQL statement). Both datasources (JdbcRowSet and JdbcQuery) allow you to specify sqlQuery parameter, which can contain this clause. Unfortunately you cannot use sqlParameters properties for sorting (this is probably because java.sql.PreparedStatement does not allow you specify an ORDER BY parameter).
On SSJS side, you can use #JdbcDbColumn() function, which allows orderBy as fifth parameter, or use your own SQL statement with #JdbcExecuteQuery.

COGNOS report for a simple sub query and join Query

Here is my query. I am new to Cognos and using Cognos 10. And I am having a bit difficulty in developing a report which uses a Sub Query and an Inner Join Query.
1.
SELECT ID, BATCH_DT, LOCIT FROM AOI.TEMP_BRICK
WHERE BATCH_DT < (SELECT MAX(DATE) FROM CALENDAR)
2.
SELECT A.ID, B.SAL FROM TABLE as A LEFT OUTER JOIN TABLE as B
WHERE A.ID=B.ID
First, you must understand that Cognos generates its own SQL. In order for it to do that, you must define relationships between tables in Cognos Framework Manager. Once that is done your report has 3 major parts, The Report Page(s), the Prompt Page(s) and the Query(s).
a.) Setup the CALENDAR and AOI.TEMP_BRICK tables in Cognos. You may want to define a relationship between TEMP_BRICK.BATCH_DT and CALENDAR.DATE (assuming your calendar has date records for every date that may be present in TEMP_BRICK).
b.) Next you would create a new List Report. You would grab your ID, BATCH_DT and DATE fields into the list. (Date would come from the calendar if you decided to link the two tables in step A, otherwise you use the BATCH_DT field in TEMP_BRICK.)
c.) You would open the Query pages and see that Cognos has already created one query, called Query1. You need to create a new query (we will call it qryMaxDate). That query would have one element, 'DATE' from CALENDAR. On the properties of the 'DATE' field in Data Items, you would chagne the 'Agregate Function' from None to 'Maximum'.
d.) Now edit your Query1, add a Filter on the Date from that query. In the Expression Definition, select the Queries tab and drag the 'DATE' field from your qryMaxDate. Should look something like this [Batch Date] = [qryMaxDate].[Date]
e.) You are done! Run the report. in this case, the user running the report is giving no input, so no Prompt page is necessary.
a.) Setup Table A and B in the Framework Manager. You need to define a relationship between Table A and B in Framework Manager via a Star Schema (define A.ID = B.ID and specify 1 to n, or n to 1).
b.) Create a new report and simply drag in elements from table a and table b. Their relationship is already defined in Framework manager, so there is no need to re-define it while writing reports.
Your second example is a great demonstration of the power of BI programs like Cognos. Report Authors dont need to fully understand the ways that two tables are joined... they simply pull out elements from each table and they work, as the relationships are already defined in the Framework.

SharePoint 2007: Custom Lookup columns

I would create two separate lists, and have the data entered in list 1 populate some of the data columns in table 2. Example: Request Name (single line of text), Description (Multi lines of text), Type of Request (Choice), and Completion Date (date).
When I go to the second list, I select 'Lookup', then 'Get information from:', select the first list, and all I see are "ID", "Content Type", "Version" and the "Title".
What do I need to do to get the columns from list 1 to appear in the 'Lookup' section of table 2?
The lookup field will only use text columns (regular text, calculated field with output type of text and computed columns that output text). You could probably fill out the additional fields by the means of a simple SharePoint Designer workflow that will run on item creation in the second list and fill out the columns.
I have been able to do this by creating a Feature with a custom List Definition using the FieldRef, JoinColName, JoinRowOrdinal, and JoinType attributes.
For more information, see SharePoint 2010: Set field value from query triggered by choice box selection.
I think programming will be needed you will have to use something like smartpart and create your own asp.net control that will read from database and show the data as you need it

Resources