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

Filter records in child form based on Parent form

$
0
0

Good Morning,

I have one parent form and records are like the below

SalesAgreement id         Desc             ( 1st Form - FirstTable)

SA - 001                          Test

 

Jobid                              salesAgreemntid    (2nd Form  - secondTable)

JO-001                          SA - 001

JO-002                          SA - 001

Jobid                              SalesAgreementId                  TransDate       No of units      ( ThirdTable - Lines)

JO -001                          SA - 001                                   26/11/2019     1

JO -001                          SA - 001                                   26/11/2019     2

JO -002                         SA - 001                                   26/11/2019     3

JO -002                         SA - 001                                   26/11/2019     1

The above table is which do not have any relation with second table

So, now on Second Form i have 1 Menu Item Button to open Third table mean Third Form

Now i have to have multi selection in Second form.

Example : If is select Both Jobs and when i click Thirdform MI on Second form I must see all 4 records which are in 3rd table

What things i tried but its not working

1. In form - Init() - 

Formdatasource   fds ; (Global Dec)

in init()    (Did Concatenation but not woring in query ranges)

fds = element.args().record().Datasource();

JobTable        jobjtableDS;
str                  getjobid;
for(jobjtableDS= fds.getFirst(true) ? fds.getFirst(true) : fds.cursor(); jobjtableDS; jobjtableDS= fds.getNext())
{
getjobid += jobjtableDS.jobid+',' ;
}

if (getjobid)
{
getjobid = subStr(getjobid,1,strLen(getjobid)-1);
}

I sended as 

JobLine_ds.query().dataSourceTable(tableNum(JobProjLine)).addRange(fieldNum(jobProjLine, Jobid)).value(getjobid);

Test 2 

Added the same range in ExecuteQuery()

Not working.

Please help me in how can i pass selected records from form how to filter based on multiple values in one range.

Regards,

Have a nice day.


How to validate the insert/writing of a record without necessity of a trigger event?

$
0
0

Consider I have just read a row from this csv file, each column is a field of a table,  I have been asked to verify that the value in that record of a certain field is plausible for writing/updating  in the associated table.

For example, field X can accept as values only the integers 10, 11, 12, 13......if on my csv file I read a record in which the field X has been set to 22, I should throw an error before I start any update/insert and prevent any processing of the whole row/record I read.

I usually always worked with validating the data that users inserted on forms the moment they inserted it, I never had a situation like this.

How can I call the validateWrite method without any triggerring event and verify that the value I just read is fit for writing?

Thank you very much.

integrating D365FO with mobile application

$
0
0

i want to know how to make a web API URL for my D365FO data to be integrated with a mobile application 

OData/WebAPI DELETE for Product Category is returning 204 but the entity is not actually being deleting

$
0
0

I'm going crazy and can't figure this out. 

In Postman, I'm calling 

  • GET {{d365BaseUrl}}/data/ProductCategories(ProductCategoryHierarchyName='Physical Inventory',CategoryName='test4') -- This works just fine and returns the prodcut category
  • DELETE {{d365BaseUrl}}/data/ProductCategories(ProductCategoryHierarchyName='Physical Inventory',CategoryName='test4') -- Returns a 204 and I assume it's deleted
  • NOPE It's still there!  I've tried passing an empty body {} as I saw in a related post for CRM, but that didn't help at all.  This is D365 F&O / Supply Chain Management.

Deleting items with Postman works just fine for ProductsV2, but not for Product Categories.  I'm baffled.  

Any help would be greatly appreciated.

Thanks,
Tom

Cannot edit a record in Purchase Order Lines(PurchLine). The record shown has been updated by another user

$
0
0

Hi All

In D365 FnO , I am facing an error "Cannot edit a record in Purchase Order Lines(PurchLine). The record shown has been updated by another user". Press Revert or Shift+ Ctrol+F5 to see updated values.

This occurs when I am entering a field value in PurchLine during PO creation and saving the POLine.
seems error occurs from my PurchTable's Event handler class, OnWritten Method where I have written code to perform PurchLine.DoUpdate based on some validations.

The error seems to happen in PurchLine.DoUpdate
Strange thing about the error is, same code exists on 2 standalone machines, but it occurs only on one machine.

I tried resetting the ttsbegin and ttscommit above and below PurchLine.DoUpdate but issues doesnt solve.

Have tried using update instead of doUpdate, error still occurs.

It will be helpful if someone can shed a light on what could possibly be going wrong?

Regards

Sabarish

Filter Report data in Dynamics Axapta4 Reports

$
0
0

Hi

I want to create a simple report showing data from a table.

to select the records to print I want to compare 2 fields in the table and only print the record if field1 is less than field2

How can I reach this?

loop through all data entities in D365FO

