CRM 4.0 Related Entity IFRAME, Hide Buttons in Toolbar

Posted in CRM 4.0 on February 3, 2010 by mdbeckner

To get a related entity to display in a CRM 4.0 IFRAME, use the following code:

function GetFrameSource(tabSet)
{
    if (crmForm.ObjectId != null)
    {
        var oId = crmForm.ObjectId;
        var oType = crmForm.ObjectTypeCode;
        var security = crmFormSubmit.crmFormSubmitSecurity.value;
        return “areas.aspx?oId=” + oId + “&oType=” + oType + “&security=” + security + “&tabSet=” + tabSet;
    }
    else
    {
        return “about:blank”;
    }
}

crmForm.all.IFRAME_RelatedActivities.src = GetFrameSource(“Opportunity_ActivityPointers”);
crmForm.all.IFRAME_RelatedOpenQuotes.src = GetFrameSource(“opportunity_quotes”);
crmForm.all.IFRAME_RelatedOrders.src = GetFrameSource(“opportunity_sales_orders”);

To remove certain buttons from the toolbar on the related entity (within the IFRAME), use the following:

var iFrame = crmForm.all.IFRAME_RelatedOpenQuotes;
iFrame.attachEvent( “onreadystatechange” , iFrameReady);

function iFrameReady()
{
  if(iFrame.readyState == “complete”)
  {
   //Get all of the List Elements
   var lis = crmForm.all.IFRAME_RelatedOpenQuotes.contentWindow.document.getElementsByTagName(‘li’);

   var i = 0;
   //Loop through the list items
   while (i < lis.length) {

    if (lis[i].getAttribute(‘title’) == ‘Add a new Quote to this record’ || lis[i].getAttribute(‘title’) == ‘Add existing Quote to this record’)
    {
     //Replace the DHTML with blank tags to hide the button
     lis[i].outerHTML=’<SPAN></SPAN>’
    }
    i = i + 1;
   }
  }
}

You can get the titles of the fields using an alert on the innerHTML of the document.body, or by popping it up in the loop.

