I am trying to receive a PO through the xapi.
The reciept does get created, but none of the detail lines are there.
My code is Delphi, and we have wrappers to encapsulate views so some of this may look strange:
The reciept does get created, but none of the detail lines are there.
My code is Delphi, and we have wrappers to encapsulate views so some of this may look strange:
Code:
m_rcptHeaderView := m_Session.OpenView('PO0700', 'PO');
m_rcptHeader := Trcptheader.Create(m_rcptHeaderView);
m_rcptDetailView := m_Session.OpenView('PO0710', 'PO');
m_rcptDetail := Trcptdetail.Create(m_rcptDetailView);
RcptCmntView := m_Session.OpenView('PO0695', 'PO');
RcptVndView := m_Session.OpenView('PO0718', 'PO');
AddCostView := m_Session.OpenView('PO0714', 'PO');
RcptFuncView := m_Session.OpenView('PO0699', 'PO');
RcptPoView := m_Session.OpenView('PO0705', 'PO');
RcptOptFldView := m_Session.OpenView('PO0703', 'PO');
RcptCostDistrView := m_Session.OpenView('PO0696', 'PO');
RcptDtlOptFlds := m_Session.OpenView('PO0717', 'PO');
RcptVndOptFldView := m_Session.OpenView('PO0721', 'PO');
RcptAddCostOptFld := m_Session.OpenView('PO0719', 'PO');
SetLength(ViewArray, 8);
ViewArray[0] := RcptCmntView;
ViewArray[1] := m_rcptDetailView;
ViewArray[2] := RcptVndView;
ViewArray[3] := AddCostView;
ViewArray[4] := RcptFuncView;
ViewArray[5] := RcptPoView;
ViewArray[6] := RcptOptFldView;
ViewArray[7] := RcptCostDistrView;
m_rcptHeaderView.Compose(ViewArray);
SetLength(ViewArray, 6);
ViewArray[0] := m_rcptHeaderView;
ViewArray[1] := RcptCmntView;
ViewArray[2] := RcptFuncView;
ViewArray[3] := nil;
ViewArray[4] := nil;
ViewArray[5] := RcptDtlOptFlds;
m_rcptDetailView.Compose(ViewArray);
SetLength(ViewArray, 2);
ViewArray[0] := m_rcptHeaderView;
ViewArray[1] := m_rcptDetailView;
RcptCmntView.Compose(viewArray);
SetLength(ViewArray, 4);
ViewArray[0] := m_rcptHeaderView;
ViewArray[1] := AddCostView;
ViewArray[2] := RcptFuncView;
ViewArray[3] := RcptVndOptFldView;
RcptVndView.Compose(ViewArray);
SetLength(ViewArray, 7);
ViewArray[0] := RcptVndView;
ViewArray[1] := RcptFuncView;
ViewArray[2] := m_rcptHeaderView;
ViewArray[3] := nil;
ViewArray[4] := nil;
ViewArray[3] := RcptAddCostOptFld;
ViewArray[4] := RcptCostDistrView;
AddCostView.Compose(ViewArray);
SetLength(ViewArray, 7);
ViewArray[0] := m_rcptHeaderView;
ViewArray[1] := RcptCmntView;
ViewArray[2] := m_rcptDetailView;
ViewArray[3] := AddCostView;
ViewArray[4] := RcptVndView;
ViewArray[5] := RcptPoView;
ViewArray[6] := RcptCostDistrView;
RcptFuncView.Compose(ViewArray);
SetLength(ViewArray, 2);
ViewArray[0] := m_rcptHeaderView;
ViewArray[1] := RcptFuncView;
RcptPoView.Compose(ViewArray);
RcptOptFldView.Compose(m_rcptHeaderView);
SetLength(ViewArray, 5);
ViewArray[0] := AddCostView;
ViewArray[1] := RcptVndView;
ViewArray[2] := m_rcptHeaderView;
ViewArray[3] := RcptFuncView;
ViewArray[4] := nil;
RcptCostDistrView.Compose(ViewArray);
RcptDtlOptFlds.Compose(m_rcptDetailView);
RcptVndOptFldView.Compose(RcptVndView);
RcptAddCostOptFld.Compose(AddCostView);
m_rcptHeaderView.Order := 1;
m_rcptHeaderView.Order := 0;
m_rcptHeaderView.Fields.Field[0].PutWithoutVerification('0');
m_rcptHeaderView.Init;
m_rcptHeaderView.Order := 1;
m_rcptDetailView.RecordClear;
RcptVndView.RecordClear;
AddCostView.RecordClear;
RcptPoView.Init;
RcptCmntView.Init;
m_rcptHeaderView.Fields.Field[22].Value := PoRcvrNbr;
m_rcptHeaderView.Fields.Field[25].Value := VNDREC;
m_rcptHeaderView.Fields.Field[229].PutWithoutVerification('1');
m_rcptHeaderView.Process;
m_rcptHeaderView.Fields.Field[41].Value := PoRcvrNbr;
m_rcptHeaderView.Order := 0;
RcptFuncView.Fields.Field[2].Value := PoRcvrNbr;
RcptFuncView.Fields.Field[5].PutWithoutVerification('4');
RcptFuncView.Process;
m_rcptHeaderView.Order := 1;
RcptVndView.Fields.Field[175].PutWithoutVerification('1');
RcptVndView.Process;
tmpStr := RcptVndView.Fields.Field[0].Value;
RcptVndView.Browse('(RCPHSEQ = "' + tmpStr + '")', 1);
RcptVndView.RecordClear;
RcptFuncView.Fields.Field[5].PutWithoutVerification('10');
RcptFuncView.Process;
m_rcptHeaderView.Insert;
RcptFuncView.Fields.Field[0].PutWithoutVerification(tmpStr);
RcptFuncView.Fields.Field[5].PutWithoutVerification('2');
RcptFuncView.Process;
m_rcptHeaderView.Init;
m_rcptHeaderView.Order := 0;
m_rcptHeaderView.Fields.Field[0].PutWithoutVerification('0');
m_rcptHeaderView.Init;
m_rcptHeaderView.Order := 1;
m_rcptDetailView.RecordClear;
RcptVndView.RecordClear;
AddCostView.RecordClear;
RcptPoView.Init;
RcptCmntView.Init;