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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help for view build

Status
Not open for further replies.

kent01142

Programmer
Sep 26, 2012
26
HK
hi mates,

I am very stress on build a view. I am going to add a function to post shipment or adjustment on IC with Serial/Lot costing method. I try to compose the ICSHED with ICSHEDS and ICSHEDL but no luck at all. the error says Shipment detail. this view's foreign key declaration is incomparable with the composite's view 'Compose views'

My code is
CHECK_CALL (e, viewCompCnt (SDrvh, SDview, 10));
composites[0] = SHview;
composites[1] = NULL;
composites[2] = NULL;
composites[3] = NULL;
composites[4] = NULL;
composites[5] = NULL;
composites[6] = NULL;
composites[7] = NULL;
composites[8] = SDLview;
composites[9] = SDSview;
CHECK_CALL (e, viewCompose (SDrvh, SDview, (LPVIEWDEF) composites));

I tried to just compose the SHview and SDOview with no problem.
Do you guys know why serial detail and lot detail cannot be compose with shipment detail manually?

Cheers
 
You left out too many views, you need them all:

Roto ID:IC0630 DLL Name: ICSHED Shipment Details

View Composition - 10 view(s)
IC0640 - ICSHEH Shipment Headers
IC0310 - ICITEM Items
IC0750 - ICUNIT Units of Measure
IC0210 - ICCATG Categories
IC0370 - ICLOC Locations
IC0290 - ICILOC Location Details
IC0390 - ICPCOD Price List Codes
IC0635 - ICSHEDO Shipment Detail Optional Fields
IC0632 - ICSHEDL Shipment Detail Lot Numbers
IC0636 - ICSHEDS Shipment Detail Serial Numbers

 
Thanks for the suggestion, I will try it out. but as in macro, can I set nothing to the view that I dun need to? Like
ICSHE1detail1.Compose Array(ICSHE1header, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ICSHE1detail3, ICSHE1detail4, ICSHE1detail5)
 
You may think you do not need the views, but the program does.
 
Still no luck, but this time is the ICUNIT

Untitled%202.tiff
 
utlObjStrToID ("IC0640", &vls.lViewID);
SHrvh = viewLoadEx (&vls);
CHECK_CALL (e, viewInstanceOpen (SHrvh, lpv->hpib, lpv->wLinkNo, lpv->OpenFlags, lpv->OpenExtra, lpv->OpenExtraSize, &SHview));

utlObjStrToID ("IC0630", &vls.lViewID);
SDrvh = viewLoadEx (&vls);
CHECK_CALL (e, viewInstanceOpen (SDrvh, lpv->hpib, lpv->wLinkNo, lpv->OpenFlags, lpv->OpenExtra, lpv->OpenExtraSize, &SDview));

utlObjStrToID ("IC0635", &vls.lViewID);
SDOrvh = viewLoadEx (&vls);
CHECK_CALL (e, viewInstanceOpen (SDOrvh, lpv->hpib, lpv->wLinkNo, lpv->OpenFlags, lpv->OpenExtra, lpv->OpenExtraSize, &SDOview));

utlObjStrToID ("IC0310", &vls.lViewID);
ITMrvh = viewLoadEx (&vls);
CHECK_CALL (e, viewInstanceOpen (ITMrvh, lpv->hpib, lpv->wLinkNo, lpv->OpenFlags, lpv->OpenExtra, lpv->OpenExtraSize, &ITMview));

utlObjStrToID ("IC0750", &vls.lViewID);
UOMrvh = viewLoadEx (&vls);
CHECK_CALL (e, viewInstanceOpen (UOMrvh, lpv->hpib, lpv->wLinkNo, lpv->OpenFlags, lpv->OpenExtra, lpv->OpenExtraSize, &UOMview));

utlObjStrToID ("IC0210", &vls.lViewID);
CATrvh = viewLoadEx (&vls);
CHECK_CALL (e, viewInstanceOpen (CATrvh, lpv->hpib, lpv->wLinkNo, lpv->OpenFlags, lpv->OpenExtra, lpv->OpenExtraSize, &CATview));

utlObjStrToID ("IC0370", &vls.lViewID);
LOCrvh = viewLoadEx (&vls);
CHECK_CALL (e, viewInstanceOpen (LOCrvh, lpv->hpib, lpv->wLinkNo, lpv->OpenFlags, lpv->OpenExtra, lpv->OpenExtraSize, &LOCview));

utlObjStrToID ("IC0290", &vls.lViewID);
LOCDrvh = viewLoadEx (&vls);
CHECK_CALL (e, viewInstanceOpen (LOCDrvh, lpv->hpib, lpv->wLinkNo, lpv->OpenFlags, lpv->OpenExtra, lpv->OpenExtraSize, &LOCDview));

utlObjStrToID ("IC0390", &vls.lViewID);
PRLrvh = viewLoadEx (&vls);
CHECK_CALL (e, viewInstanceOpen (PRLrvh, lpv->hpib, lpv->wLinkNo, lpv->OpenFlags, lpv->OpenExtra, lpv->OpenExtraSize, &PRLview));

utlObjStrToID ("IC0636", &vls.lViewID);
SERrvh = viewLoadEx (&vls);
CHECK_CALL (e, viewInstanceOpen (SERrvh, lpv->hpib, lpv->wLinkNo, lpv->OpenFlags, lpv->OpenExtra, lpv->OpenExtraSize, &SERview));

