The Customer Tracker screen only displays the “Industry” column. I want to add the actual code to display (R/O). The relationship is easy
SELECT ICCode from CustIC where Customer.Company = CustIC.Company
AND Customer.CustNum = CustIC.CustNum
The problem is that there is no DataView or Adapter available for the CustIC table. This shouldn’t be a difficult task, but its stumping us.
CustIC is within the Customer DataSet, isn’t it?
So you probably already have what you need in the adapter already in Customer Tracker. You just need to bind something to CustIC.ICCodeDescription.
I don’t see that column available in the Customer DataSet. At least when I go to EpiBindings, it does not have anything available like CustIC. Does this have to be done through code?
BTW: Thanks for that quick response!
I’ve just sanity-checked, and oddly CustIC is part of the DataSet in Customer Display but not Customer Tracker. So sorry to lead you astray.
I wonder if the simplest solution in that case is to add an EpiCombo control, bind that to the field in the Customer table and retrieve the description to display. If that doesn’t work then you might have to fall back on a coded adapter way of doing it, because you CAN get to CustIC through the Customer Adapter BO.
Is there some code snippet you might be able to provide or point me in the direction to find the information myself on how to do this via code? My sanity check has checked out awhile ago!
I’ll see what I can find, but it won’t be today now, I’m afraid. I’ll try to check tomorrow.
I looked at the “Customer Display” screen and sure enough, there is a DataView called “CustIC” that has the real field value I need, “ICCodeDescription”. So I’m guessing I have to somehow add this data view to the oTrans adapter? Thanks again!
OK, this does that part, but we don’t use CustIC so I can’t tell if it gets you to where you need to be:
private void AddCustIC()
if (oTrans.EpiDataViews["CustIC"] == null)
DataTable dtCustIC = oTrans.CustomerAdapter.CustomerData.CustIC;
EpiDataView edvCustIC = new EpiDataView();
edvCustIC.dataView = dtCustIC.DefaultView;
You can call it from InitializeCustomCode, and I think you may need to manually add an Assembly Reference to Adapters.CustomerAdapter. When you’ve closed and opened the form, you should find there’s the DataView you want. Whether it contains the data you want depends on whether the form is keeping that DataSet populated and in sync - it would feel like overkill to have to do it deliberately each time just for one field.
I am going to give it a try soon. I’ll let you know the results. Thanks!
Well that got me very close! But as you suspected, the data is not being synced when changing records. What event should I hook in order to retrieve the proper data? Again…so close. Thank you!!!
I got it! I set the ParentView for edvCustIC to the Customer view and now it works! Thank you again for your assistance!
is it possible to share the final script editor code lines