hi all,
i have created a list page it is throwing a pop up window when i run the list page kindly help me .
the messgae is Select a record type to create
thank you .
hi all,
i have created a list page it is throwing a pop up window when i run the list page kindly help me .
the messgae is Select a record type to create
thank you .
Hello expert please i need help to pass list of object to data contract
first, i create a data contract
[DataContract('Colors')] class ColorDataContract { Name colorName; DataAreaId dataAreaId; [DataMember] public Name parmColorName(Name _colorName = colorName) { colorName = _colorName; return colorName; } }
second, create a service class
class ColorService { public void InsertColor(ColorDataContract colorObj) { ColorsTable _color; Name _name; _name = colorObj.parmColorName(); ttsbegin; _color.Name = _name; _color.insert(); ttscommit; } } public void insertColorList(List colorList) { ListIterator iterator; ListEnumerator enumerator; ListIterator literator; ColorDataContract colorDataContract; enumerator = colorList.getEnumerator(); while(enumerator.moveNext()) { colorDataContract = enumerator.current(); if(colorDataContract != null) { this.InsertColor(colorDataContract); } } } }
after that, I create a new service group and service and assign the method to the service, etc. everything until this point is working fine
In the code below i try to consume custom service in json using the Microsoft simple integration
github.com/.../d365fo.integrations
my problem is how to pass the list to my contract into JSON
i can pass data to insertColor method without any issue my problem with insertColorList method
static void Main(string[] args) { string sessionUrl = "/api/services/XXXServices/XXXColors/insertColorList"; string GetUserSessionOperationPath = string.Format("{0}{1}", ClientConfiguration.Default.UriString.TrimEnd('/'), sessionUrl); var request = HttpWebRequest.Create(GetUserSessionOperationPath); //how to pass the list to my service //Post one color //var con = new ArafaContractList(); //con.parmColorName = "Blue"; //var contract = new { colorObj = con }; string json = JsonConvert.SerializeObject(contract); Byte[] byteArray = Encoding.UTF8.GetBytes(json); request.Headers[OAuthHelper.OAuthHeader] = OAuthHelper.GetAuthenticationHeader(true); request.Method = "POST"; request.ContentLength = byteArray.Length; request.ContentType = "application/json"; using (var stream = request.GetRequestStream()) { stream.Write(byteArray, 0, byteArray.Length); } using (var response = (HttpWebResponse)request.GetResponse()) { using (Stream responseStream = response.GetResponseStream()) { using (StreamReader streamReader = new StreamReader(responseStream)) { string responseString = streamReader.ReadToEnd(); Console.WriteLine(responseString); } } } Console.ReadLine(); }
Hi. I'm making a view, and I have some questions.
I made a view showing the label of enum.
but, it's showing the label of english.
I want to show Korean labels.
What should I do?
my source code
public static server str genderString()
{
tableName viewName = identifierStr(salesLineTestView);
DictEnum dictEnum = new DictEnum(enumNum(SalesStatus));
Map enumValues = new Map(Types::String, Types::String);
int n;
for (n = 0; n < dictEnum.values(); n++)
{
enumValues.insert(int2Str(dictEnum.index2Value(n)), SysComputedColumn::returnLiteral(dictEnum.index2Symbol(n)));
}
return SysComputedColumn::switch( SysComputedColumn::returnField( viewName, identifierStr(SalesTable), fieldStr(SalesTable, SalesStatus)), enumValues, SysComputedColumn::returnLiteral(dictEnum.index2Symbol(n)));
}
Hello expert, I need some help to pass a list of object and return it
1- Create data contract
[DataContract('Customers')] class AHCustomerDataContract { AccountNum accountNum; Name custName; [DataMember('AccountNum')] public AccountNum parmAccountNum(AccountNum _accountNum = accountNum) { accountNum = _accountNum; return accountNum; } [DataMember('CustName')] public Name parmCustName(Name _custName = custName) { custName = _custName; return custName; } protected void new() { } private static AHCustomerDataContract construct() { return new AHCustomerDataContract(); } public static AHCustomerDataContract newFromTableRecord(CustTable _custTable) { AHCustomerDataContract contract = AHCustomerDataContract::construct(); contract.parmAccountNum(_custTable.AccountNum); contract.parmCustName(_custTable.name()); return contract; } }
2- Create list data contract
[DataContractAttribute] class AHCustomerListDataContract { List customerList; protected void new() { customerList = new List(Types::Class); } public static AHCustomerListDataContract construct() { return new AHCustomerListDataContract(); } public void addCustomerToList(AHCustomerDataContract _customerDataContract) { customerList.addEnd(_customerDataContract); } [DataMember,AifCollectionType('return',Types::Class,classStr(AHCustomerDataContract)) ,AifCollectionType('_custList',Types::Class,classStr(AHCustomerDataContract)) ] public List parmCustomerList(List _custList = customerList) { customerList = _custList; return customerList; } }
3- Create service class
[AifCollectionTypeAttribute('customerList',Types::Class,classStr(AHCustomerDataContract))] public AHCustomerListDataContract getCustomerList(List customerList) { ListIterator iterator; ListEnumerator enumerator; ListIterator literator; AHCustomerListDataContract customerListDataContract = AHCustomerListDataContract::construct(); AHCustomerDataContract customerContract; enumerator = customerList.getEnumerator(); while(enumerator.moveNext()) { customerContract = enumerator.current(); if(customerContract != null) { customerContract = AHCustomerDataContract::newFromTableRecord(CustTable::find(customerContract.parmAccountNum())); customerListDataContract.addCustomerToList(customerContract); } } return customerListDataContract; }
4- consume the service in JSON
static void Main(string[] args) { GetCustomerList(); } class AHContract { public string parmAccountNum { get; set; } public string AccountNum { get; set; } } public static void GetCustomerList() { // In the AOT you will find UserSessionService in Service Groups and AifUserSessionService under Services. string sessionUrl = "/api/services/AHServices/CustomerServices/getCustomerList"; string GetUserSessionOperationPath = string.Format("{0}{1}", ClientConfiguration.Default.UriString.TrimEnd('/'), sessionUrl); var request = HttpWebRequest.Create(GetUserSessionOperationPath); List<AHContract> custList = new List<AHContract> { new AHContract{AccountNum = "US-001"}, new AHContract{AccountNum = "US-003"} }; var contract = new { customerList = custList }; string json = JsonConvert.SerializeObject(contract); Byte[] byteArray = Encoding.UTF8.GetBytes(json); request.Headers[OAuthHelper.OAuthHeader] = OAuthHelper.GetAuthenticationHeader(true); request.Method = "POST"; request.ContentLength = byteArray.Length; request.ContentType = "application/json"; using (var stream = request.GetRequestStream()) { stream.Write(byteArray, 0, byteArray.Length); } using (var response = (HttpWebResponse)request.GetResponse()) { using (Stream responseStream = response.GetResponseStream()) { using (StreamReader streamReader = new StreamReader(responseStream)) { string responseString = streamReader.ReadToEnd(); Console.WriteLine(responseString); } } } Console.ReadLine(); }
My problem is I get only the transaction related to customer US-003
Thank's in advance
Hi,
I want to add a field from a data source which is not included in the form data source currently. I tried to extend the form and add a data source but it is not possible as the original form is application suite form.
How to add a new field from non-listed data source to the application suite form?
Thank you.
Hi Experts,
I couldn't find any other temporary tables on the sql server in D365FO referring to URL as below,
Is it possible to see the data of temporary tables using ssms?
Could anyone tell me It's possible to verify and see data of temporary table to have table type is TempDB?
Otherwise, Is it difficult to see data of temporary tables on the sql server? Actually, I have never seen temporary tables on AXDB.
Thanks in advance.
Hi
I would like to use the following X++ method as a computed field method of data entity. Is it possible?
HcmWorker::findByPerson(DirPersonUser::find(SourceDocumentLine.CreatedBy).PersonParty).PersonnelNumber;
Can it be used only in virtual fields?
If it is available, please guide me how to use it.
Thanks.
Hi,
I have created a form which is having one integeredit control which is for number of days,and a button control. I need to get the values from the integeredit control and to use in a x++ job. Help me on this.
Regards,
Ram
Hello everyone, my goal is to implement COC when the PurchReqTable.RequisitionStatus is equal to "Closed"(I want to implement Chain of Command after the update for PurchReqTable.RequisitionStatus)
I don't know which method or class should I use in order to trace the code. It looks like a background process handles the code when I click the Approve button because
after a minute or two the status will be updated from Approved to Closed. I tried the setPurchReqTableByBudgetReservationReference method from PurchReqWFStatusTransitionHelper class but my code didn't work
[ExtensionOf(classStr(PurchReqWFStatusTransitionHelper))] final class PurchReqWFStatusTransitionHelper_Extension { public static void setPurchReqTableByBudgetReservationReference(RecId _purchReqTableRecId, boolean _doVersioning) { next setPurchReqTableByBudgetReservationReference(_purchReqTableRecId, _doVersioning); PurchReqRequisitionStatus toRequisitionStatus; toRequisitionStatus = PurchReqTable::evaluateHeaderStatus(_purchReqTableRecId, PurchReqRequisitionStatus::Closed); if(toRequisitionStatus == PurchReqRequisitionStatus::Closed) { info("Closed COC Requisition status"); } } }
Hi
I would like to get the PersonnelNumber field value of the HcmWorker table using a computed column without adding a data sources to the data entity.
I have SourceDocumentLine.CreatedBy in my data entity filed.
In the virtual column, I can get the value by the following method.
HcmWorker::findByPerson(DirPersonUser::find(SourceDocumentLine.CreatedBy).PersonParty).PersonnelNumber;
Please, let me know.
Hi all,
1. I have an one work item number.
2. how to get that workitem number in the Query (query means teams<new query>)
I don't know how to do in the teams query. could you please give me some snap for that?
Thanks
Hi All,
It seems that there is a 1:N relation between SalesTable.SalesId and SalesLines.SalesId.
When I create a simple query, can I also add SalesLine as a child data source of SalesTable ? or should it be always the case that the SalesTable is the child data source of the SalesLine in the query if I want to relate these two tables each other?
Thank you.
Hi All,
We are trying to read one column from CSV file having comma(,) in the value like "Abc,def" , but while reading this column it is dividing into 2 columns like "Abc" and "def" instead one value like Abc,def.
Any solution to avoid this type of issue, please advice us.
Regards,
Akbar
find delay date if I have only 1 date column in query based report(ssrs) and i column of issue date
if product is ship so the "column of issue date =0" and when procut is received so the "column of issue date =1"
how to differ date(of delay time)
Hi guys,
Is there a possibility to create View which is the field is from a display method ?
So I create View, lets say the data source is table A and apart from adding fields from table A's field, I also want to have a field that displaying table A's display method.
A sample view from Ax is BankAccountView :
So in this example BankAccountView, I would like the "getBankAccountBalanceCur" to be one of the field.
This is actually related to my other post (+) Relation between ProjTransPosting and ProjPostTransView - Dynamics 365 Finance Forum Community Forum, but it can be separated so not really matters as the point is still "can we have a field of a View based on a display method ?"
Thanks,
Hi All,
I am using a form pattern: Dialog - Basic and changed some of control's widthmode (to Manual) and width. Then depending on Zoom level,
it shows the following bar.. How can we configure not to show this bar regardless of the zoom level?
Thank you.
Hi all,
Running AX 2012 R3 CU9.
When running confirmations, pick lists, etc - is it possible to change the values within "Query used" defaults?
I'm aware you can save the values in a selection as a separate query but that's reliant on usage data not being deleted, and as far as I know you can't make a custom query the default.
Presumably it must be getting the data for the default ranges from somewhere, is there a way we can slip in a few extra fields in the default "Query used" selection without breaking base classes?
Thanks very much in advance,
Luke
Dear Dynamics community,
I could use your assistance completing an issue I'm having when attempting to load a temporary in-memory table from a List.
The behavior that I've noticed is that when I set the temporary table I'm only able to load a single object from the list; when I attempt to load multiple objects an error is thrown (as I would expect the List to be dynamic, and more than two objects in the list will typically be expected). Is there a method or process where I might load multiple objects of the same type into a temporary table on which to perform a select from?
Currently my code is set up as follows:
private BRKContractHeader finalListReduction(List contracts) { BRKContractHeader bestContract; BRKContractLine bestContractLine; BRKShippingScenario bestShippingScenario; bestContract.setTmp(); ListEnumerator enumerator = contracts.getEnumerator(); while(enumerator.moveNext()) { BRKContractHeader header = enumerator.current(); bestContract.setTmpData(header); bestContract.doInsert(); }
Furthermore the method continues and I attempt a 'select' against the existing information I expect to be loaded into the temp table:
select bestContract join bestContractLine join bestShippingScenario order by bestContract.ContractId desc , bestContractLine.ContractLine desc , bestShippingScenario.ShippingScenarioLine desc where bestContract.ContractId == bestContractLine.ContractId&& bestContract.ContractId == bestshippingScenario.ContractId&& bestContractLine.ContractLine == bestShippingScenario.ContractLine&& bestContractLine.FreightResponsibility == BRKFreightResponsibility::DJJ { bestContract = bestContract; } return bestContract; }
Ideally I would like to be able to load multiple records into the header table, find the corresponding line and shippingScenarios information, in order to whittle down the list to where only a few (ideally one) contract would remain.
Your help, as always, is much appreciated. Happy St. Valentine's Day to you all!
Hi guys,
As mentioned, when we use Update_recordset, does it skip Update method() ? I created Job and use Update_Recordset then create CoC class with Update method of the same table, however it never run my CoC class.
Actually I ran to a post saying it is run Update(), I just want to confirm, which one is true ?
I didn't specify anything else, btw, like SkipDataMethod or SkipEvents.
Thanks,
Hi,
Hope you are doing all well!
l am having an issue with "Known as" field from table Global address book. l am a system administrator and this field is visible and can be added as a new column in All Customers view. (as in the screenshot below)
But my colleague which is also System Administrator can not add this field. It is not visible, (as in the screenshot below).
We cleared the usage data, we deleted the user of my colleague and created it same as my user, and checked everything that crossed on our minds but without solution.
Can you please help on this?