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

DMF data entities list are empty

$
0
0

Hi All,

we have our Dynamics 365 finance an operations DMF data entities list are empty. how can we generate them ?

Thank you,


Replacement of Statement.executeUpdate()

$
0
0

The method executeUpdate is deprecated... Have you found any alternative way? I tried executeQueryWithParameters, but actually I don't have parameters for my query. Thanks

An error has occurred on DocuRef Preview for PDF Files

$
0
0

Hello,

since Service Update 10.0.17 we got the Message "An error has occurred." on the Preview for the DocuRef Control.

We just get this error for PDF - Files at our UAT Environment. On DEV it Works.

UAT:

DEV:

Does anybody have the same issue and know how to fix it?

Example of dialog with sysoperation

$
0
0

Hi Experts,

Can you please share an example i could refer to build the following with sysoperation framework.

I tried to look for dialog in application suite , however what ever  i came across was being extended from runbase & not sysoperation framework.

1. Simple dialog with ok & cancel button.

2. Some dialog fields

3. Feature that sets some field value to defalt value, for example always yes for a boolean field.

4.Feature to load dialog with last used values.

Thanks

Mav

Upload to azureBlob fails

$
0
0

Hi,

I'm exporting an entity then sending the file to azure blob.

However when the file gets bigger, i noticed that uploading is failing. (exporting the entity was a succes)

i received files with 1.8GB,1.9GB and when i increased the records it started failing.

Here's my code

system.exception ex;
try
{
Microsoft.WindowsAzure.Storage.Auth.StorageCredentials  storageCredentials  = new Microsoft.WindowsAzure.Storage.Auth.StorageCredentials(StorageAccountName, StorageKey);
Microsoft.WindowsAzure.Storage.CloudStorageAccount      storageAccount      = new Microsoft.WindowsAzure.Storage.CloudStorageAccount(storageCredentials, true);
var                                                     blobcli             = storageAccount.CreateCloudBlobClient();
Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer  cont                = blobcli.GetContainerReference(BlobContainer);

stream.Position=0;

Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob      cloudBlockBlob      = cont.GetBlockBlobReference(fileName);
cloudBlockBlob.UploadFromStream(stream,null,null,null);
}
catch(ex)
{ 
 throw error(ex.message);
}

My question is:

1. Why is it failing? is there a restriction on sizes bigger than 2GB? and how to solve this?
2. why I'm not catching the error that is happening?

Customized dialog control value

$
0
0

Dear Community,

I have added a custom dialog control through x++ in a batch job. I wrote a post event handler method to add this to dialog form.

  

Now I want to get the value of this added dialog in another post event handler method. How can I achieve this???

Thank you in advance.

View : Error converting data type nvarchar to bigint.

$
0
0

Hi,

During View creation, while Build and Synchronized has no error, when I try to run directly from SSMS, I get this error:

"Error converting data type nvarchar to bigint"

This view is consist of another 2 views which I just added 1 new field. 

1. In the 1st View, I added new method that searching for Inventtrans. physical reserved qty like below:

public static server str PhysicalReserved()
    {
        DictView    dictView      = new DictView(tableNum(MyCurrentPhysicalFact));
        str         Qty           = dictView.computedColumnString('InventTrans', 'Qty', FieldNameGenerationMode::FieldList);
        str         StatusIssue = dictView.computedColumnString('InventTrans', 'StatusIssue', FieldNameGenerationMode::FieldList);

        return strFmt('CASE WHEN %1 = 4 THEN ABS(%2) ELSE 0 END', StatusIssue, Qty);
    }

.Then add this Viewmethod to a new field : ViewComputedColumnReal

2. In the 2nd View actually there is no value, since the same method I only put '0' like below:

 public static server str PhysicalReserved()
    {
        return strFmt('0');
    }

Same as no1, added new field which is ViewComputedColumnReal.

If I run this two view independently, there is no error, but when run query of the top view which is the merge of this two, it will produce that error.

Anyone know what is the problem ? and how I can resolve this ?