If you don’t want to loop, and you know the ids of the buttons (which can be accessed using:

crmForm.all.IFRAME_RelatedOpenQuotes.contentWindow.document

.body.innerHTML

Then you can use the following simplified code:

var iFrame = crmForm.all.IFRAME_RelatedOpenQuotes;
iFrame.attachEvent( “onreadystatechange” , iFrameReady);

function iFrameReady()
{
  if(iFrame.readyState != “complete”)
  {return;}

crmForm.all.IFRAME_RelatedOpenQuotes.contentWindow.document.getElementById(“_MBtoplocAssocOneToMany1084opportunityquotes”).outerHTML = ‘<SPAN></SPAN>’;

crmForm.all.IFRAME_RelatedOpenQuotes.contentWindow.document.getElementById(“_MBlocAddRelatedToNonForm10843GUID”).outerHTML = ‘<SPAN></SPAN>’;
}

 

 

Real Time Visibility with RFID

Posted in RFID on May 18, 2009 by mdbeckner

This conversation was filmed during TechEd 2009 and includes Anush Kumar of S3Edge (s3edge.com).  We talk through the application of BizTalk RFID to enable business real time visibility into their RFID infrastructures.

This movie requires Adobe Flash for playback.

Achieving Success with BizTalk Server

Posted in BizTalk General on May 18, 2009 by mdbeckner

The following video was delivered as a Breakout Session during TechEd 2009 (SOA301).  It is geared toward those who are looking at implementing a BizTalk solution and want to understand what is involved in the management and preparation of the solution.

This movie requires Adobe Flash for playback.

Valuable BizTalk Mapping Book

Posted in BizTalk General, EDI on April 16, 2009 by mdbeckner

There is an extremely good book on BizTalk mapping that has been recently released. Great value to any developer. Includes excellent EDI samples.

Pro Mapping in BizTalk Server 2009

http://www.amazon.com/Mapping-BizTalk-Server-Experts-Voice/dp/1430218576/ref=sr_1_4?ie=UTF8&s=books&qid=1239909911&sr=8-4

Recurring EDI Error

Posted in EDI on March 26, 2009 by mdbeckner

The following error is extremely common in EDI deployments:

6: Missing or invalid or duplicate Transaction set identifier ‘http://schemas.microsoft.com/BizTalk/EDI/X12/2006#X12_00401_850′

It generally means one of two things:

1. The EDI schema is not deployed properly (or is partially deployed).

2. The schema has been deployed more than once and two (or more) versions of it appear in the GAC.

Pro RFID in BizTalk Server 2009

Posted in BizTalk General, RFID on February 26, 2009 by mdbeckner

The book, “Pro RFID in BizTalk Server 2009“, is now available.

http://www.amazon.com/Pro-RFID-BizTalk-Server-2009/dp/1430218371

Co-authors include:

Venkatesh Ram (http://s3edge.com/about_management_team.php)

Mark Simms (http://blogs.msdn.com/masimms/)

TechEd 2009: Los Angeles

Posted in BizTalk General, Miscellaneous on February 17, 2009 by mdbeckner

I have been invited to present on several topics at Microsoft TechEd 2009, May 11th-15th.  The topics include:

  • Achieving Success with Integration in the Enterprise Using Microsoft BizTalk Server 2009
  • Integrating with Partners – Learn to Develop with EDI/AS2 in BizTalk Server 2009

Using Inline XSLT to Create Target Nodes

Posted in EDI on October 31, 2008 by mdbeckner

Creating nodes using Inline XSLT often eliminates much of the complexity around mapping.  To demonstrate how to use XSLT, this post will illustrate an XSLT script that created three N1 target records using two “dynamic” input records and one “static” record.

The input has two out of the three records, the third record is hard coded into the XSLT.

The Map looks as follows:

The Map

The Map

As can be seen, the source XML has a node called “TradingPartners” that contains the two dynamic records.  The XSLT script will loop through all of the incoming TradingPartner nodes and create N1 elements based on those.  Once all of the TradingPartner nodes have been looped through, the XSLT will create one final element based on static values.  The XSLT script is shown here:
<xsl:for-each select=”//*[local-name()='TradingPartner']“>
<xsl:element name=”ns0:N1″>
<xsl:element name=”N101″><xsl:value-of select=”*[local-name()='IDCode']“/></xsl:element>
<xsl:element name=”N102″><xsl:value-of select=”*[local-name()='TPKnownAs']“/></xsl:element>
<xsl:element name=”N103″>9</xsl:element>
<xsl:element name=”N104″><xsl:value-of select=”*[local-name()='TPDUNS']“/></xsl:element>
</xsl:element>
</xsl:for-each>
<xsl:element name=”ns0:N1″>
<xsl:element name=”N101″>SF</xsl:element>
<xsl:element name=”N102″>STATIC TRADING PARTNER NAME, INC.</xsl:element>
<xsl:element name=”N103″>9</xsl:element>
<xsl:element name=”N104″>012345697654</xsl:element>
</xsl:element>

* Note that the value-of XSL is looking for “local-name()”.  This enables source documents with namespace prefixes (such as ns0) in them to be mapped.  In this case, the source is <ns0:TradingPartner>. 

Mapping Hierarchical (Structured) XML to Flat XML

Posted in EDI on October 31, 2008 by mdbeckner
To illustrate how to map a hierarchical EDI structure to a target flat structure, I’ll work with the DTM field in an 867.  Assume the following rules:
1. If the DTM01 node = 003, map DTM02 to one node in target schema.
2. If the DTM01 node = 004, map DTM02 to a different node in target schema.
By default, I know that I need to place two “Equals” functoids and two “Value Mapping” functoids to get the values across, as shown here:
Incorrect Mapping (checks only the first occurance of DTM)

Incorrect Mapping (checks only the first occurance of DTM)

With the incorrect output (shown here) showing only one of the targeted nodes.  This is because the map is not looping through all of the source DTM nodes.
Output of Incorrect Mapping

Output of Incorrect Mapping

Knowing that there always two or more DTM nodes in the source, the map will need to be forced to loop through all occurances.  This can be done by adding a “Loop” functoid, with the input being the root DTM node, and the output being both of the desired output nodes.  This map looks as follows:
Correct Mapping (with Loop Functoid)

Correct Mapping (with Loop Functoid)

This will cause the map to loop through all occurances of the source.  Only those occurances which match the “Equals” logic will be mapped across.  The correct output is shown here:
Result

Result

BizTalk RFID

Posted in BizTalk General, RFID on September 30, 2008 by mdbeckner

I’ve got a new book coming out in March 2009 on BizTalk RFID.  An early link to the book as at http://www.amazon.com/Pro-RFID-BizTalk-Server-2006/dp/1430218371/ref=sr_1_3?ie=UTF8&s=books&qid=1222812317&sr=1-3

I am co-authoring this book with Mark Simms and Venkatesh Ram, both incredible experts in RFID technology and its application.

The final book title will be Pro RFID in BizTalk Server 2009.