Overview
An error will be encountered when a sales document containing improper syntax is opened. Use the Quick Report on the following page to pull all document notes in order to find syntax errors.
Error:
Quick Report:
<report name="Bad Note Finder">
<search name="Batch" column="Sales_Batch" searchOp="like" DefaultValue=""/>
<!-- <search name="Item" column="Item_Number" searchOp="like" />
<search name="Customer" column="Cust Name" searchOp="=" />
<search name="Item" column="Item Descr" searchOp="like" />
-->
<query addWhere="false">
select Notes, * from spv3SalesDocument where CHARINDEX('SalesPad_Notes', cast(notes as varchar(max)))>0
</query>
<contextMenuItem text="-"/>
<contextMenuItem text="Find Note">
<![CDATA[
foreach (System.Data.DataRow dr in dataRow.Table.Rows) { string allNotes = dr["Notes"].ToString();
string preXml =
(allNotes.IndexOf("<SalesPad_Notes>") == -1 ? allNotes :
allNotes.Substring(0, allNotes.IndexOf("<SalesPad_Notes>"))).TrimEnd('\r','\n', ' ');
string postXml = (allNotes.IndexOf("</SalesPad_Notes>")
== -1 ? "" :
allNotes.Substring(allNotes.IndexOf("</SalesPad_Notes>")
+("</SalesPad_Notes>").Length)).TrimEnd('\r', '\n', ' ');
string xml = allNotes.Substring(allNotes.IndexOf("<SalesPad_Notes>")); xml = xml.Substring(0,xml.IndexOf("</SalesPad_Notes>") + ("</SalesPad_Notes>").Length);
try {
System.Xml.XmlDocument xd = new System.Xml.XmlDocument(); xd.LoadXml(xml);
//System.Windows.Forms.MessageBox.Show(dr["Sales_Doc_Num"].ToString()
+"\r\n\r\n" + xml);
}
catch (System.Exception ex)
{
System.Windows.Forms.MessageBox.Show(dr["Sales_Doc_Num"].ToString() +"\r\n\r\n"
+ ex.Message + "\r\n\r\n" + allNotes);
}
}
]]>
</contextMenuItem>
</report>
SalesPad Support
Comments