Quantcast
Channel: Martin Dráb's Activities
Viewing all 17532 articles
Browse latest View live

Filtering View Computed Column Returns Empty

$
0
0

Hi,

I created a Sales Order View with a computed column Payment Date. Payment Date is the latest CreatedDateTime of a payment made for a particular Sales Order. This field is displayed in a grid on form. The method is written as follows: 

public static server str latestPaymentDate()
    {
        DictView dv = new DictView(tableNum(SalesOrderHeaderView));

        str s = strFmt('SELECT TOP 1 CreatedDateTime1 FROM MCRCUSTPAYMTABLEVIEW WHERE MCRCUSTPAYMTABLEVIEW.RefRecId = %1 AND MCRCUSTPAYMTABLEVIEW.RefTableId = 2509 ORDER BY CreatedDateTime1 DESC',
        dv.computedColumnString(tableStr(SalesTable), fieldStr(SalesTable, RecId), FieldNameGenerationMode::WhereClause));

        return strFmt('ISNULL((%1), \'\')', s);
    }

I was able to sort the column but filtering it will return empty results every time and of course I have made sure the filtered value exists. I also tried advanced filtering statements like (Day(0)), (DayRange(0,0)) but still returns empty. 

What's more weird is, I have another computed date called Complete Date, which is the latest confirmation date for the sales order. No issue with this Complete Date field. 

So I thought there must be something wrong with my query. But I'm not sure what's wrong. The returned values are correct.

What else could be the root cause? 

Thank You.


Create info in messages bar Dynamics 365 Finance and Operations

$
0
0

Anyone know how to create info in messages bar here?

Thanks,

Access Azure Storage Map drive using X++ Classes

$
0
0

Hi All,

i need to drop a CSV file in Azure Storage map drive using x++ in D365 cloud .

is there any classes available ?

Please Help.

Regards,

Muneeb Umer

Account number for transaction type Bank statement does not exist - when posting bank statement

$
0
0

Hi,

I have a small bank rec with matched transactions. I am trying to post the Bank Statement now.

After many successful bank recs postings suddenly system throws an error ''Account number for transaction type Bank statement does not exist.''  

It all worked before and I have not changed anything in my config. Type of transaction 'bank statement'...? That's new and I never

had that in my Types of Transactions before. Not much online. Help needed and appreciated.

Update table index using table extension

$
0
0

I create a table extension to add extra fields to a standard table . I need to include these new fields in the index that is already created on the table with allow duplicate no , how can I update the index since I cannot add any fields also I cannot update index properties , is there any work around using table extension not customization ?

Developing custom reports on Power BI with Dynamics AX 2012 R2?

$
0
0

Hii,

We want to use Microsoft Power BI for our Dynamics AX 2012 R2 Data Analysis, Reporting and Visualization.

I have following questions,

1. Can we connect Power BI Desktop with Dynamics AX 2012 R2 database? 
2. As you know, we have lot of AOT queries in AX, can we design same queries and relationships in Power BI?
3. We have SSRS reports in AX, some SSRS reports using AOT queries and some using RDP classes, can we get the same results in Power BI?
4. We have some reports, that are using complex stored procedures, how to manage them in Power BI?
5. SSRS reports show live data and transactions, does the Power BI show the live data?

Please guide with your experience, because its a big step for us to move to Power BI.

Thanks,
 

 

No resources were found when selecting for update

$
0
0

I am getting issue in updating customer postal address. 

Below in my method to updating customer postal address. 

string addressLocationId = "000004773";
string company = "USMF";
string customerAccountNumber = "usmf_US-P010";

CustomerPostalAddress customerPostalAddress = _context.CustomerPostalAddresses.AddQueryOption("cross-company", "true").Where(x => x.DataAreaId == company &&
x.AddressLocationId == addressLocationId && x.CustomerAccountNumber == customerAccountNumber).FirstOrDefault();


DataServiceCollection<CustomerPostalAddress> dataServiceCollection = new DataServiceCollection<CustomerPostalAddress>(_context);

dataServiceCollection.Add(customerPostalAddress);

 

customerPostalAddress.AddressDescription = "Test address.";
  

DataServiceResponse response = null;
try
{
_context.UpdateObject(customerPostalAddress);
response = _context.SaveChanges(SaveChangesOptions.PostOnlySetProperties);

}
catch (Exception ex)
{
Console.WriteLine(ex.Message + ex.InnerException);
}


