Hi smart people,
has any one done similar code in ERP10, this seems to work for Epicor previous versions, as i tried it, it is error out at BOReader, i have tried most of suggestion on this post, but no luck, could anyone help please, i am trying to add PORel.NeedByDate to the Demand Grid in Job Manager ?
I haven’t looked at the grid and form you’re asking about, but in general if there’s a field not in a grid that you want to see, there are two main options and one probably over-complex one, depending on the particular case.
Is the field you want actually within the EpiDataView the grid is bound to? If so, option one is very simple, and you can make it visible in the grid column collection.
If the field is NOT in the EpiDataView, then it might be easiest to swap out the grid entirely for one based on a BAQView that DOES show what you want. That isn’t trivial, but there are good guides to it in posts here, and @josecgomez is the expert.
Last resort if you are comfortable with DataTables and getting deeper into the code is manually adding a column to the underlying DataTable, which looks like is the general approach in the code you’ve posted. That is possible but seems overkill in most circumstances.
the 1st option is obvious my friend, the filed i need is not within the EpiDataView, and i have done the 2nd option in other cases but on this one i can not replace the Custom BAQ because it is functional to many tracker buttons, this left me with 3rd option which is code my field to appear within the custom grid including call it’s value from the Database.
Sorry, I don’t mean to offend you! I know I get stuck looking for complicated solutions quite often when a simpler one would do.
Given that you’ve already ruled out the simpler options then yes, you need to get quite manual here. Having a data call for every row in the grid feels a bit extreme to me, though. If that is what you want to do then I think the E10 way is to use a dedicated adapter to do so. PORelSearch seems like it would do the job, and you would essentially swap out the code that uses boReader for it.
Personally I would prefer an approach that retrieved the relevant data once when the EpiDataView is updated, and added it to the DataTable then, I think. But you know your needs best!
no problem at all, i am just explaining my case, my Background is Manufacturing Engineering, the last coding language i worked on before Start customizing Epicor was Fortran and Pascal, C# is the first Object-Oriented Programming language i use, i found it very powerful dealing with database with loads of libraries or what we used to call ‘subroutines’, so long story short i have not got a wide knowledge of using such commands, could you please elaborate a bit more, it will be very useful if you give an example of what you mean here.
thanks in advance
For me, Epicor is a whole other world in itself and not much experience of mine elsewhere has been much use to me! But I’m learning.
Here’s an adapter call that I’m using somewhere. I think you’ll see it’s similar to the BOReader parts of the code you’ve already posted and could be adjusted to work the same way. As I say, it feels a bit strange to me to be doing this for every row of a grid, but alternative solutions would need a whole lot more re-engineering.
Many Thanks Dan, i found and added the BOReader :)and The Core, code compiled fine, then start add my custom code and it is error out at
private BOReaderImpl _boReader;
i am testing my code line by line, do i need to add the whole modification and test ?
compiled failed when removing Core, so i have added it back and added what you suggested as well ‘Epicor.ServiceModel’, i have added my custom lines, the whole code complied fine now, however :) my added field does not show any value
and this my code, (i am testing this code on Scheduling Resource Tracker Screen as i have manged to add the field but failed to bind it to Epicor DataBase)
// **************************************************
// Custom code for ResourceSchedForm
// Created: 27/09/2018 13:43:48
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Erp.Adapters;
using Erp.UI;
using Ice.Lib;
using Ice.Adapters;
using Ice.Lib.Customization;
using Ice.Lib.ExtendedProps;
using Ice.Lib.Framework;
using Ice.Lib.Searches;
using Ice.UI.FormFunctions;
using Ice.Contracts;
using Ice.Core;
using Ice.Proxy.Lib;
public class Script
{
// ** Wizard Insert Location - Do Not Remove ‘Begin/End Wizard Added Module Level Variables’ Comments! **
// Begin Wizard Added Module Level Variables **