In Acumatica, using #me inside Relations Section of Generic Inquiry - acumatica

We want to have a sales order dashboard where we only show orders for certain sales people based on the logged in user. For example, we have sales people BB and CR who share an assistant TP. BB can see his orders on the dashboard. CR can see his orders on the dashboard. TP can see orders for both of them on his dashboard. We also have people outside of sales who need to see all orders. We want to do all of this without having to create a bunch of custom dashboards. We wanted to maintain 2 dashboards - one filtered one for sales people and one unfiltered one for everyone else.
We have gotten close to solution by using a generic inquiry. We created custom fields on the salesperson that point back to a logged in user (UserID1 and UserID2). Multiple custom fields were used because a single sales person could be visible to 2 people. We then joined SOOrder to SalesPerson inside our GI. We then wanted to join the Users table on (SalesPerson.UserID1 = Users.PKID AND SalesPerson.UserID1 = #me) OR (SalesPerson.UserID2 = Users.PKID AND SalesPerson.UserID2 = #me). That would allow us to create a filter where Users.PKID is not null to limit the view for sales people and then not use any filter on the non-sales dashboard.
The problem is that #me is not available on the Relations section. It is only available on the conditions section. We tried to just have the join of SalesPerson.UserID1 = Users.PKID or SalesPerson.UserID2 = Users.PKID and then creating the condition for the #me portion. The issue there is that it only shows records with a match. That won't work for non-sales people.
Is there some way to include #me or an equivalent on the relations tab? Any better way to accomplish this?

Built-in variables like '#me' aren't well documented which raises questions about support of this feature.
Try this instead:
In generic inquiry TABLES tab, add table 'PX.Data.AccessInfo'.
In PARAMETERS tab, add a new parameter (ex: 'P1') and set the Schema Field value to 'Accessinfo.UserID' (use 'Accessinfo' or the alias for that table declared in TABLES tab).
In the RELATIONS tab in the join condition Child Field you can reference the '[P1]' variable.
Accessinfo DAC contains current record of the logged in user and reflects the information you see when you click your profile in the top right of Acumatica pages. If the solution doesn't work right away you can debug it with the Request Profiler page to look up the generated SQL query for the GI.

Related

Display Customer Activity Notes on Sales Order After CustomerID entered

I have a request from a pop up of the Customers Activity Notes after the Customer ID has been entered on a sales order. Currently they have set up specific instructions for entering an order for customer (could be different for each customer). We have entered them under the customers Activity Notes with a specific ID in the subject field. The notes will be in the body of the activity.
Rather then copy this info to the Sales Order Activity Notes, they would just like to display the Activity Notes from the Customers Activity Notes.
Has anyone done something like this or have any though as to how this could be accomplished.
You could proceed one of two ways:
First way is you could create a button in which it would fetch the associated customer's notes and display them.
The second way is that you could override the PXSelecting action for the page and make sure the Customer ID selector has commit changes set to true.
Either way you go, you will need to fetch the notes using the customer's NoteID field from the Note table. One method would be:
BAccount cust = PXSelect<BAccount, Where<BAccount.bAccountID, Equal<Current<SOOrder.customerID>>>>.Select(Base);
Note custNote = PXSelect<Note, Where<Note.noteID, Equal<Required<BAccount.noteID>>>>.Select(Base, cust.NoteID);
This should get you the result you desire. You can then display it however you choose.
NOTE: Please let me know if there are any syntax errors and I will correct them ASAP.

Add Item Functionality In Opportunity customization Filtering Issue

I have added a add item functionality like Sales Order in Opportunity. I have followed the same functionality of Sales Order.
The Add Item works fine, but the filtering on Inventory is not filtering the records. I have compared the aspx code and not able to figure out the issue
If you refer the implementation of similar smart panel in SO301000 ASPX, it is performed via FastFilterID property of PXGrid.

Filtering based off #me

I have created a custom screen that records a "SalesPerson" ID that links back to the Salespersons records.
One of the requirements is to create an inquiry screen (not generic inquiry) that has a filter for the current sales person (based on logged in user). The Filters should be "All Records" / "My Items" with the second being the default displayed (based on the recorded "Sales Person)
For this, The PXSelect statement links {customtable} -> {employee} (where salesperson record = employee.salesperson
I even extended that to link employee.userId -> users.pKid.
The actual select statement is below:
public PXSelectJoin<CWAItem,
LeftJoin<EPEmployee,On<CWAItem.salesPersonID,Equal<EPEmployee.salesPersonID>>,
LeftJoin<Users, On<Users.pKID,Equal<EPEmployee.userID>>>>> MobileOrders;
Both of these correctly display the user name in the grid however when i create a filter where EPEmployee__UserID = #me or Users.UserName = #me no records are returned.
Scanning through the system this appears to be used on the "WZ201500" screen that has a simular filter. The difference that I see is this is referencing "EPEmployee_UserId" based on the table definition.
Is there a limitation to using child DAC's and the #me or is there a different way to handle the joins so the #me works correctly?
Any assistance would be appreciated.
Having not used #me I am not sure what this refers to, however we did something similar limiting records based on the current user ID using access info like such:
Where<EPEmployee.userID, Equal<Current<AccessInfo.userID>>
Hope that helps
Just use the Table AccessInfo then Default Value of your Filter Equals to AccessInfo.UserID to any of the Table Field you need like CreatedByID or ModifiedByID

Lotus Notes View does not hide the level of details within a column - notes domino designer

I have a View in Lotus notes by formula.
The View is as follows by Org Exec \ Organization \ Total Headcount
I have a "show twistie when row is expandable" enabled and "Categorized" selected as Type for the column "Org Exec" & "Organization"
For example data looks like this: Marshell Rodrigues \ Tester \ 100
However my problem is that tester has the list of 100 people within it and i do not want to show that level of details in the view? I want Organization not to show the list of people within it.
I tried the Hide detail row on the Organization column properties but that does not work it still shows data within the organisation in the view
any ideas or suggestion ?
What is the purpose of the view?
I am trying to Export this View in Excel Using ODBC Connection Thus i want the details at a higher level
What kind of documents are in the database?
Each employee has his record in the database with his details liek organization , execs, headcount name, serial number .
What kind of information should be displayed ?
Like i said the information to be displayed need to be at a high level for example :
Give me All Organization Execs by Organization Total Headcount (i just want the total number i do not want to see a drill down on thoes numbers in the view)
Example if Org "abc" has 10 headcount i just want it to display 10 ... i do not want to see who thoes 10 people are.
and from which docs does the info come from?
All the docs have a fields named Org Execs and Organisation and Headcount(were Headcoutn can be 1 if working and 0 if not working for individual month)
What are the column formulas?
Select form = "xyz" ....
Columns Org Execs \ Organization \ HeadCount (All 3 are fields in each record)
I would call that a "roll-up report", but views in Lotus Notes are not reports. They are designed to give users access to documents. Summarizing data (with totals, percentages, etc.) is just an additional feature that was thrown in on top of the functionality for accessing documents.
There are a variety of reporting products for Notes, and they are designed to do what you want. You might want to look into them if you have a lot of similar requirements for a lot of different views.
There is also a way that you could do this with ReaderNames fields and an ID file that does have access to the database but doesn't have access to the documents. Categories that are "empty" (i.e., contain no documents) will show up for a user, but this is a hack and not the right way to approach the problem. I really do not recommend it. (It will probably only work for viewing anyhow. I doubt an export will actually work in this setup, though I confess I've never tried it, and maybe it will.)
If this is just a one-off job, my suggestion would be to write an agent to collect the summary information that you want and either create summary documents in a folder, which you could then export and delete; or to have your agent directly write the data to Excel.

Filemaker main overview table records

I have two tables: businesses and leads. businesses is the parent table; A record in businesses may have many leads.
My leads table holds data like "calls, appointment, etc etc" - all searchable.
I'm trying to create a layout to sort all of my businesses by my lead information, either with a portal filter or list view.
The goal is to help me figure out who I need to call or see today.
Go into Manage Database and make sure you have an actual relationship setup between businesses and leads.
Then make a layout based on the businesses table and add a portal to that layout based on the leads, which will show up in the drop-down because of the relationship. You'll also see options in the portal properties to sort by whatever column(s) you want.

Resources