The difference of search logic in the RefNbr field on the Bill and Adjustments screen between 2017 R2 version and 2021 R2 version of Acumatica System - customization

I have some questions about the business logic of RefNbr Searching functionality in Bill and Adjusments screen of Acumatica System.
In 2017 R2 Version, if I write some number in RefNbr field, system will show all related RefNbr and order by descending. Please the following screenshot.
But in latest version (2021 R2 version), it shows all related RefNbr but seems like using Ascending sort order.
Is it possible if I try to customize to provide as logical same as 2017 R2 version for this latest version ?
If it's possible, in which class and method should I customized ?
Thanks.

You can override the RefNbr declared attributes. Be sure to set the Search sorting order to descending.
[PXDBString(15, IsKey = true, IsUnicode = true, InputMask = ">CCCCCCCCCCCCCCC")]
[PXDefault()]
[PXUIField(DisplayName = "Reference Nbr.", Visibility =
PXUIVisibility.SelectorVisible, TabOrder = 1)]
[APInvoiceType.RefNbr(typeof(Search2<Standalone.APRegisterAlias.refNbr,
InnerJoinSingleTable<APInvoice, On<APInvoice.docType,
Equal<Standalone.APRegisterAlias.docType>,
And<APInvoice.refNbr, Equal<Standalone.APRegisterAlias.refNbr>>>,
InnerJoinSingleTable<Vendor, On<Standalone.APRegisterAlias.vendorID, Equal<Vendor.bAccountID>>>>,
Where<Standalone.APRegisterAlias.docType,Equal<Optional<APInvoice.docType>>,
And2<Where<Standalone.APRegisterAlias.origModule, NotEqual<BatchModule.moduleTX>,
Or<Standalone.APRegisterAlias.released, Equal<True>>>,
And<Match<Vendor, Current<AccessInfo.userName>>>>>,
OrderBy<Desc<Standalone.APRegisterAlias.refNbr>>>), Filterable = true, IsPrimaryViewCompatible = true)]
[APInvoiceType.Numbering()]
[PXFieldDescription]
public string RefNbr { get; set; }

Related

Change Visual data field name for a powerbi embedded report

I have a powerbiembedded report. I need to change the data field in one of the visual of the report. I looked through the API but couldn't find one. Can Any one help me how can i can change the dispaly name using API.
setDataFieldDisplayName can be used to change the data field of the visual.
1.Get the data field display name of the visual. This methods take two variables as parameters. dataRole and index.
const oldDisplayName = await lastCreatedVisual.getDataFieldDisplayName('Y', 0);
Use the API to change the data field of the visual. This methods take three variables as parameters. dataRole, index and newDisplayName.
const newDisplayName = "NEW_DISPLAY_NAME"; // New DisplayName to be Updated await lastCreatedVisual.setDataFieldDisplayName('Y', 0, newDisplayName)
References:
https://learn.microsoft.com/javascript/api/powerbi/powerbi-report-authoring/visualdescriptor.visualdescriptor#powerbi-report-authoring-visualdescriptor-visualdescriptor-setdatafielddisplayname

IF statement equivalent in Google Data Studio

I am trying to replicate the Excel formula
IF(AND('cost'> 0, 'orders' = 0),"TRUE") in Google Data Studio using the CASE statement:
CASE
WHEN COST > 0 AND ORDERS = 0 THEN "TRUE"
END
However, I receive the following error:
Only numeric literals are allowed if aggregated fields are used in CASE
Is there a way I can fix this?
Summary
Use Either #1 or #2.
To elaborate on the difference between using "True" and TRUE, the Semantic Type of:
#1 is Boolean (TRUE or FALSE);
#2 is a Text field (note the quotes around "TRUE" or "FALSE"):
1) IF
The Conditional Function, IF, was introduced in the 11 Mar 2021 Update; thus, tweaking the IF function in the question now works as expected in Google Data Studio.
Note: The Calculated Field below is a Boolean field; thus, to create a Text field, replace TRUE with "TRUE" and replace FALSE with "FALSE":
IF(Cost > 0 AND Orders = 0, TRUE, FALSE)
2) CASE
Alternatively, the CASE statement proposed in the question should work as expected. That said, the CASE statement below explicitly states the ELSE clause.
Note: The Calculated Field below is a Text field; thus, to create a Boolean field, replace "TRUE" with TRUE and replace "FALSE" with FALSE:
CASE
WHEN Cost > 0 AND Orders = 0 THEN "TRUE"
ELSE "FALSE"
END
Editable Google Data Studio Report and a GIF to elaborate:
The Google Data Studio team released a new IF function and a more convenient way to use CASE.
The update: Release notes (11 Mar 2021)
IF(Actual Sales > Forecast Sales, Bonus * 1.2, Bonus)
The documentation is in IF.
If it's not working, then use the below CASE documentation link. It is supposed to appear on the sidebar just where the two CASE support articles are.
CASE Premium Status
WHEN "Platinum" THEN CONCAT(Site URL, "platinum_welcome.html")
WHEN "Gold" THEN CONCAT(Site URL, "gold_welcome.html")
WHEN "Silver" THEN CONCAT(Site URL, "silver_welcome.html")
ELSE CONCAT(Site URL, "welcome.html")
END
CASE (simple)
I don't think there is an IF statement in Google Data Studio; however, your CASE WHEN should work. I tried to reproduce your problem:
I created a Google Sheet with two columns, cost and orders, and filled in some numbers
I created a data source connected to this sheet
I made a table in a Google Data Studio report using this data source, and added a calculated field with your exact formula
It didn't give me any error messages and the field values are as expected
From the error message it feels like this is related to where your data source comes from.