Thanks

Deserialize JSON using C# dll file in x++

$
0
0

Dears,

I want to deserialize a JSON object in X++ using an external C# dll file.

I would appreciate any helpful links.


Add validation depending on the project stage from a different table

$
0
0

Hey Team,

I have a timesheet submission form where I need to add validation while submission. If the project stage for which the employee is filling the timesheet is not equal to "In progress" then display an error msg as "Time cannot be entered for ABCD.EFG project as it is not In progress". Now the Project stage belongs to a different form i.e All projects form and is a string field. So in this case how can I add the validation to my timesheet forma and where should I add it. please help me with this issue. 

Timesheet form:

Project status from Project Form:

Send request and get response process not working in D365FO

$
0
0

Hi All,

Environment :D365FO'

While trying in send request and get response in POST MAN its working good.

but When Using below code for send request and get response process its not working getting below error .Any one please help on this.

The remote server returned an error: (403) Forbidden.

System.Net.HttpWebRequest request;

System.Net.HttpWebResponse response;

CLRObject clrObj;

System.Exception ex;

System.Net.WebHeaderCollection httpHeader;

System.IO.Stream requestStream, responseStream;

System.IO.StreamWriter streamWriter;

int IDValue;

str SKUValue;

Map data;

str result;

try

{

new InteropPermission(InteropKind::ClrInterop).assert();

clrObj = System.Net.WebRequest::Create("URL");

request = clrObj;

request.Method = "GET";

response = request.GetResponse();

System.IO.StreamReader streamRead = new System.IO.StreamReader(response.GetResponseStream());

str responseJson = streamRead.ReadToEnd();

data = RetailCommonWebAPI::getMapFromJsonString(responseJson);

result = data.lookup("result");

info("Token response = " + responseJson);

//Token Class

httpHeader = new System.Net.WebHeaderCollection();

clrObj = System.Net.WebRequest::Create("request Other URL");

request = clrObj;

request.set_KeepAlive(true); // adding headers

httpHeader.Add("Authorization", "Bearer " + result);

request.set_Headers(httpHeader);

request.Method = "POST";

request.ContentType = "application/json";

requestStream = request.GetRequestStream();

streamWriter = new System.IO.StreamWriter(request.GetRequestStream());

// streamWriter.Write("[" + jsonString + "]");

streamWriter.Flush();

streamWriter.Close();

response = request.GetResponse();

streamRead = new System.IO.StreamReader(response.GetResponseStream());

info(streamRead.ReadToEnd());

}

catch

{

//exception

ex = CLRInterop::getLastException().GetBaseException();

error(ex.get_Message());

}

 

Disable Particular Financial Dimension (Department) which contains a predefined value

$
0
0

Hi Everyone,

Greetings of the day.

I am performing the following task in Dynamics 365 F&O

Case: I am getting the financial dimension (Department only) from worker position to PurchReqLine level on PurchReqTable Form

Now, I want to disable that financial dimension (Department only) after getting value in it all other financial dimensions should be editable except department.

Note: Department value noting but the current users assigned department. Eg. If worker ABC has assigned department Finance so, Value & Description will come into Purchase Requisition Line.

I am trying the below code but it's not working.

[FormDataSourceEventHandler(formDataSourceStr(PurchReqTable, PurchReqLine), FormDataSourceEventType::Activated)]
public static void PurchReqLine_OnActivated(FormDataSource sender, FormDataSourceEventArgs e)
{
/*ormBuildControl _build;

PurchReqLine purchReqLine = sender.cursor();
// DimensionEntryControl dimensionEntryControl;// = new DimensionEntryControl(_build,sender.formRun());
LedgerDefaultDimensionEntryController ledgerDefaultDimensionEntryController = LedgerDefaultDimensionEntryController::construct();
//dimensionEntryControl.parmEditableDimensionSet(DimensionAttribute::findByName('Department').RecId);
ledgerDefaultDimensionEntryController.parmDimensionsToAllowEdit(purchReqLine.DefaultDimension);//DimensionAttribute::findByName('Department').RecId);//DimensionLinkAllowFieldEdit += eventhandler(BS_PurchReqTableFormEvtHandler::enableHandler);
*/
}

