Im creating a serach class based on five parameters from three different tables.I used a query to join tables and the query executing if i pass all the parameters.But for me the user can search on any combinations of parameters.For example he might search based on two parameters say name and age.How to achieve this.
Actually i tried assigning default values but AX accepts optinal parameters from last(coorect if im wrong).But for me i want all the five parameters to be optional…
I will be calling this method from .net using business connector. So i ll be declaring this method as static. So ill not be able to use the instances or fields declared in class declaration. So while passing the default parameter im getting an error varibale not been declared.
When you tried to create sales orders through .Net BC (I am referring to your earliest post), you were already calling static methods declared in Dynamics Ax.
In particular NumberSeq class → newGetNum method. There are 3 parameters however only one is mandatory. Code snippet below -
The main difference between static and other method types is - in static method, it is not possible to use member variables. Therefore you cannot use variables like dob, firstname and lastname as you have done in your above example.
By default if you want to keep empty or null values, you should do like this -
The main difference between static and other method types is - in static method, it is not possible to use member variables. Therefore you cannot use variables like dob, firstname and lastname as you have done in your above example.
By default if you want to keep empty or null values, you should do like this -
This is the search query im using for searching a customer based on any of these five criteria.The user can search on all paramters or any combination out of these five parameters.When im executing this query(with OR condition) im getting duplicate values and if im using a AND condition in this query empty record is returned.Suggest me a solution to resolve this.
select AccountNum, Name,Address from _custTable where
_custTable.BirthDate == DOB
join _partyTable
where
_partyTable.PartyId == _custTable.PartyId &&
_partytable.FirstName like _firstName ||
_partyTable.LastName like _lastName
join _custIdentification
where
_custIdentification.CustomerIdentificationTypeId like _identificationType &&
_custIdentification.IdentificationDetails like _details ||
_custTable.AccountNum == _custIdentification.CustomerId ;