Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use a view to insert a record into a different view

Status
Not open for further replies.

ryslepel

Programmer
Jun 8, 2007
14
ZA
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


 
You might get a better response from the Accpac development partner forum.
 
I got a response from the Accpac development partner forum.
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top