Also, there is a link of exactly the same scenario but in AX 2012. following is the link, The classes used in that link is not available in D365.

https://syedbaber.wordpress.com/2013/09/23/enabledisable-a-financial-dimension-segment-on-ax-form/

Thanks,

Paresh

Local D365FO VM platform update

$
0
0

Hi,

I'm stuck, I rerun twice but still an error exists. As I check the log it states - Cannot find a process with the name "devenv". Verify the process name and call the cmdlet again.

Need your help badly. Thank you in advance.

Upload to azureBlob fails

$
0
0

Hi,

I'm exporting an entity then sending the file to azure blob.

However when the file gets bigger, i noticed that uploading is failing. (exporting the entity was a succes)

i received files with 1.8GB,1.9GB and when i increased the records it started failing.

Here's my code

system.exception ex;
try
{
Microsoft.WindowsAzure.Storage.Auth.StorageCredentials  storageCredentials  = new Microsoft.WindowsAzure.Storage.Auth.StorageCredentials(StorageAccountName, StorageKey);
Microsoft.WindowsAzure.Storage.CloudStorageAccount      storageAccount      = new Microsoft.WindowsAzure.Storage.CloudStorageAccount(storageCredentials, true);
var                                                     blobcli             = storageAccount.CreateCloudBlobClient();
Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer  cont                = blobcli.GetContainerReference(BlobContainer);

stream.Position=0;

Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob      cloudBlockBlob      = cont.GetBlockBlobReference(fileName);
cloudBlockBlob.UploadFromStream(stream,null,null,null);
}
catch(ex)
{ 
 throw error(ex.message);
}

My question is:

1. Why is it failing? is there a restriction on sizes bigger than 2GB? and how to solve this?
2. why I'm not catching the error that is happening?

How to send exported file url to azure blob? And how to change it's expiry?

$
0
0

Hi,

Currently i'm exporting the entity by code to get the file Id

Then i'm getting the dowloaded url by using this

DMFDataPopulation::getAzureBlobReadUrl(fieldId)

Then i'm using this

Stream = File::UseFileFromURL(downloadUrl)

Then I'm using

CloudBlockBlob.uploadFromStream(stream,null,null,null,null)

Now instead of sending the file to blob

I want to send the url(downloadedUrl) inside a file to azure blob and not the file itself

So when i open a file, i'll see the downloaded url where i can click it to download

How to do that?

Also if u notice the url, u can find that it contains start date and and end date (st and se) and the difference is about an hour. Can i increase that? 

How to create .xpo file of a report in Microsoft Dynamics AX 2012?

$
0
0

There is an urgent need of an answer about how to create .xpo file of a report after deployment. Quick answer will be appreciated.


Crystal reports ActiveX - change DSN properties from code

$
0
0

I am using following code to run crystal report in activex control of crystal report in dynamics ax. every thing is working fine when In crystal report the value of "Use DSN Default Properties" is set to False. But I want to change its value from coding. I am stucked how can i change it from code. It is giving me error. on this line.

IConnectionProperty = INameValuePairs.add("Use DSN Default Properties",False);

Error:

Method 'add' in COM object of class 'INameValuePairs' returned error code 0x80070057 (E_INVALIDARG) which means: One or more arguments are invalid.

My code starts here;

