When importing Purchase Orders in Asset 6.5, how can I provide uniqueidentifier values for the Line Item ID column mapping?

Article:HOWTO8117  |  Created: 2007-10-03  |  Updated: 2007-10-15  |  Article URL http://www.symantec.com/docs/HOWTO8117
Article Type
How To



Question
When importing Purchase Orders in Asset 6.5, how can I provide uniqueidentifier values for the Line Item ID column mapping?

Answer

There are many different techniques that could be used. Following is one example using the data pre-processing feature in Connector Solution 6.5:

  1. Go to the data source you have already defined for the Purchase Order import.
  2. Enable the Enable import data pre-processing function check box
  3. Click the Edit Function link.
  4. Add the following code to the text box on the Data Pre-Processing Function page.

    //add Line Item ID column to importData as guid type
    importData.Columns.Add("Line Item ID", System.Type.GetType("System.Guid"));

    //generate new guid for each row of data
     foreach (DataRow row in importData.Rows)
     {
         row["Line Item ID"] = System.Guid.NewGuid().ToString();
     }

    //return datatable
    return importData;
  5. Click Apply.
  6. Go to the Import Rule you have already defined for the Purchase Order import.
  7. At the Line Item ID column mapping, select Line Item ID from the Source drop-down list.
  8. Test the Import Rule.


Legacy ID



38572


Article URL http://www.symantec.com/docs/HOWTO8117


Terms of use for this information are found in Legal Notices