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

XAPI FieldFinder referencing multiple views

Status
Not open for further replies.

Bluejay07

Programmer
Mar 9, 2007
780
CA
Hello,

I have the following code:

Code:
Dim ICITEM As ACCPACXAPILib.xapiView
   
Set ICITEM = apfSess.OpenView("IC0310", "IC")
Set FieldFinder = New Finder
With FieldFinder
   .FinderCaption = apfSess.Company & " - Sage Accpac Items"
   .SetFinderView apfSess, ICITEM, "ZZZZZZZZZZZZ", 0
   .AddFinderCol "ITEMNO", 0, 0, 1
   .AddFinderCol "FMTITEMNO", 1, 1500, 1
   .AddFinderCol "DESC", 2, 3000, 1
   .AddFinderCol "INACTIVE", 3, 1000, 1
   .AddFinderCol "ITEMBRKID", 4, 1000, 1
   .AddFinderCol "CATEGORY", 5, 1000, 1
   .AddFinderCol "STOCKUNIT", 6, 2000, 1
   .AddFinderCol "DEFPRICLST", 7, 2000, 1
   .AddFinderCol "PICKINGSEQ", 8, 2000, 1
   .AddFinderCol "COMMENT1", 9, 2500, 1
   .AddFinderCol "COMMENT2", 10, 2500, 1
   .AddFinderCol "COMMENT3", 11, 2500, 1
   .AddFinderCol "COMMENT4", 12, 2500, 1
   .FinderPrepare = "INACTIVE=0"
   .ResultField1 = 0
   .ResultField2 = 1
   .SkipFirst = True
   .ModVersion = AP_ModuleVersion("IC")
   .ShowFinder
   
   If Len(.FinderResult1) > 0 Then Result1 = Trim$(.FinderResult1)
   If Len(.FinderResult2) > 0 Then Result2 = Trim$(.FinderResult2)
End With
ICITEM.Close
Set ICITEM = Nothing
Set FieldFinder = Nothing

This finder is referencing one specific view - 'IC0310'.

How would I be able to incorporate a second view in this finder. More specifically, how can I add one specific optional field with the above fields.

Overall, I want the finder to display the desired Item Fields with one optional field, say with the name 'Size'.

I believe the view would be 'IC0313' for the Item optional fields that I would be referencing.

Thank you for your assistance.
 
Simple, you cannot.
You can select the fields once you have the finder open, click on Settings, Columns and then look in the Unselected column for the optional fields and select them.
 
Thank you for your reply.

After following the code, I realized that the FieldFinder is a custom function which helps to setup the finder details.

I cannot use your suggestion as the results are displayed in a custom form.

Do you have any suggestions on how this can be obtained using XAPI format?
 
XAPI is obsolete, if you use the COMAPI then you can use the Accpac finder object and it loads the standard Accpac finder, from there you can select the optional fields as you can in Accpac. I don't know of any way to get the optional fields in XAPI.
 
Or create your own finder and use a SQL statement with one or more joins to show the optional fields.
 
Thank you ettienne and DjangMan for your replies.

Ettienne,
I am aware of COMAPI however I am maintaining a project written with XAPI functionality. On the plus side, additional lanpaks are not required for XAPI as they are for COMAPI.

For this project, COMAPI functionality would definately be easier but it is not an option at this time.

DjangMan,
If I want to use my existing code, I think your suggestion may work. I will look into the possibility.

Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top