utlObjStrToID ("IC0632", &vls.lViewID);
Lotrvh = viewLoadEx (&vls);
CHECK_CALL (e, viewInstanceOpen (Lotrvh, lpv->hpib, lpv->wLinkNo, lpv->OpenFlags, lpv->OpenExtra, lpv->OpenExtraSize, &Lotview));


CHECK_CALL (e, viewCompCnt (SHrvh, SHview, 1));
composite[0] = SDview;
CHECK_CALL (e, viewCompose (SHrvh, SHview, (LPVIEWDEF) composite));

CHECK_CALL (e, viewCompCnt (SDrvh, SDview, 10));
composites[0] = SHview;
composites[1] = ITMview;
composites[2] = UOMview;
composites[3] = CATview;
composites[4] = LOCview;
composites[5] = LOCDview;
composites[6] = PRLview;
composites[7] = SDOview;
composites[8] = Lotview;
composites[9] = SERview;
CHECK_CALL (e, viewCompose (SDrvh, SDview, (LPVIEWDEF) composites));

CHECK_CALL (e, viewCompCnt (ITMrvh, ITMview, 1));
composite[0] = SDrvh;
CHECK_CALL (e, viewCompose (ITMrvh, ITMview, (LPVIEWDEF) composite));

CHECK_CALL (e, viewCompCnt (UOMrvh, UOMview, 1));
composite[0] = SDrvh;
CHECK_CALL (e, viewCompose (UOMrvh, UOMview, (LPVIEWDEF) composite));

CHECK_CALL (e, viewCompCnt (CATrvh, CATview, 1));
composite[0] = SDrvh;
CHECK_CALL (e, viewCompose (CATrvh, CATview, (LPVIEWDEF) composite));

CHECK_CALL (e, viewCompCnt (LOCrvh, LOCview, 1));
composite[0] = SDrvh;
CHECK_CALL (e, viewCompose (LOCrvh, LOCview, (LPVIEWDEF) composite));

CHECK_CALL (e, viewCompCnt (LOCDrvh, LOCDview, 1));
composite[0] = SDrvh;
CHECK_CALL (e, viewCompose (LOCDrvh, LOCDview, (LPVIEWDEF) composite));

CHECK_CALL (e, viewCompCnt (PRLrvh, PRLview, 1));
composite[0] = SDrvh;
CHECK_CALL (e, viewCompose (PRLrvh, PRLview, (LPVIEWDEF) composite));

CHECK_CALL (e, viewCompCnt (SDOrvh, SDOview, 1));
composite[0] = SDrvh;
CHECK_CALL (e, viewCompose (SDOrvh, SDOview, (LPVIEWDEF) composite));

CHECK_CALL (e, viewCompCnt (Lotrvh, Lotview, 1));
composite[0] = SDview;
CHECK_CALL (e, viewCompose (Lotrvh, Lotview, (LPVIEWDEF) composite));

CHECK_CALL (e, viewCompCnt (SERrvh, SERview, 1));
composite[0] = SDview;
CHECK_CALL (e, viewCompose (SERrvh, SERview, (LPVIEWDEF) composite));

CHECK_CALL (e, viewInit (SHrvh, SHview));

the error is from the last line
 
This is the composition for OESHEH:

Roto ID:IC0640 DLL Name: ICSHEH Shipment Headers

View Composition - 3 view(s)
IC0630 - ICSHED Shipment Details
IC0390 - ICPCOD Price List Codes
IC0645 - ICSHEHO Shipment Optional Fields


 
it seems like it is putting the sequence number from ICSHED to ICUNIT as the foreign key, that's why the error occur.

error message : Unit of Measure This view's foreign key declaration is incompatible with the composite view 'Compose Views'.
 
This is how Accpac composes it in VBA, use this as a guide

Dim ICSHE1header As AccpacCOMAPI.AccpacView
mDBLinkCmpRW.OpenView "IC0640", ICSHE1header

Dim ICSHE1detail1 As AccpacCOMAPI.AccpacView
mDBLinkCmpRW.OpenView "IC0630", ICSHE1detail1

Dim ICSHE1detail2 As AccpacCOMAPI.AccpacView
mDBLinkCmpRW.OpenView "IC0645", ICSHE1detail2

Dim ICSHE1detail3 As AccpacCOMAPI.AccpacView
mDBLinkCmpRW.OpenView "IC0635", ICSHE1detail3

Dim ICSHE1detail4 As AccpacCOMAPI.AccpacView
mDBLinkCmpRW.OpenView "IC0632", ICSHE1detail4

Dim ICSHE1detail5 As AccpacCOMAPI.AccpacView
mDBLinkCmpRW.OpenView "IC0636", ICSHE1detail5

ICSHE1header.Compose Array(ICSHE1detail1, Nothing, ICSHE1detail2)
ICSHE1detail1.Compose Array(ICSHE1header, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ICSHE1detail3, ICSHE1detail4, ICSHE1detail5)
ICSHE1detail2.Compose Array(ICSHE1header)
ICSHE1detail3.Compose Array(ICSHE1detail1)
ICSHE1detail4.Compose Array(ICSHE1detail1)
ICSHE1detail5.Compose Array(ICSHE1detail1)

 
in exactly same order already and as I asked if VBA/marco can only compose selected table, why cannot do it in view?
 
I don't know, but I also don't use recognize that language you're coding in, I only use VB, VBA, and C#.
 
I am really confuse with this language too as I use VB, java, c++ and this language is so hard to read too... BTW, thanks anyway
 
I think you're better off going to the DPP forum, not many SDK programmers around here - if any.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top