I am getting below error. 

\"message\":\"No resources were found when selecting for update.\",
\"type\":\"Microsoft.Dynamics.Platform.Integration.Services.OData.ODataArgumentException\",\"stacktrace\":\"
at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.UpdateManager.GetEntityForUpdate(IQueryable query, EntityType entityType) ...... 

Dll issue

$
0
0

Is it possible to use dll which is in D365 to AX?


HTTP Requests in Dynamics AX

$
0
0

Hi all,

I need to integrate an external API with Dynamics AX. This API works as follows:

  1. Create HTTP request and send
  2. Catch the response, which will be XML
  3. Interpret the XML to pull the necessary data
Does anyone here know how to create HTTP requests and handle XML in Dynamics AX? I know using the business connector, I could create code in .NET, but I haven't done that before either. If that is the correct way, can someone please walk me through it?
Thanks in advance guys!

Vendor Portal - Catalogs

$
0
0

Hi All,

I am working on catalogs by using vendor portal. I want to know the possibility of uploading the JPEG files/Images with Catalog by using Vendor Portal.

Moreover standard system is offering XML formats to upload the catalog. Is it possible to upload the catalog from vendor portal by using excel upload tool.

Thanks,

Ali Danish

x++ project cannot be built. another build is in progress

$
0
0

Hi,

In AX 7, I just came across the error as below:

"x++ project cannot be built. another build is in progress".

Any idea?

Thanks,

How to connect to a remote database in D365FO?

$
0
0

Hello everyone,
I have a development requirement in which I must populate and update data from a table created in D365FO, this process is executed in batches, the database that I need to access to consult the data that will populate my table in D365FO is in a Remote Desktop. I would like to know in what way I can connect to this database since it is in another machine.

I appreciate your quick answers, Thanks.

I will be attentive to your comments

Retrieve Data From Void Method to Class Extension

$
0
0

i have class, inside that class i have void method like this :

abstract class  SalesQuotationTableForm

{
void createFromTemplate()
{
SalesQuotationTable salesQuotationTableTemplate;
SalesQuotationLine salesQuotationLine;
PSAGenerateQuotationLines psaGenerateQuotationLines;

ttsbegin;

salesQuotationTableTemplate = SalesQuotationTable::findTemplate(this.quotationType(),
this.parmFromTemplateGroupId(),
this.parmFromTemplateName(),
true);
if (salesQuotationTableTemplate)
{
// copy header information
salesQuotationTable.QuotationCategory = salesQuotationTableTemplate.QuotationCategory;
salesQuotationTable.DocuTitle = salesQuotationTableTemplate.DocuTitle;
salesQuotationTable.DocuIntro = salesQuotationTableTemplate.DocuIntro;
salesQuotationTable.DocuConclusion = salesQuotationTableTemplate.DocuConclusion;

if (this.parmQuotationPriceConversion() == SalesQuotationPriceConversion::Template)
{
salesQuotationTable.DefaultDimension = salesQuotationTable.copyDimension(salesQuotationTableTemplate.DefaultDimension);
if (this.quotationType() == QuotationType::Sales)
{
salesQuotationTable.DiscPercent = salesQuotationTableTemplate.DiscPercent;
}
}
if (Project::Enabled())
{
salesQuotationTable.psaSchedCalendarId = salesQuotationTableTemplate.psaSchedCalendarId;
}

salesQuotationTable.doUpdate();
if (Project::Enabled() && this.checkExistABS(salesQuotationTableTemplate))
{
this.createABSFromTemplate(this.parmQuotationPriceConversion() == SalesQuotationPriceConversion::Current ? true : false);

psaGenerateQuotationLines = new PSAGenerateQuotationLines();
psaGenerateQuotationLines.createSalesQuotationLines(salesQuotationTable);
}
else
{
SalesQuotationLine::createQuotationLineFromTemplate(salesQuotationTableTemplate,salesQuotationTable,this.parmQuotationPriceConversion());
if (this.parmQuotationPriceConversion() == SalesQuotationPriceConversion::Template)
{
update_recordset salesQuotationLine
setting CurrencyCode = salesQuotationTableTemplate.CurrencyCode
where salesQuotationLine.QuotationId == salesQuotationTable.QuotationId;

salesQuotationTable.convertCurrencyCode(salesQuotationTable.CurrencyCode);
}
}
}

ttscommit;
}

}

