A friend asked a few questions about the Xref functiods that I thought everyone (including myself) could benefit from

  1. Can we have many [sic] application using Cross-referencing functoid and pointing to the same database? Yes, this is the beauty of the Xref functionality, you can create multiple Application Types, and application type would be for inbound purchase orders for example, and you can have another application type for outbound invoices for example. Even to a greater extent, you can have application instances for each application type, so you can have a partner specific application instance of the inbound purchase order, and a partner specific application instance for outbound invoices. The ListOfAppType.xml would look like this:
    <?xml version="1.0" encoding="utf-8"?> <listOfAppType> <appType> <name>Inbound Purchase Order</name> </appType> <appType> <name>Outbound Invoice</name> </appType> </listOfAppType>

    And here is the example of how the ListofAppInstance.xml would look:

    <?xml version="1.0" encoding="utf-8"?> <listOfAppInstance> <appInstance> <instance>Partner 1</instance> <type>Inbound Purchase Order</type> </appInstance> <appInstance> <instance>Partner 2</instance> <type>Inbound Purchase Order</type> </appInstance> <appInstance> <instance>Partner 1</instance> <type>Outbound Invoice</type> </appInstance> <appInstance> <instance>Partner 2</instance> <type>Outbound Invoice</type> </appInstance> </listOfAppInstance>

    Here is what it looks like within the tool

  2. When is purge data script useful? There is a stored procedure that is called xref_Cleanup, this is a stored procedure that brings back the various tables to factory settings. Only use this when you want to clear out everything. There is currently no stored procedure nor out of the box way to clear out portions of the data. I actually opened a ticket because I could not load data after I truncated all of the data in the various tables because I could no longer import data into the tables anymore. Truncating the tables is not the way to clear out the tables, you need to run this stored procedure. For your information, here is the stored procedure to see what it does:

    CREATE PROC [dbo].[xref_Cleanup] AS TRUNCATE TABLE [dbo].[xref_AppInstance] TRUNCATE TABLE [dbo].[xref_AppType] TRUNCATE TABLE [dbo].[xref_IDXRef] INSERT INTO [dbo].[xref_IDXRef] (idXRef) VALUES (N'') TRUNCATE TABLE [dbo].[xref_IDXRefData] TRUNCATE TABLE [dbo].[xref_MessageArgument] TRUNCATE TABLE [dbo].[xref_MessageDef] TRUNCATE TABLE [dbo].[xref_MessageText] TRUNCATE TABLE [dbo].[xref_ValueXRef] INSERT INTO [xref_ValueXRef] (valueXRefName) VALUES (N'') TRUNCATE TABLE [dbo].[xref_ValueXRefData]