Account Budget Project

Hello all! Was wondering if I could get some assistance on a few problems I am running into. I am currently working on a customization on the account budget form as my first project in Epicor and I have a few questions. So the end goal is to be able to have 2 drop downs, one for departments and one for COA based on department. I am able to return the users departments but getting the COA is the stump in the road right now. I would get them from the view but since i’m not using the new button I would have to use the adapter data set right? I am trying to do it with GetByID, but when I trace this is all that is triggered in the trace log is GetById but when I use it, it’s a bool? So how does the bool fill out the data? I would imagine you would have to look through a dataset right? but I don’t see any of that in the trace log. If I run into any more issues I will post on this topic to keep it all in one place. Thank you for reading.

		AccountBudgetAdapter aba = new AccountBudgetAdapter(oTrans);
        aba.BOConnect();
        AccountBudgetDataset ABData = aba.AccountBudgetData;
        bool gotData = aba.GetByID("MainBook", chart, "D", 2020, "", "CompCal", "Main");

After a little bit of digging, are you sure that adapter includes the GetByID? It looks like it’s in the contract (that’s what you are seeing in the trace) but not in the adapter. The adapter has an OnGetByID method… which calls that GetByID in the background… It all looks very complicated. You’ve picked a heck of a project for your first one.

You may be better off making a BAQ that you can use to populate the data. You would at least have more control.

1 Like

So instead of using a view like I was going to am I going to have to set all this data manually

 EpiCurrencyEditor numAmt = (EpiCurrencyEditor)csm.GetNativeControlReference("c5fa23d7-b018-42d0-8bf5-ae482ad4db40");
    EpiNumericEditor statAmt = (EpiNumericEditor)csm.GetNativeControlReference("4b83b2fc-1e3d-4a67-8080-ad0a1b2aa842");
    EpiNumericEditor totalStatAmt = (EpiNumericEditor)csm.GetNativeControlReference("9d68999e-9632-477f-8cc7-e07c5cdefef7");
    EpiCurrencyEditor totalBudgetAmt = (EpiCurrencyEditor)csm.GetNativeControlReference("6355e124-bae0-4245-b329-59ccd1e7cbcc");
    EpiTextBox deptName = (EpiTextBox)csm.GetNativeControlReference("12a86bd2-9056-4bb3-b1ca-13803e10e7ea");

    AccountBudgetAdapter aba = new AccountBudgetAdapter(oTrans);
    aba.BOConnect();
    bool test = aba.GetByID("MainBook", chart, "D", 2020, "", "CompCal", "Main");
    DataSet ABData = aba.AccountBudgetData;

    DataRow dr = ABData.Tables[0].Rows[0];
    decimal Amount = decimal.Parse(dr["BudgetAmt"].ToString());
    decimal statAmount = decimal.Parse(dr["BudgetStatAmt"].ToString());
    decimal TotalStat = decimal.Parse(dr["TotalBudgetStatAmt"].ToString());
    decimal TotalBudget = decimal.Parse(dr["TotalBudgetAmt"].ToString());
    string nameDept = dr["GLAcctDispAccountDesc"].ToString();
    

    numAmt.Value = Amount;
    statAmt.Value = statAmount;
    totalStatAmt.Value = TotalStat;
    totalBudgetAmt.Value = TotalBudget;
    deptName.Text = nameDept;

This is what I have right now trying to set the data BUT when I use tab on the base one it fills all the data for you, Is there a way to keep that functionality but use my own parameters?

So is there a way to automate the process like it does on the base form with a business method? Or is the best way doing it like above ^^ and if it is manual how would you pick which view you get with GetByID. I am trying to get the detail but it’s showing head when I set it as datasource. In the BL Tester I get to pick which view.

Can you do me a favor and step back just a bit and explain a little more in depth what you are trying to do? I don’t work in accounting very much and so I’m not very familiar with this screen.

Are these custom drop downs that you are adding to the screen? Are they attached to a custom field? Or is this something on the stock screen that you are changing?

Screen shots would be helpful.

Yes stock screen I am adding drop downs users assigned departments which I have that here:

image

Pulling charts I am having trouble with and basically it will automatically fill this box in

image

with users selection and defaulted company.

I would like when it default it into the GLAccount I can press tab and it will have it’s original functionality.

I don’t understand what you mean by original functionality. If you added these fields what’s the original functionality?

I can’t set the combobox to a epibinding without having to press “New” when on the default because its defaulted as disabled when it has a epibinding. on the original form you just fill the fiscal year and Gl account and it will input all the data. I just want to add a couple more steps before it inputs the data. I hope I am explaining this well enough.

I’m not getting it… sorry. Can you use screentogif to make a little video so I can see what you see? I’m not understanding what you mean when you say “all the data”. There really isn’t anything on the screen to fill out. :man_shrugging:

So are you looking to have the dropdown values on the Right be filetered by the selection on the Left Drop Down?
image

Also are these combo boxes bound to anything? If not (why not) what are you trying to do in the end with these values?

i’m sorry my fault, it inputs the data on period Budget. I just forgot I moved that dataview over to the account budget tab.

Yes I have this part finished just the data being inputed is where I am at now.

So you just want to set some defaults when making a new budget item right? Have you looked at BPM forms? You should be able to attach a form to the method shown below and then you can design a form to gather the inputs.

image

… not sure what that means lol

All right,
Can you try and explain what it is you are trying to do all together (functionally not technically)
IE: User Opens the Form, Clicks a button it does x y and z now, we want it to do x y z and v for reason y.

Just trying to understand what you are trying to do from a functional prospective.

1 Like

Ok I have a few images

These 2 boxes on the original form fill out this on the Period Budget tab like this

I have the updated one like this(Don’t mind it being sloppy test environment lol)

So exactly same thing just with the datagridview on the same tab with some filtering and restrict user access to be able to access any budget.

Are you basically just trying to split up and filter this selection box?

image

yes, and jose has shown me how to edit that and fill the values in but there is no view so I can’t do it that way. Which can you filter one of epicors methods on how it’s filling the view with?

So try this
After they’ve populated the 2 dropdowns and I’m guessing you’ve figured out the GLAccount (is that part working?)
Then do this

oTrans.ValidateKeyField("YourGLAccountHere");
oTrans.KeyField="YourGLAccount";

And see what that does. (Don’t worry about the actual GL Control (yet)

Do this with ValidateGLAccount?

No, just invoke those 2 lines of code when you have a GLAccount you want to load.