Wednesday, 2 December 2015

Exception -The ' ' character, hexadecimal value 0x20, cannot be included in a name

private void XMLChilddata(DmsTableFieldMapping _mapping,common _recordChild)
{
    str                     strValue;
    XmlAttribute            labelAttribute;
    //InventJournalTable      InventJournalTableloc;
    InventJournalTrans      InventJournalTrans;
    //SysDictField            dict;

    if(_recordChild.TableId == InventJournalTable.TableId)
    {
        while select ItemID
            from InventJournalTrans
                where InventJournalTrans.JournalId == InventJournalTable.JournalId
        {

            childNode = doc.createElement(fieldId2name(tableName2Id("InventJournalTrans"),6));//InventJournalTrans,ItemId));
            labelAttribute = doc.createAttribute("Item  ID");//error here because there is blankspace 
            labelAttribute.value(InventJournalTrans.ItemId);
            childNode.attributes().setNamedItem(labelAttribute);
            strValue  = strFmt("%1",(_recordChild.(fieldnum(InventJournalTrans,ItemID))));
            childNode.innerText(strValue);
            parentNode.appendChild(childNode);
        }
    }

so it should be

private void XMLChilddata(DmsTableFieldMapping _mapping,common _recordChild)
{
    str                     strValue;
    XmlAttribute            labelAttribute;
    //InventJournalTable      InventJournalTableloc;
    InventJournalTrans      InventJournalTrans;
    //SysDictField            dict;

    if(_recordChild.TableId == InventJournalTable.TableId)
    {
        while select ItemID
            from InventJournalTrans
                where InventJournalTrans.JournalId == InventJournalTable.JournalId
        {

            childNode = doc.createElement(fieldId2name(tableName2Id("InventJournalTrans"),6));//InventJournalTrans,ItemId));
            labelAttribute = doc.createAttribute("Item ID");//so no error now
            labelAttribute.value(InventJournalTrans.ItemId);
            childNode.attributes().setNamedItem(labelAttribute);
            strValue  = strFmt("%1",(_recordChild.(fieldnum(InventJournalTrans,ItemID))));
            childNode.innerText(strValue);
            parentNode.appendChild(childNode);
        }
    }

No comments:

Post a Comment

intercompany PO multiple product receipt by x++

public void processStampICPO(PackingSlipId _deliveryNote,                             Transdate _deliverydate,                             ...