$
0
0
I need a list of all Data Entity, along with its fields and field properties. So far I am using Microsoft.Dynamics.Ax.Xpp.MetadataSupport::GetDataEntityView("AccountantEntity") to get the metadata of the named data entity. However I need to loop through all the data entity names, and I cant find a way to do that. Can someone help me out?

How to integrate data in SQL Table with AX 2012 Table

$
0
0

Hi,

I have Data in SQL Table but i need to transfer that data to AX for further processing..

how it configure to AX?

Thanks..

Ramesh


How to Get Dimension Value ?

$
0
0

Good day everyone,

How can I get this dimension value and pull it out to the report? 
These dimension value has no relation with master table (InventTable).

Step 1:
Click this 

Step 2:
How to get these 2 and pull it to the report?

I'm using PowerPivot.

Attaching Documents

$
0
0

Hi Everyone,

Could someone please help me out regarding my question. I'm trying to attach a document when raising PO but new button is greyed out, how can I enable the New button in D365.

Regards

Mahesh

How can I pull display method value and show on my report(Power Pivot) ?

$
0
0

Hi everyone, 

This EditStop is a method but how can I pull it to the report? 

could not generate export file for SalesOrderHeaderV2 Entity

$
0
0

while trying to export SalesOrderHeaderV2 entity it's failing and showing errors

Log text :

System.Exception: Exception from HRESULT: 0xC0202009
at Microsoft.Dynamics.AX.Framework.Tools.DMF.ServiceProxy.DmfEntitySharedTypesProxy.DoWork[T](Func`1 work)
at Dynamics.AX.Application.DMFGenerateSSISPackage.`generateFileDataV2(DMFDefinitionGroupExecution _dmfDefinitionGroupExecution, String _defGroupName, DMFFileFormat _fileFormat, DMFDelimiter _rowDelimiter, DMFDelimiter _columnDelimiter, String _codePage, String _locale, NoYes _isFirstRowHeader, NoYes _unicode, String _source, String _textQualifier, DMFXMLStyle _style, String _rootElement, String _filePath, Map _entitySyncVersion, Int32 _previewCount, Boolean @_entitySyncVersion_IsDefaultSet, Boolean @_previewCount_IsDefaultSet) in xppSource://Source/ApplicationFoundation\AxClass_DMFGenerateSSISPackage.xpp:line 1273



I have tried for excel as well as other format as well.
and there are no customizations as well

The OData API is not returning any error code for errors to handle based on error codes.

$
0
0

We are implementing client application for Dynamics 365 Finance and Dynamics 365 Supply Chain Management. As part of our analysis we required the list of possible error codes for Dynamics. Also as per our analysis the OData API is not returning any error code for the errors. For example when we tries to delete currency object the error is as below

{"error": {"code": "","message": "An error has occurred.","innererror": {"message": "Delete failed for table row of type 'CurrencyEntity'. Infolog: Error: Function CurrencyEntity.delete has been incorrectly called..","type": "Microsoft.Dynamics.Platform.Integration.Services.OData.AxODataDeleteException","stacktrace": "   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.UpdateProcessor.DeleteEntity(ChangeOperationContext context, ChangeInfo changeInfo)\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.UpdateManager.<>c__DisplayClass7_0.<DeleteEntity>b__0(ChangeOperationContext context)\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.ChangeInfo.ExecuteActionsInCompanyContext(IEnumerable`1 actionList, ChangeOperationContext operationContext)\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.ChangeInfo.ExecuteActions(ChangeOperationContext context)\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.UpdateManager.SaveChanges()\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.AxODataDelegatingHandler.<SaveChangesAsync>d__3.MoveNext()"
    }
  }
}

Here the "Code" is empty. It is not returning any error code to handle. Is there any pointers to get the error code for each error for OData API call?  Also please help in finding the reference for all the error codes available in Dynamics 365 Finance and Supply Chain Management. Thank you. 

After deploy the package in UAT if we want to modify one class and that particular class we want to deploy and move to UAT then how to move in D365FO

$
0
0

Dear Friends,

I have created deployment package and move this package to UAT and in this package we have 50 classes, we want to do customization only one class and this particular class only i want to deploy and move to UAT.

Please tell me how we can achieve that.

Thanks & Regards

Rahul 

Error 422 in PUT method / System.Net.HttpWebResponse

$
0
0

I have in AX2012 method like this:

public void SendRequest()
{
CLRObject clrObj;
System.Net.HttpWebRequest webReq;
System.Net.ServicePoint servicePt;
System.Net.WebHeaderCollection headers;
System.Text.Encoding utf8Enc;
System.IO.Stream stream;
System.Byte[] bodyBytes;
System.Net.WebException ex;
System.Net.HttpWebResponse webExRes;
System.Net.HttpWebResponse webRes;
System.IO.StreamReader streamReader;
System.Net.HttpStatusCode HttpStatusCodeTmp;
System.IO.BinaryReader binaryReader;
System.Int32 countOfBytes;
System.Byte[] responseBinaryBytes;
System.IO.MemoryStream memStream;
str strAuth;
boolean debug = true;
boolean CommitRequest = true;
;
try
{
new InteropPermission(InteropKind::ClrInterop).assert();
clrObj = System.Net.WebRequest::Create(requestPath);
webReq = clrObj;
servicePt = webReq.get_ServicePoint();
servicePt.set_Expect100Continue(false);
webReq.set_Method(requestMethod);
webReq.set_KeepAlive(true);
webReq.set_AutomaticDecompression(System.Net.DecompressionMethods::GZip);
headers = new System.Net.WebHeaderCollection();
headers.Add("Auth", strAuth);
headers.Add("Timestamp", timestamp);
webReq.set_Headers(headers);
utf8enc = System.Text.Encoding::get_UTF8();
stream = webReq.GetRequestStream();
bodyBytes = utf8enc.GetBytes(requestBody);
stream.Write(bodyBytes, 0, bodyBytes.get_Length());
webReq.set_ContentType("application/json");
webReq.set_Accept("*/*");
try
{
webRes = webReq.GetResponse();

info(strfmt("I'm here after GetResponse"));
}
catch (Exception::CLRError)
{
error (strFmt("Exception::CLRError"0));
}
catch
{
error (strFmt("Otjer error"));
}
CodeAccessPermission::revertAssert();
}
catch(Exception::CLRError)
{
throw error(AifUtil::getClrErrorMessage());
}
info(strfmt("Method end"));
}


If I send POST - all is OK; (error code 201, 403) -)
If I send PUT and receive code 204 - all is OK
If I send PUT and receive code 422 (Unprocessable Entity (WebDAV) (RFC 4918)) AX stops and I don't see message "I'm here after GetResponse"

