Keorapetsi Matseme

Keorapetsi Matseme

  • 1.4k
  • 305
  • 2.4k

Get fieldByName Sage300 accpac session

Mar 25 2021 7:27 PM
I want to integrate data from my sql DB to Sage 300 accpac
 
When getting PORCP1headerFields.FieldByName("RCPHSEQ")
 
returns Null object exception error
 
What I have tried:
  1. public override void InsertInvoiceHeader()  
  2. {  
  3.     PORCP1header.Order = 1;  
  4.     PORCP1header.Order = 0;  
  5.     PORCP1headerFields.FieldByName("RCPHSEQ").SetValue("0"false);   
  6.     // Receipt Sequence Key  
  7.     PORCP1header.Init();  
  8.     PORCP1header.Order = 1;  
  9.     PORCP1detail1.RecordClear();  
  10.     PORCP1detail3.RecordClear();  
  11.     PORCP1detail4.RecordClear();  
  12.     PORCP1detail6.Init();  
  13.     PORCP1detail2.Init();  
  14.     sRcpSeq = PORCP1headerFields.FieldByName("RCPHSEQ").Value.ToString();  
  15. PORCP1headerFields.FieldByName("RCPNUMBER").SetValue(base.dsHeaders.Tables[0].Rows[base.counterIH]["RCPNUMBER"].ToString(), true); // RECEIPT NUMBER  
  16. }