While researching for my last post, Thinking outside the box (or not): How to create “Global C# function” to be reused inside a map?, in the BizTalk360 blog, I encountered several errors while playing around with maps in order to find an approach that would allow me to create the concept of Global Function. And some of these errors were:
“Inline Script Error: must declare a body because it is not marked abstract, extern, or partial”
“Inline Script Error: ; expected”
or
“Inline Script Error: Type ‘BizTalkMapper.FunctoidInlineScripts’ already defines a member called ‘FunctionName’ with the same parameter types”
📝 One-Minute Brief
This post explains how to fix a BizTalk Mapper inline C# scripting error that occurs when reusing scripting functoids incorrectly, clarifying where and how function bodies must be declared across mapper grid pages.
Causes
The cause of this problem is that you do not correctly declare the body of the Inline C# Function.
Or, if you are trying to reuse an existing Inline C# Function, you are doing it properly.
To reuse Inline C# Functions, these are the rules that you need to follow:
- If all of the Scripting Functoids are in the same grid page: In the first Scripting Functoid, linked from the source to the destination, we will have to specify the body function, and in the following Scripting Functoids, we only need the function declaration (nobody).
- If the Scripting Functoids are in different grid pages: The Scripting Functoid that specifies the body function needs to be on the leftmost grid page, and the remaining Scripting Functoids (with the function body declared) on the other grid pages to the right. In other words, counting the grid pages from left to right, if the Scripting Functoid that specifies the body function is on the second grid page, the remaining functoids with the function body declared cannot be placed on the first grid page; they can only be placed on the second grid page (including the second).
Solution
The solution to solve this issue you have two options, you need to follow the rules described above (BizTalk Mapper tips and tricks: How to reuse Scripting Functoids with Inline C# inside the same map) or you need to implement the concept of global C# Function described in my post: Thinking outside the box (or not): How to create “Global C# function” to be reused inside a map?, in resume:
- Add a Grid page to your map and rename it to GlobalFunctions.
- Set this grid as the first grid page of your map (important step).
- Drag-and-Drop a Scripting Functoid to the GlobalFunctions grid page and place the C# code.
- Do not link any inputs and don’t map (link) this Scripting Functoids to any element in the destination Schema.
- Double-click the earlier Scripting Functoids added to the GlobalFunctions grid page and set the expected input values as empty constant values, which by default don’t exist.
- Now you can use these functions in other grid pages using only the function declaration.
Download
THIS SAMPLE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND.
You can download BizTalk Mapper Tips and Tricks: How to create a Global Inline C# Function from GitHub here:
For those looking to move beyond the basics of message transformation, I highly recommend checking out my eBook, BizTalk Mapping Patterns & Best Practices, published in partnership with BizTalk360.
This resource is a deep dive into the real-world challenges of data transformation. It covers:
- Mapping Patterns: From simple field-to-field links to complex structural shifts.
- Performance Optimization: How to build maps that don’t slow down your environment.
- XSLT vs. Functoids: Knowing exactly when to use built-in tools and when to write custom code.
Whether you are maintaining a legacy BizTalk 2010 environment or planning a migration, these patterns are the foundation of clean, maintainable integration.
Download the full eBook here: BizTalk Mapping Patterns & Best Practices
Hope you find this helpful! If you liked the content or found it useful and would like to support me in writing more, consider buying (or helping to buy) a Star Wars Lego set for my son.