What is wrong ??? Why I can't use try..catch .. in error 422 ? AX breaks all code after webReq.GetResponse ! What can I do ?


Attaching Documents

$
0
0

Hi Everyone,

Could someone please help me out regarding my question. I'm trying to attach a document when raising PO but new button is greyed out, how can I enable the New button in D365.

Regards

Mahesh

Modified Data Entity Error on Table Browser

$
0
0

Hi all,

Im having error on a modified Data Entity when deployed to Sandbox Environment, please see screenshot:

The modification is for InventWarehouseOnHandEntity, just added a additional table to its view datasource then added some field to the Data Entity fields.

It is working on my Development Environment and shows fields in Table browser /data/WarehousesOnHand.

But when i deployed it in our sandbox environment, the error shows.

Any fix suggestion is really helpful. Thanks.

Cannot edit a record in Purchase Order Lines(PurchLine). The record shown has been updated by another user

$
0
0

Hi All

In D365 FnO , I am facing an error "Cannot edit a record in Purchase Order Lines(PurchLine). The record shown has been updated by another user". Press Revert or Shift+ Ctrol+F5 to see updated values.

This occurs when I am entering a field value in PurchLine during PO creation and saving the POLine.
seems error occurs from my PurchTable's Event handler class, OnWritten Method where I have written code to perform PurchLine.DoUpdate based on some validations.

The error seems to happen in PurchLine.DoUpdate
Strange thing about the error is, same code exists on 2 standalone machines, but it occurs only on one machine.

I tried resetting the ttsbegin and ttscommit above and below PurchLine.DoUpdate but issues doesnt solve.

Have tried using update instead of doUpdate, error still occurs.

It will be helpful if someone can shed a light on what could possibly be going wrong?

Regards

Sabarish

argument to method setfieldvalue/getFieldValue out of range

$
0
0

Hi Experts,

Greetings

I have a customized form and the form is basically a department wise usage of an item

When i enter the from date and to date the values get generated

However,when i try to run the form it gives me the above error as  "Argument to setfieldvalue out of range . I compiled it and then i gives argumrnt to getFiedlvalue ou of rnge

tablevariable. setFieldValue(_unit, tablevariable.getFieldValue(_unit) + _qty);--->unit & qty are passed as parameters in the function

Can someone tell me what this method does and what is the error say.

There are no array functions defined (* as per syntax on google)

I didnt get any soutions. Why to use the setfieldvalue instead of just assigning the values to table (* code was developed before me coning in project)

Error: The Axd document does not support this action in AIF

$
0
0

Hi All,

I am getting error in exceptions as " The Axd document does not support this action" .

Please suggest how to fix this..

Thanks..

Ramesh Muthyala

Viewing all 17532 articles
Browse latest View live