I'm trying to insert a record into VIEW-B that has been inserted into VIEW-A.
I have uncommented the do_tqInsert...
And call the following function from TQ_INSERT
int UpdateAPOBLO(LPV lpv )
{
long rotoID;
ERRNUM e;
LPRECORD lpr = (LPRECORD)(FindRecord(lpv))[0];
utlObjStrToID(APOBLO_VIEW,&rotoID);
if (OpenOneView(lpv,CMP_APOBLO) != ERRNUM_SUCCESS) return 1;
secGlobalAccess(lpv->hpib, lpv->wLinkNo,rotoID);
viewInit(lpv->cmp[CMP_APOBLO].rvh,lpv->cmp[CMP_APOBLO].view);
viewPut(lpv->cmp[CMP_APOBLO].rvh,lpv->cmp[CMP_APOBLO].view,APOBLO_IDX(IDVEND), lpr->idvend,12,FALSE);
viewPut(lpv->cmp[CMP_APOBLO].rvh,lpv->cmp[CMP_APOBLO].view,APOBLO_IDX(IDINVC), lpr->idinvc,22,FALSE);
viewPut(lpv->cmp[CMP_APOBLO].rvh,lpv->cmp[CMP_APOBLO].view,APOBLO_IDX(OPTFIELD), lpr->optfield,12,FALSE);
viewPut(lpv->cmp[CMP_APOBLO].rvh,lpv->cmp[CMP_APOBLO].view,APOBLO_IDX(VALUE), lpr->value,60,FALSE);
viewPut(lpv->cmp[CMP_APOBLO].rvh,lpv->cmp[CMP_APOBLO].view,APOBLO_IDX(TYPE), lpr->type,2,FALSE);
viewPut(lpv->cmp[CMP_APOBLO].rvh,lpv->cmp[CMP_APOBLO].view,APOBLO_IDX(LENGTH), lpr->length,2,FALSE);
viewPut(lpv->cmp[CMP_APOBLO].rvh,lpv->cmp[CMP_APOBLO].view,APOBLO_IDX(DECIMALS), lpr->decimals,2,FALSE);
viewPut(lpv->cmp[CMP_APOBLO].rvh,lpv->cmp[CMP_APOBLO].view,APOBLO_IDX(ALLOWNULL), lpr->allownull,2,FALSE);
viewPut(lpv->cmp[CMP_APOBLO].rvh,lpv->cmp[CMP_APOBLO].view,APOBLO_IDX(VALIDATE), lpr->validate,2,FALSE);
rvspyTrace("inserting record");
e = viewInsert(lpv->cmp[CMP_APOBLO].rvh,lpv->cmp[CMP_APOBLO].view);
rvspyTrace(APOBLO_VIEW);
secNoGlobalAccess(lpv->hpib, lpv->wLinkNo);
return e;
}
As you can see i am tryin to Insert the record into *sigh* APOBLO.
I am a novice in programming views. Any help appreciated.
regards
Angelo
I have uncommented the do_tqInsert...
And call the following function from TQ_INSERT
int UpdateAPOBLO(LPV lpv )
{
long rotoID;
ERRNUM e;
LPRECORD lpr = (LPRECORD)(FindRecord(lpv))[0];
utlObjStrToID(APOBLO_VIEW,&rotoID);
if (OpenOneView(lpv,CMP_APOBLO) != ERRNUM_SUCCESS) return 1;
secGlobalAccess(lpv->hpib, lpv->wLinkNo,rotoID);
viewInit(lpv->cmp[CMP_APOBLO].rvh,lpv->cmp[CMP_APOBLO].view);
viewPut(lpv->cmp[CMP_APOBLO].rvh,lpv->cmp[CMP_APOBLO].view,APOBLO_IDX(IDVEND), lpr->idvend,12,FALSE);
viewPut(lpv->cmp[CMP_APOBLO].rvh,lpv->cmp[CMP_APOBLO].view,APOBLO_IDX(IDINVC), lpr->idinvc,22,FALSE);
viewPut(lpv->cmp[CMP_APOBLO].rvh,lpv->cmp[CMP_APOBLO].view,APOBLO_IDX(OPTFIELD), lpr->optfield,12,FALSE);
viewPut(lpv->cmp[CMP_APOBLO].rvh,lpv->cmp[CMP_APOBLO].view,APOBLO_IDX(VALUE), lpr->value,60,FALSE);
viewPut(lpv->cmp[CMP_APOBLO].rvh,lpv->cmp[CMP_APOBLO].view,APOBLO_IDX(TYPE), lpr->type,2,FALSE);
viewPut(lpv->cmp[CMP_APOBLO].rvh,lpv->cmp[CMP_APOBLO].view,APOBLO_IDX(LENGTH), lpr->length,2,FALSE);
viewPut(lpv->cmp[CMP_APOBLO].rvh,lpv->cmp[CMP_APOBLO].view,APOBLO_IDX(DECIMALS), lpr->decimals,2,FALSE);
viewPut(lpv->cmp[CMP_APOBLO].rvh,lpv->cmp[CMP_APOBLO].view,APOBLO_IDX(ALLOWNULL), lpr->allownull,2,FALSE);
viewPut(lpv->cmp[CMP_APOBLO].rvh,lpv->cmp[CMP_APOBLO].view,APOBLO_IDX(VALIDATE), lpr->validate,2,FALSE);
rvspyTrace("inserting record");
e = viewInsert(lpv->cmp[CMP_APOBLO].rvh,lpv->cmp[CMP_APOBLO].view);
rvspyTrace(APOBLO_VIEW);
secNoGlobalAccess(lpv->hpib, lpv->wLinkNo);
return e;
}
As you can see i am tryin to Insert the record into *sigh* APOBLO.
I am a novice in programming views. Any help appreciated.
regards
Angelo