Make a warning for GL control missing on projects

Our company has been struggling to put GL control code when creating projects. This has been causing us some issues in finance since USD customers’ milestone billing goes to default Canadian GL accounts.

I was trying to create a BPM warning to notify the user when creating a new project without GL control code, and was unsuccessful.

I tried method directive / project/ update/ pre-proc, base proc, and post-proc.
I also tried method directive/ project/ GetNewProject/ Pre-proc.

Using the logic “if GL control type is not equal to “Project Billing” (our gl control type code)” show message, none of it has been working.

Could some one tell me if I should be using 1) data directive? or 2) different method group or 3) different logic?

Thank you,
Sydney

A Pre-Proc on Project.Update will have an issue with the fact that the Project is saved before the GLC can be added. What you could do, is use a BPM Form to propmt them with the choice, then use the results of the form to update the data set before it is written.

1 Like

Hello Calvin,

Thank you for your reply. I have never used BPM forms before, and this will be a great opportunity for me to learn it and use it!

Do you still think i should call the BPM form using the project.update pre-proc? or do you think i should do it on base or post?

Sydney

I think you are overthinking this. Since all projects will use this control code by default then you can go into the extended properties of the control code column in the project and set it as a default value (whatever exactly that is). That way it would just apply as soon as you call the GetNew… method. No extra BPM processing required since its built into the initialization of the new row.

Id try that before a customization. It will be easier to upgrade and require less attention. You wont even have to apply a customization to a menu item.

Hi Peter,

Currently it defaults to Canadian GL code, but we need the sales team who are creating the project to change the code to USD when necessary. However, since they always forget to do this, we were trying to figure out a way to help them not forget.

Sydney

Aren’t theses actually stored in the EntityGLC table?

And these entries aren’t automatically created when the entity record (Project in this case) is created.

1 Like

Yes, this is true.
They don’t automatically get created. But any transaction that we have for project milestone billing hits the Canadian account as a default when the project doesn’t have a GL control code.

We are trying to figure out a way for our users to enter the GL control code since we have USD projects that needs to hit the correct GL account.

Sydney

I get what you’re trying to do. (My post was in response to @ziipeter)

I was trying some things out with the Pre-Proc on Part.Update - but had to get back to work. Here’s some points I found that might help you.

I don’t have the Project Management module, so all my tests were on requiring a GLC on the Part

  • Can test for the lack of a GLC fairly easily. But it will always be missing when the Part record (Project for you) is first created.
  • The Part table has to be saved before GLC’s can be added to it.
  • Adding the GLC is kind of it’s own thing. When adding a GLC to a Part, the section of the dataset for Part (ds.Part) is blank. And you need the PartNum when invoking the BO Erp.Part.GetNewEntityGLC
1 Like

I’ve created a BPM to auto add a GL to a project, I’ll dig it out for you, you may be able to adapt it to do what you want

This is the code I have in a Data Directive BPM, I’m relatively new to BPM’s but this works for me, it doesn’t fire off until there is a Project Manager assigned to the Project - it is after the first “if” statement that it checks to see if there is already a GL assigned to the project

var ttpj = ttProject.Where(p => p.Company == Session.CompanyID && p.ActiveProject == true && p.ConProjMgr.Any() && (p.RowMod == "U" || p.RowMod == "A") ).FirstOrDefault();
if (ttpj != null)
{
var hasGL = Db.EntityGLC.Where(g => g.Company == ttpj.Company && g.Key1 == ttpj.ProjectID).FirstOrDefault();
if (hasGL == null)

{
//throw new Ice.BLException("No GL assigned);

//this.PublishInfoMessage("Test", Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "FirstVar","SecondVar");

  EntityGLC newRow = new EntityGLC();
  Db.EntityGLC.Insert(newRow);
  newRow.Company = Session.CompanyID;
  newRow.RelatedToFile = "Project";
  newRow.Key1 = ttpj.ProjectID;
  newRow.GLControlType = "Project Billing";
  newRow.GLControlCode = "DEFAULT";
  newRow.BusinessEntity = "Project";
  newRow.ExtCompanyID = "";
  newRow.IsExternalCompany = false;
  newRow.GlobalEntityGLC = false;
  newRow.GlobalLock = false;
  
  Db.Validate();

}
}

Modify your code as below to refer RelatedToFile in case project Id shares with others like Part, Product Group, etc.

var hasGL = Db.EntityGLC.Where(g => g.Company == ttpj.Company && string.Compare(g.RelatedToFile, "Project", true) == 0 && g.Key1 == ttpj.ProjectID).FirstOrDefault();

Thanks for that… all our Projects are prefixed with PJ so I didn’t think of the compare part

Totally not a BPM answer, but for things this complicated, I tend to just make a BAQ and have a tile that someone has on their home screen.

These are for GL controls on supplier and customer. It shows exceptions - either no GLC or a wrong one. So when the tiles are empty, all is well.

If you want something more automated, there are lots of discussions on running a BAQ nightly and having it email a report, etc.

The tile thing works OK, as long as you make sure YOU are not the only one monitoring. It has to be the users to take ownership.

2 Likes

And copying the relevant person’s boss, will add extra incentive for people to get it right the first time. :wink:

2 Likes

Looking to do something similar here, when a Supplier does not have a GL control assigned to it. Would love to see how you put this together…

Hey @tleatherman welcome to the group.

Pretty sure you are asking me since you replied to my post, but I figure I’ll ask.

So, I imagine there are 10 other strategies, most of which are better than mine, but what I did was:

  1. Subquery1: (Left) join of Vendor table to EntityGLC table.
    a. Company = Company
    b. 'Vendor' = RelatedToFile [this makes more sense backwards]
    c. VendorNum = convert(int, GLCdata.EntityGLC_Key1)
    d. (This returns all vendors)
  2. Top Level query:
    a. Subquery1, filtered to when GLCdata.EntityGLC_Key1 is null

In practice where I work, it’s more complicated.

  • In site A, no GL is just fine
  • In site B, it needs a GL, but… I want the GL Control Code to begin with a certain prefix only when the vendor starts with a different prefix.
  • So I have 3 subqueries, and I include the GLCntl table

As you might have deduced, site A came first, and then we had to wedge site B into the equation.

1 Like

Jason, thank you!

Yes, I liked your approach of monitoring the report as opposed to a warning such as a BPM.

For now, we are simple in the sense of being a single company so I believe the first suggestion with just 2 queries will do the job.

Yeah, the GLC multiverse is a strange one. It’s a catchall, as opposed to having individual tables for every GL control possibility. I get that that would be unmanageable for the dev team, but the flip side is that it’s somewhat unmanageable for us admins.

There’s this chart that I have to go back to to decipher the “RelatedToFile” names and what the keys map to. It’s from KB0028094. The article is about TranGLC (not EntityGLC), but it’s the same idea.

I’ll go easy and not explain the difference today…

1 Like