how to create Record level security with Extended data type Field? - axapta

I want to create RLS for field MainAccountId (for EX hide accountants starting with 150* for some users and appear to others) which is EDT from MainAccountNum
when i made RLS (putting criteria !150*)for this field nothing change

Related

Go to different main table from same field AX 2012

I have a InvoiceAccount field in table. And another field in this table is PackingSlipAXType. If PackingSlipAXType is Sales, InvoiceAccount field value is customer account. If type is PurchReturn, InvoiceAccount field value is vendor account.
When value is customer account, when right click and go to main table i want to go Customer
and
When value is vendor account, when right click and go to main table i want to go vendor.
How can i do this in same field?
There are two primary ways. One is code and the other is using native MorphX and Conditional Table Relations. Code gives you more flexibility, but conditional table relations are simpler and "just work".
Conditional Table Relations
Using conditional table relations. I created a new table and AccountNum would represent a customer or vendor account, and the base enum SalesPurch is used to indicate if it is a Customer Account (Sales) or a Vendor Account (Purch). Similar to your setup.
See conditional table relations - https://learn.microsoft.com/en-us/dynamicsax-2012/developer/conditional-table-relations
See here for more info too.
Custom JumpRef & Lookup
You will likely want both a jumpRef and a lookup to both go to the correct main table and lookup the correct values.. This is code, but you have all the flexibility in the world...but may not need it.
Jumpref - https://community.dynamics.com/365/financeandoperations/b/faisalfareedaxlibrary/posts/ax-2012-how-to-use-jumpref-method
Lookup - https://learn.microsoft.com/en-us/dynamicsax-2012/developer/how-to-add-a-lookup-form-to-a-control
Jumpref example at \Data Dictionary\Tables\TmpCostAllocationBase_RU\Methods\jumpRefAgreement
Lookup example at \Data Dictionary\Tables\TmpCostAllocationBase_RU\Methods\lookupAgreement

Alfresco. How to show the form field by condition?