can i retrieve id from that method ? 

Create sales Order with multiple sales line via AIF

$
0
0

Hello

How to create a Sales Order with multiple Sales Line through AIF service SalesOrderService

the next code created a sales order with one sales order

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            SalesOrderServ.SalesOrderServiceClient client = new SalesOrderServ.SalesOrderServiceClient();
            SalesOrderServ.AxdSalesOrder salesorder = new SalesOrderServ.AxdSalesOrder();

            SalesOrderServ.CallContext callcontext = new SalesOrderServ.CallContext();
            SalesOrderServ.EntityKey[] keys;
            SalesOrderServ.EntityKey key = new SalesOrderServ.EntityKey();
            SalesOrderServ.KeyField fld = new SalesOrderServ.KeyField();

            SalesOrderServ.AxdEntity_SalesTable salestable = new SalesOrderServ.AxdEntity_SalesTable();
            salestable.CustAccount = "1202010001";
            //salestable.SalesId = "EGC-000015";
            salestable.PurchOrderFormNum = "PO";
            salestable.LanguageId= "ar";
            salestable.ReceiptDateRequested = System.DateTime.Today;
            salestable.CurrencyCode = "USD";
            salestable.DeliveryDate = System.DateTime.Today;


            SalesOrderServ.AxdEntity_SalesLine salesline = new SalesOrderServ.AxdEntity_SalesLine();
            salesline.ItemId = "0101001";
            salesline.LineNum = 1;
            salesline.SalesQty = 1;
            salesline.CustomerRef = "1";
            salesline.SalesUnit = "kg";
            salesline.SalesPrice = 2000;


            SalesOrderServ.AxdEntity_InventDim inventDim = new SalesOrderServ.AxdEntity_InventDim();
            inventDim.InventSiteId = "S-39";

            salesline.InventDim = new SalesOrderServ.AxdEntity_InventDim[] {inventDim};
            salestable.SalesLine = new SalesOrderServ.AxdEntity_SalesLine[] { salesline};
            salesorder.SalesTable = new SalesOrderServ.AxdEntity_SalesTable[] { salestable};
            

            callcontext.Company = "egc";
            callcontext.Language = "en-us";

            keys = client.create(callcontext, salesorder);
        }
    }
}

Filtering View Computed Column Returns Empty

$
0
0

Hi,

I created a Sales Order View with a computed column Payment Date. Payment Date is the latest CreatedDateTime of a payment made for a particular Sales Order. This field is displayed in a grid on form. The method is written as follows: 

public static server str latestPaymentDate()
    {
        DictView dv = new DictView(tableNum(SalesOrderHeaderView));

        str s = strFmt('SELECT TOP 1 CreatedDateTime1 FROM MCRCUSTPAYMTABLEVIEW WHERE MCRCUSTPAYMTABLEVIEW.RefRecId = %1 AND MCRCUSTPAYMTABLEVIEW.RefTableId = 2509 ORDER BY CreatedDateTime1 DESC',
        dv.computedColumnString(tableStr(SalesTable), fieldStr(SalesTable, RecId), FieldNameGenerationMode::WhereClause));

        return strFmt('ISNULL((%1), \'\')', s);
    }

I was able to sort the column but filtering it will return empty results every time and of course I have made sure the filtered value exists. I also tried advanced filtering statements like (Day(0)), (DayRange(0,0)) but still returns empty. 

What's more weird is, I have another computed date called Complete Date, which is the latest confirmation date for the sales order. No issue with this Complete Date field. 

So I thought there must be something wrong with my query. But I'm not sure what's wrong. The returned values are correct.

What else could be the root cause? 

Thank You.


convert X++ Select Statement into aot query

$
0
0

i want to convert following X++ statement into AOT query

while select ItemId,Name,Qty,LineAmount,PurchPrice,PurchUnit,InvoiceDate
from VendInvoiceTrans join PurchMaxItemPurchasePriceTMP
where VendInvoiceTrans.ItemId == PurchMaxItemPurchasePriceTMP.ItemId &&
VendInvoiceTrans.InvoiceDate == PurchMaxItemPurchasePriceTMP.MaxInvoiceDate

save excel file to particular local folder in d3fo using OfficeOpenXml