public void run()
{
Com comapp;
Com reporting;
Com IDatabase;
Com IDatabaseTable;
Com IDatabaseSingleTable;
Com INameValuePairs;
Com INameValuePairs2;
Com INameValuePairs3;
COM tc;
COM IConnectionProperty2;

Com IConnectionProperty;
Com ds;
COM DLL_Name;
str paramwhole;
str paramfilename;
str paramCond;
str ViewYesNo;
int ret;
str selectionFormula;
COMVariant variant;

DialogButton diagBut;
str strMessage;
str strTitle;
;

super();

variant = new COMvariant(COMVariantInOut::OUT,COMVariantType::VT_BOOL) ;
//paramwhole = this.args().parm("'{Employee.empcode}'='11752'");
paramwhole = this.args().parm();
//paramwhole = this.args().parm("{Employee.empcode}='11752'");
//paramwhole = this.args().parm("{?DateFrom}='01/01/2021';{?DateTo}='03/03/2021';{Employee.empcode}='11752'");

comapp = new COM("CrystalRuntime.Application.11");
ret = strfind(paramwhole,"|",2,strlen(paramwhole));

//paramfilename = "e:\\rptTimeSheet.rpt"; //substr(paramwhole,2,ret-2) ;
paramfilename = "e:\\Report10.rpt"; //substr(paramwhole,2,ret-2) ;
ViewYesNo = substr(paramwhole,1,1);
reporting = comapp.openreport(paramfilename);

reporting.discardsaveddata();


comapp.LogonServer("crdb_odbc.dll","tms","tacs", "sa", "mypassword");
breakpoint;

IDatabase =reporting.Database();

IDatabaseTable = IDatabase.Tables();
IDatabaseSingleTable = IDatabaseTable.Item(1);
INameValuePairs = IDatabaseSingleTable.connectionproperties();
IConnectionProperty = INameValuePairs.add("Use DSN Default Properties",False);


paramcond = substr(paramwhole,ret+1,strlen(paramwhole));

reporting.RecordSelectionFormula(paramCond);
reporting.readrecords();


if(ViewYesNo == 'N')
{
variant.boolean(false);
reporting.PrintOut(variant);
}
else
{
ActiveX.ReportSource(reporting);
ActiveX.width(600);
ActiveX.height(350);
ActiveX.DisplayToolbar(true);
ActiveX.DisplayGroupTree(false);

ActiveX.ViewReport();
ActiveX.Refresh();
}


}

Extend a Form Control Method

$
0
0

Hi, 

is there a way to extend a method of a form control (PU39)?

In particular I want to implement a new lookup-behavior (add a range).

Can I implement a "onLookup"-Eventhandler, implement my new lookup-behavior and deactivate the "standard-Lookup" via 

FormControlCancelableSuperEventArgs ce = e as FormControlCancelableSuperEventArgs;
ce.CancelSuperCall();

How to know when to create non unique indexes?

$
0
0

Hi,

I have a log table that doesn't require a primary/unique index.

So normally i wouldn't put any index with allow duplicate = true. but i read that they are useful

Here's an example of the data

Id1  Id2   Status     Flag

1      1     status1  false

1      1     status2  false

1     1     status2  false

2      1     status1  true

3       2    status 3 false

In my code I use Id1 and status in my ranges so i think i should create an index with allow duplicate = true

But my question is, which one of the following should i create? and why? how do i specify?

A) two indexes, one with Id1 alone and one with status alone

B) two indexes, one with Id1 alone and one with Id1 and status together

C) one index with both Id1 and status together

 

 

how to research other form datasource

$
0
0

Hi experts,

In my controller class i have helper method like below which works fine for my 1st form, however i also need to refresh my 2nd form, so can you please help in filling the incomplete code below.

private void refreshCallingForm(args _args)
    {
        str            fname;
        FormDataSource fds;

        fname   = _args.callerName();
        info("fname is "+fname);
        if(_args && _args.record() && FormDataUtil::isFormDataSource(_args.record()))  
        {
            fds = FormDataUtil::getFormDataSource(_args.record());   
            fds.research(true);
        }

        if (fname != formStr(SalesTableListPage))
        {
            //fds = //SalesTable DS of SalesTableListPage
            fds.research();
        }
       

Filter Form records based on checkbox form control.

$
0
0

Hello all,

I have a form checkbox control that when its enabled i want to filter the form for all records that have a specific enum type on a field.

For example if checkbox is enabled, i wanna show on my form all records that are of type Invoices.

Thank you.

Viewing all 17532 articles
Browse latest View live


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