Accessing distinguished fileds in assign shape (Biztalk) - biztalk

I am constructing a multipart message in construct shape. That message has a body part with distinguished field, which i want to assign in assignment shape:
As you can see, intellisense is suggesting me to select a node with my distinguished field. But when i select it, i get an error!
I've faced this before, and restarting VS always helped. But not this time :(

Message is a reserved word in XLang. Can you change the name of the element/attribute that backs this distinguished field to something else? If that does not work, you could always XPath to the element to read it and use it. Last if those two don't work, you could make this a promoted property where you are able to specify the name yourself.
Here is the list of reserved words.
http://msdn.microsoft.com/en-us/library/aa547020.aspx

Related

Display label based on, field on one data-source (singular) being within another data-source fields many

I am still learning, and looking for help on how to display a label based on one data-sources field value, being within another data-sources field value list.
I have one calculated table, displaying rows of documents within a folder, and wish to use a field representing the document number in that data-source, so that if it's ANYWHERE within another tables field it displays my label.
I've been trying to use projection as I think this is how to achieve it.
I can get it working based on both the current #datasouce.item.fieldnames but need it to base the calculation on all possible numbers in that tables field (Image below should make it easier to understand).
I expect that it has something to do with projections, but can't find anything within the learning templates or anywhere else to resolve the issue.
I think the following should work for you. For the 'Reserved' label have the following binding for the text property:
(#datasources.project_quotes.items..quotenumber).indexOf(#widget.datasource.item.Qnumber) !== -1 ? 'Reserved' : ''
I would suggest alternatively just to include a field in your calculated datasource and making the determination in your server script.

BizTalk routing messages in message box based on field value

I have an exercise I'm working to complete; previously it was de-batching multiple XML messages from one file into individual files. Then I had to route individual files based on a field value which had been promoted using filters on a port. Now the exercise has evolved into taking a multi record XML file, breaking it down to individual XML records, and routing their output to different folders based on a value in one of the fields. The hurdles are as follow:
I can't promote a repeating field such as the one I have to use to sort the outbound messages
The value of the field is a system.int32; I am sorting on a "equal to or more than 900" and "less than 900" so I need the int type.
Beyond simple "idNUm >= 900" I am in over my head with the necessary expression(s).
I have the basic orchestration design down, I am just lacking the expressions. The node I am looking to validate against is IDNum, and occurs in each record.
UPDATE: Still not working
I put in the following in my expression: IDNumDefined.Customer.IDNum >= 900
and I get "identifier Customer does not exist in "IDNumDefined"; are you missing an assembly reference?" and "unexpected token '>=' "
Ideas? (sorry about not updating question here)
The debatching has to occur using an Envelope and Body schema.
Once you have this figured out, the debatching can occur using a simple XML disassembler. In the body schema you can quick promote your idNum field by associating a PropertySchema with it.
Once this is taken care of, it is easy to use 2 send ports in order to set your filter subscription(s).

Is there a way to add more text to a range value?

I'm trying to extend a query in Dynamics AX that populates the "My Projects" window. I've found the query that I need to modify, and tried to modify it, unfortunately, the character limit in the Value field (see screen shot), is not sufficient to allow me to enter all of the text I need to extend this query.
I've explored adding additional ranges, but I need to add additional OR arguments here and it appears that adding additional ranges will AND the range instead of ORing it.
Is there any way to bypass this character limit?
If you add several ranges to the same datasource field, the ranges are combined with OR in the SQL.
This is useful sometimes. See this queustion for a (klunky) example.

AX 2009: Report Range on enums parsing enum value commas?

I think I may have found an interesting bug with AX 2009, and I'm unsure of how I can proceed.
I am attempting to write a new report, and one of the conditions of this report is to be filtered based on the Posting field of the LedgerTrans table. However, it seems that when the report goes to execute, the label of the enum Purchase, receipt is parsed without regard to the quotes. This normally wouldn't be a problem, but the enum label in this case contains a comma. The result is that when run the query dialog box reads: Purchase, consumption, __ILLEGAL_VALUE__. I get this result even if I use the enum value or name. The report must be left interactive, but this field must be locked, so we cannot get the users to adjust the query at run time.
At this point I don't want to change the label itself, but if it is the only way to solve this I will. Has anyone else run into this, or know how we could overcome it?
I've run into this before. Sometimes an acceptable option is hard-coding the conditional values as an OR statement, rather than the comma separated list:
((LedgerTrans.Posting == LedgerPostingType::PurchReceipt) || (LedgerTrans.Posting == LedgerPostingType::PurchConsump))
That can be typed into a range filter box, or can be set as the value of a range via x++ code:
ledgerPostingRange.value("((LedgerTrans.Posting == LedgerPostingType::PurchReceipt) ||
(LedgerTrans.Posting == LedgerPostingType::PurchConsump))");
AX doesn't try to convert these to the labels, so they stay as distinct values, instead of being rendered as labels. Note that parentheses are required for it to be parsed properly.
Since the ILLEGAL_VALUE can appear even when attempting to use a single value that contains a comma in its label, the same can be done for a single :
ledgerPostingRange.value("(LedgerTrans.Posting == LedgerPostingType::PurchReceipt)");
I would definitely change the label! But as a workaround you could use the enum value's number instead.
If the field is often queried, you could put the field in a dialog then change the query:
ledgerPostingRange.value(ledgerPostingType ? int2str(ledgerPostingType) : '');

How to set a default value to an destination schema element in BizTalk Map

I have a requirement in BizTalk map, where
I will map some elements from source schema to destination schema,where the values will be assigned to destination schema elements based on some condition.
If those values are not assigned, i need to send some default value (N/A).
My map is not One-to-One so that i can use a scripting functoid and send a default value, on top of that the destination schema is a flat file and in source schema i have to loop a lot.
So can any body give me some suggestion about "How to set a Default value to a Element in Destination schema if nothing is mapped" using BizTalk Map/some setting in schema.
What I have already tried is, I Opened the destination schema for all the elements I have set the value 'N/A' to a property -> "DefaultValue" which was there in the property tab but when nothing is mapped the default value is not coming. Instead the node itself is not created in the Output file.
Please see the Map below for a good understanding
alt text http://www.biztalkgurus.com/cfs-filesystemfile.ashx/__key/CommunityServer.Discussions.Components.Files/13/0131.problem.JPG
Source Schema is a XML schema.
Destination Schema is a Flat file schema.
Now in the above map, in my source schema I am having a node called F4706 which will loop.
When the element "TypeAddressNumber" within the F4706 is "1", then I am mapping the remaining fields of that F4706 instance to "ship to" details in my destination schema
When the element "TypeAddressNumber" within the F4706 is "2",then I am mapping the remaining fields of that F4706 instance to "Reseller" details in my destination schema
When the element "TypeAddressNumber" within the F4706 is "3",then I am mapping the remaining fields of that F4706 instance to "EndUser" details in my destination schema
Now if I connect a Logical NOT functoid to the Logical Equal functoid and assign some default value, then the my destination node occurs Three times as one time the "=" functiod returns true one time and false other two times. But what I want is, if anything is there to map then map from "F4706" instance or assign the default value.
Find the INPUT File below
alt text http://www.biztalkgurus.com/cfs-filesystemfile.ashx/__key/CommunityServer.Discussions.Components.Files/13/5430.ip.JPG
The output I'm expecting and getting is :
alt text http://www.biztalkgurus.com/cfs-filesystemfile.ashx/__key/CommunityServer.Discussions.Components.Files/13/0724.curOP.JPG
Now if the Input file is like below :
alt text http://www.biztalkgurus.com/cfs-filesystemfile.ashx/__key/CommunityServer.Discussions.Components.Files/13/6403.otherIP.JPG
That is when I don't have a "F4706" node with TypeAddressNumber=2, I need to fill "N/A" in Reseller related nodes in my destination schema, which should look like below :
alt text http://www.biztalkgurus.com/cfs-filesystemfile.ashx/__key/CommunityServer.Discussions.Components.Files/13/0435.nextOP.JPG
If you go and check the XLST which is getting generated, it is writing a xsl:foreach so if you use xsl:choose/otherwise conditions gets checked multiple times and my output nodes gets duplicated.
I also tried to use some global variable in XLST in First Loop and and second loop to access that and write the default value, unfortunately it doesn't work too. Because a VARIABLE in XLST is not a TRUE variable. I think its a CONSTANT.
How to accomplish this ANY help is highly appreciated.
Put two "Value mapping" (Label them "Incoming" and "Default") on the map and drag the output from both to your destination (you will get a warning at compile time).
Put a "Logical NOT" on the map (Label it "NoValue").
Put a logical evaluation (Existence, IsNil, Length) that suits your need, to evaluate if you have an incoming value, and drag your source field to it. (Label it "HasValue")
Drag the result to the "Incoming" and the "Logical NOT".
Drag your source field to the "Incoming".
Drag the output from "NoValue" to "Default".
Add a constant parameter to "Default", by double clicking and insert new parameter, that is your default value.
Hope you understand this mess :)
I believe you are essentially trying to control the creation of an output node based on some condition.
I have tried this for records (you are trying to do this for elements, so I believe this should work for that as well).
I had connected the output of the Logical functoid to the record and the record was created only if the logical functoid returned true.
For default values, you are doing it the right way by putting the default value in the property grid for Schema element. So if nothing is mapped to this element, you will see in the xsl file that the element with the default value is generated.

Resources