Dynamics Navision 2018 - Insert Sales Order Discount using Web Services

I have Navision Dynamics 2018 Update 10 which has Sales Orders exposed as a SOAP web service.
The problem raises when we want to set Invoice Discount which is not available in SO header and it appears in SO Lines as read only property :(
How could I set the invoice discount using the Web Service.
I use the following code: You have tu set Invoice_Discount_AmountSpecified false ; if you want to set a number in Invoice_Discount_Amount
foreach (var linea in resLineas)
{
order.SalesLines[contLineas].Invoice_Discount_AmountSpecified = false;
pedido.SalesLines[contLineas].Invoice_Discount_Amount = 5;
contLineas++;
}
servicio.Update(ref order);

How to apply Entity_Filter as OR in Dynamics NAV WebService

I am consuming a Dynamics NAV 2009 WebService (SOAPish). Specific I am talking about the ReadMultiple method MSDNA
The filterArray takes an array of Entity_Filter objects. Each Entity_Filter has a Field and Criteria property.
Now I want to know, how I can apply the filters as OR not and.
For Example I am passing two filters:
Entity_Filter { Field: "Name", Criteria: "*banana*" }
Entity Filter { Field: "Color", Criteria: "yellow"}
If I send this to the ReadMultiple I get all entries that have "banana" as part of the name AND the color yellow. What do I have to do, to get all Entries that have "banana" as part of the name OR the color yellow?
Unfortunately, there is no way to apply an 'OR' filter on a record. ReadMultiple method applies filters the same way C/AL methods SETFILTER or SETRANGE do. It has to be done in two separate requests.
On the second thought, you can do it in a single request, but with an OData service using Linq:
NAV nav = new NAV(new Uri("http://ServerName:Port/DynamicsNAV71/OData/Company('Your Company Name')"));
nav.Credentials = CredentialCache.DefaultCredentials;
var items = from i in nav.ItemsList where i.Name.Equals("Banana") || i.Color.Equals("Yellow") select i;
Where 'ItemsList' is an OData web service of type 'Page'

Dynamics Nav (Navision) webservice ReadMultiple date filter

Using the Navision webservices, how can you filter by a date.
i.e. Within a SalesHeader table there is an "ExportedDate". I would like to find all SalesHeaders where the ExportedDate has not been set or were exported on a particular date.
It seems that whenever we set a filter on a date field, then the webservice will either return all rows or no rows.
This can be done. You have to use the same filter expression as you would use in the Nav Client:
01012011.. would be all dates from 01.01.2011
..01012011 would be all dates to 01.01.2011
01012011..03012011 gets all dates between 01. and 03.
After publishing page 42 (Sales Order) as a web service in NAV, I added a web reference to the newly created web service in my Visual Studio project. In the C# code, I create a new instance of the service, and tell it to use the default credentials:
SalesOrders_Service salesOrdersService = new SalesOrders_Service();
salesOrdersService.UseDefaultCredentials = true;
Then I instantiate a filter, and set the field and criteria:
SalesOrders_Filter filter = new SalesOrders_Filter();
filter.Field = SalesOrders_Fields.Document_Date;
filter.Criteria = "01-31-14|''"; // specific date (MM-dd-yy) or empty
The filter instance is then added to a new array of SalesOrders_Filters before passing the latter to ReadMultiple:
SalesOrders[] salesOrders = salesOrdersService.ReadMultiple(new SalesOrders_Filter[] { filter }, null, 0);
On my machine, this returns two orders whose Document Date is 31 January 2014, and one order with a blank Document Date.