$
0
0

Hi Friends,

I am trying to save excel file to local folder without prompting any message (download, ..) which I have created to through code by using OfficeOpenXml, I want to save this file to local folder (filename = "C:\\item.xls")

I am new to use DocuFileSave class to achieve this, please suggest me to save excel file to local folder.

Thanks in advance

Table inheritance

$
0
0

I have a few questions/issues. I have googled and read a lot. I would've found the solutions by trial and error, but using this functionality has an enormous impact on the server I'm using. It will take ages and too much frustration to try different methods. Hence the first issue.

1. From the point where I change the table property Supports Inheritance to Yes any development related to the table takes a significant performance hit. Adding a field to the table or changing a property takes seconds. This snowballs further for form datasources of the table type - it takes minutes and sometimes never to change some property. We have our own servers and yes they aren't the best, but everything except this works fine and reasonably quickly.

2. Abstract. Paraphrasing https://msdn.microsoft.com/en-us/library/gg881064.aspx "Abstract no - derived tables do not necessarily have a corresponding record of the base table."  Not very helpful. I assume that Abstract No means the table exists in the database and Abstract Yes means the table does not. An abstract table cannot contain records, meaning a record must be defined as a descendant and a normal base table can have a record that exists without any descendants.

3. Duplicate fields. I learned the hard way that it creates issues if different descendants have the same field name. But this is sometimes necessary. I mean a base table Animal should not have a field Wings,  but both derived tables Duck  and Ostrich should have the field. Unless you want to build the whole animal kingdom, which no-one has time for. Is it allowed or not? VS didn't prohibit me from creating the fields on table level, but still - the errors.

4. Modified By, Modified Date. Also applies to Created By and Created Date. I want to store the modifications. So I set the properties to Yes on the base table and didn't bother on the descendants, in other words they are still No. Is that correct?

5. Foreign keys. My abstract base table B has a foreign key relation to some table F. B has descendants T and U. I have a details master form where I want to display T and U separately. Table F is the root datasource. I want to skip the dialog where you select the table type to insert. So I dragged table T and U onto the form and set Join Source to F. The errors were more than biblical Israelites. For example table T has a real field. The form displays table F's RecId in the real field. Should this have worked correctly or am I supposed to link the datasource in form code?

I apologise for the essay.

Thanks for reading

AX7: What made Microsoft to keep some elements Non-Extensible

$
0
0

With arrival of AX7, as we have got two approaches of development, a new development approach i.e. Extension allows us to extend AOT Elements.

For each element there is a property called isExtensible, which is either false or true.

Incase isExtensible=false, for an AOT element, that element cannot be extended.

 

 

An example let’s take a base enumeration LedgerTransTxt, which is part of Application Suite. Because of any reason such as for any of my ISV solution, I may think to extend this Base Enum, but I cannot extend it, as it is set to isExtensible=false

 

My question is simply, what made Microsoft to keep some elements extendable whereas other non-extendable?

Error Unable to cast object of type 'Dynamics.AX.Application.PurchAutoCreate_Sales' to type 'Dynamics.AX.Application.Args' in Class Extension

$
0
0

Hello, help me please

I found an error when will create Purchase Order on form PurchCreateFromSalesOrder

this is my script, 

[ExtensionOf(classStr(PurchAutoCreate_Sales))]
final class ZPurchAutoCreate_Sales_RP_Extension
{
//<summary>

//</summary>
//<param name="args"></param>
[PostHandlerFor(classStr(PurchAutoCreate_Sales), methodStr(PurchAutoCreate_Sales, setPurchTable))]
public static void PurchAutoCreate_Sales_Post_setPurchTable(XppPrePostArgs args)
{
NumberSequenceTable numSeqTable;
RefRecId recIdNumSeq;
ZSetupPurchaseType setUpPurchType;
InventDim invDim;
PurchTable _purchTable, purchTab;

PurchAutoCreate_Sales _this = args.getThis() as PurchAutoCreate_Sales;
Args arg = args.getArgNum(0);
SalesLine salesLineArg = arg.record();
//smmBusRelTable smmBusRelTableArg = arg.record();
if (!arg ||
arg.dataset() != tableNum(SalesLine) ||
!arg.record() ||
arg.record().RecId == 0)
{
throw error("@SYS22996");
}
}

}

Viewing all 17532 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>