Good afternoon. There is a business process with many tasks. In one of the tasks there are two association fields (for simplicity, let's call their field 1 and field 2). As when opening this task, check the value in field 1 and, depending on its value, hide or show field 2?
You can copy the OOTB free marker (.ftl) file for your control. e.g. selectone.ftl located at
alfresco-home\tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\form\controls
then add JavaScript code to it to show/hide your fields.

Why does the `FetchMode` query property remove fields from the parent data source?

When opening the query SalesTableListPage from the AOT, you can choose the field MatchingAgreement (shown as "Agreement Header record ID (Record-ID)") in the field lookup. The same is not possible for query SalesUpdate, field MatchingAgreement and several others (which seem to be related to relation fields where the relation is built with a RecId) are not shown in the lookup.
After some research I found out that the reason seems to be the FetchMode property on the joined SalesLine data source. If it is 1:n, the fields are not shown in the lookup. If it is 1:1, the fields are shown in the lookup.
I have not tested this with other tables, but I suspect the same behavior. I also have only tested this with AX 2012 R2 and R3, but I suspect the same behavior in other 2012 versions.
Why does the FetchMode of a joined data source remove some fields from the parent data source in the query dialog?
TL;DR Field lookups in the query dialog do not always work for relation fields that define relations to tables where the AutoIdentification field group's property AutoPopulate is set to No. One case where they not work is when a data source is joined with FetchMode 1:n.
While Alex K's answer has some interesting suggestions, in my case the culprit is the AutoPopulate property on the AutoIdentification field group of table AgreementHeader. In sys layer, this property is set to No and the group contains the fields that are shown in the query dialog field lookup if the relation in the query is 1:1. If this property is switched is to Yes the lookup will show field Agreement header record ID (Record-ID) (and only this field, no matter how the FetchMode of the query relation is defined).
Basically, AX will use the information from the AutoIdentification field group to determine the information shown in the gui in case of surrogate key references/relations. If the AutoPopulate property of the field group is Yes, AX will use the alternate key of the table to determine the fields to use. If no alternate key exists (which is the case for table AgreementHeader), AX uses the relation field. If AutoPopulate is No, the fields defined in the group are used. But as described this option does not work if the relation in the query is not 1:1 (and unfortunately no fallback option like using the relation field seem to have been implemented).
FetchMode AutoPopulate Lookup
1:1 Yes AlternateKey (or Relation) fields
1:1 No AutoIdentification fields
1:n Yes AlternateKey (or Relation) fields
1:n No Nothing
Update:
I came upon this problem again, but with field SalesTaker this time. Turns out that the AutoPopulate property is only part of the story, because it did not solve the problem when set to Yes on table HcmWorker. This table (unlike table AgreementHeader) also has the property ReplacementKey set, which AX uses to populate the AutoIdentification field group. Only after I removed the ReplacementKey no fields appeared anymore in AutoIdentification and the lookup now showed "Sales taker (Record ID)". So bottom line is that the AutoIdentification field group must not contain any fields.
If the dynamic property of both query fields is set to yes, then I'd suspect it has something to do with the properties of one of these relations:
\Data Dictionary\Tables\SalesTable\Relations\Agreement
\Data Dictionary\Tables\SalesLine\Relations\SalesTable
Maybe try adjusting those, refreshing your cache (AOT changes to be picked up), clearing usage data (packed queries can cause problems), and updating XRef (Advanced querying uses XRef, so may not be necessary for standard query functionality)

Lookup field appears as numerical values instead of text on Access report

I am trying to create a report putting a field called contact which has the name of a person. This name is linked directly to another table where I keep all the contacts.
For some strange reason, when I include this name (which in query view displays as the name of the contact), instead of the name appearing, the unique ID number is shown on my report.
As mentioned in the article cited in the above comment, you can use a Combo Box control on your report to do the lookup for you. To see how this can be done, create a new report based on the table containing the lookup field, then drag and drop that field onto the report. That will create a Combo Box control with properties that look something like this:
Row Source: SELECT [Clients].[ID], [Clients].[LastName] FROM Clients;
Bound Column: 1
Column Count: 2
Column Widths: 0";1"
You could use a similar Combo Box control on your actual report to display the client's name rather than their numeric ID value.
Another alternative would be to change the Control Source of the report's Text Box control to have it do a DLookUp() on the table. If the lookup field is named [client] then changing the Control Source of the Text Box to something like
=DLookUp("LastName","Clients","ID=" & [client])
would also work.
I wanted to add to the great answer by Gord:
When using a "web" database (started in Access 2007 I think), you cannot change a report's fields to ComboBox style, nor can you use DLookUp(). (web databases lack a ton of features)
The workaround for this, if you want to create a Web-Report that uses lookup fields, is to create a Web-Query first based on your Web-Table (all the Web-* stuff has a www planet icon over the logo, if you create a new Web-DB in Access 2007+ you'll see what I mean)
So, instead of Table -> Report, you'll have to do W-Table -> W-Query -> W-Report.
Then, the only thing you need to customize to get the data right is the W-Query. Start by trying to reproduce the look in the query to match what you want users to see in the report. Note that here in the query, lookups will work fine (instead of the unique ID's, you get field names like you want). However, this will not carry over to the report. To do that, you gotta get the actual text field name you want into the query:
You should already have one table in your query; start by adding the table that your first lookup field points to. For example, the table I want to print is called Stock_Boards, and it has a lookup field called PCBID_lookup that points to the table Stock_PCBs.
Since you're using lookup fields, there should already be a relationship line between the two tables when you add the second one. If there isn't, something has gone horribly wrong.
Now, see how that line connects two fields on the two different tables? For example, I've got my PCBID_lookup field on my Stock_Boards table, which connects to the ID field on my Stock_PCBs table. If I created a report from this now, PCBID_lookup would be a number, a number that correlates to the ID of a record on Stock_PCBs.
To fix it, I will add the name field I want to show up on the report. In my example, that happens to be a Part Number, rather than the ID. I add the PartNumber field from my Stock_PCBs table to the query, and remove the PCBID_lookup field of the Stock_Boards table from my query.
Since PartNumber is what I want to show up on my report, it effectively replaces the original field (PCBID_lookup)
Repeat for all lookup fields you want in your report.
I had 1 more: I removed the Status field of the Stock_Boards table (which was an ID/Lookup) and added the 'Status' field from the Status table (which was the actual text name)
When finished, your query should look exactly how you want the data to appear, without any special tricks or asking Access to do something unnatural. Save your query, and create a web-report from it. Done!

Combine 2 user profile fields to provide "Add More" to the whole field

I am trying to create a user profile field in drupal 7 that combines multiple fields and can have multiple values.
For Example,
the field is "Past Job Title" ,"From Year", "To Year" and the whole field ( having 3 sub fields ) can have multiple values thus can have values like
< "Google" , 2000, 2003 ><br/>
< "Facebook" , 2003, 2007 ><br/>
< "Xerox", 2007, 2009 ><br/>
The user should be able to add as many values he/she wants.
In Drupal 7, Multiple Values for a single field can be enabled by setting Number of Values to Unlimited, but how to do in case of multiple fields combined together.
Please Do Suggest...
I believe what you are looking for is the Field Collection module. It allows you to group fields together and allows the entering of many groups. The following article gives a good description of what the module does: Create Multigroups in Drupal 7 using Field Collections
From the Field Collection project page:
Provides a field-collection field, to which any number of fields can
be attached.
A field collection is internally represented as an entity, which is
embedded in the host entity. Thus, if desired field collections may be
viewed and edited separately too.
How can we validate each field collection entity?
Let me Explain:
I have used field collection in line item types.
Line Item type = People
Field collection fields are:
Title
First Name
Last Name etc
I have given the number of values: unlimited. That's why add another item button is appearing.
Now, if user entered values in one set and left others blank and then clicked on add to cart button then, how can stop him to continue further.

Resources