Options

My Customers, My Vendors, My Items

jreynoldsjreynolds Member Posts: 175
edited 2009-01-31 in NAV Three Tier
These three pages are ListParts and are used in the definition role centers pages. Each of these pages is based on a new table My Customer, My Vendor, and My Item. Each of these tables has a function called AddEntities that adds records to the table. A sample of this function for My Item is shown below.
PROCEDURE AddEntities@1(FilterStr@1000 : Text[250]);
VAR
  Item@1001 : Record 27;
  Count@1002 : Integer;
BEGIN
  Count := 0;

  Item.SETFILTER("No.",FilterStr);
  IF Item.FINDSET THEN REPEAT
    "User ID" := USERID;
    "Item No." := Item."No.";
    IF INSERT THEN
      Count += 1;
  UNTIL Item.NEXT = 0;
END;
The functions in the other two tables are similar. I have not been able to find anywhere that these functions are used and I am wondering if anyone knows their purpose.

Comments

  • Options
    freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    I can tell you what they do (add all items that matches the filter to the list) - but you probably already figured that out.
    I don't know where they are used and why they count the number of records in a local variable - but it could be related to some testing that hasn't been removed (just a guess)
    Freddy Kristiansen
    Group Program Manager, Client
    Microsoft Dynamics NAV
    http://blogs.msdn.com/freddyk

    The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
  • Options
    kinekine Member Posts: 12,562
    They will be used on the listplaces in the function which allows you to add some Item, Customer or Vendor into your list..
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    jreynoldsjreynolds Member Posts: 175
    I’m developing a role center for a Maintenance Supervisor. I want a list part for My Assets similar to My Customers or My Items. I developed a My Assets page (copied from the My Items page) based on a My Asset table (copied from the My Item table). In addition to the obvious changes to replace Items with Assets I removed the AddEntities function in the My Asset table. I put the My Assets page into my new role center and everything worked just fine. It would appear that the AddEntities function is not necessary.

    Additionally, I exported all objects to a text file and did a string search in the text file for “AddEntities”. The only three occurrences in the entire text file were the three instances where this function is defined in My Customer, My Vendor, and My Item. AddEntities is not referenced anywhere else in the entire system. So my guess is that Freddy is correct and this is left over from some testing that has been removed. If this is indeed the case, I wish Microsoft would remove these functions from these tables as they only cause confusion to people trying to figure out how the system works.
Sign In or Register to comment.