POR Optional Fields

SUGGESTED

Good day,

I am integrating my data into sage accpac. How ever I get the below error

"

Purchase Order Line

Attempt to change read-only field 'Optional Fields'.

"

My Question is how do I change Optional Fields to be not read only?

Regards

Parents Reply Children
  • 0 in reply to SIPHO MATSEME

    public override void InsertInvoiceDetailSoftCols()
    {
    POPOR1detail1.RecordClear();
    POPOR1detail1.RecordCreate(ViewRecordCreate.NoInsert);
    POPOR1detail1Fields = POPOR1detail1.Fields;
    POPOR1detail1Fields.FieldByName("ITEMNO").SetValue(base.dsDetailSoftCols.Tables[0].Rows[base.counterDSC]["ITEMNO"].ToString(), true); // Item Number
    POPOR1detail1Fields.FieldByName("PROCESSCMD").SetValue("1", false); // Command

    POPOR1detail1.Process();
    POPOR1detail1Fields.FieldByName("ITEMDESC").SetValue(base.dsDetailSoftCols.Tables[0].Rows[base.counterDSC]["ITEMDESC"].ToString(), true); // ITEM DESCRIPTION
    POPOR1detail1Fields.FieldByName("LOCATION").SetValue(base.dsDetailSoftCols.Tables[0].Rows[base.counterDSC]["LOCATION"].ToString(), true); // ITEM LOCATION
    POPOR1detail1Fields.FieldByName("OQORDERED").SetValue(base.dsDetailSoftCols.Tables[0].Rows[base.counterDSC]["OQORDERED"].ToString(), true); // Quantity Ordered
    POPOR1detail1Fields.FieldByName("UNITCOST").SetValue(base.dsDetailSoftCols.Tables[0].Rows[base.counterDSC]["UNITCOST"].ToString(), true); // UNIT COST

    // ===================================
    // ADD HEADER ADDITIONAL FELDS
    // ===================================

    for (int scCol = 0; scCol < dsDetailSoftCols.Tables[1].Columns.Count; scCol++)
    {
    //========================================================
    // Assign each Optional Field Name and Value SEPERATELY
    //========================================================
    POPOR1detail1.RecordClear();
    POPOR1detail6.RecordGenerate(false);
    POPOR1detail6Fields = POPOR1detail6.Fields;
    POPOR1detail6Fields.FieldByName("OPTFIELD").SetValue(base.dsDetailSoftCols.Tables[1].Columns[scCol].ColumnName, true); // OPTIONAL FIELD NAME
    POPOR1detail6Fields.FieldByName("SWSET").SetValue("1", false); // Value Set
    POPOR1detail6Fields.FieldByName("VALIFTEXT").SetValue(base.dsDetailSoftCols.Tables[1].Rows[base.counterDSC][scCol].ToString(), true); // OPTIONAL FIELD VALUE
    // Update each Optional Field Name and Value
    POPOR1detail6.Insert();
    }
    POPOR1detail1.Insert();
    //Todo: Might need dummy line counter
    POPOR1detail1Fields.FieldByName("PORLREV").SetValue(_lineCount.ToString(), false); // Line Number
    _lineCount--;
    POPOR1detail1.Read(false);
    POPOR1detail4Fields.FieldByName("FUNCTION").SetValue("8", false); // Function
    POPOR1detail4.Process();
    }

  • 0 in reply to SIPHO MATSEME

    Must be bad data or invalid Optional Field setup.  Try a single step through your code up to line 286, start RVSPY, process line 286, then see what RVSPY shows.

  • 0 in reply to Jay Converse Acumen

    RVspy output after line 286 process

  • 0 in reply to SIPHO MATSEME

    That's not enough to diagnose anything. The real problem is farther back in the rvspy log.

  • 0 in reply to SIPHO MATSEME

    Is there a way I can send you the complete log file for your review?