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
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
How are you doing the import? Via an Excel import or via one of Sage's APIs?
Via Sage API
Double check your code, you've made a mistake. Make sure you're adding a code that exists.
used the same code for OE module and it works fine. But for POR it does not?
Because you're making a mistake in your code.
Can I attach the code? so you can please view and potentially see the mistake and advise?
That's no help, code also needs data. I suspect you're trying to insert an optional field that's not set up in PO Options.
I Have them setup in PO Options
Fine, then paste your code.
Fine, then paste your code.
Error occurs at line 286
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();
}
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.
RVspy output after line 286 process
That's not enough to diagnose anything. The real problem is farther back in the rvspy log.
Please see attached
Is there a way I can send you the complete log file for your review?
*Community Hub is the new name for Sage City