Importing customers using dataentity does not init data from customer group, for example Payment Terms does not automatically inizialized from group.
This extension on CustCustomerEntity data entity will fix that problem
[ExtensionOf(dataentityviewstr(CustCustomerEntity))]
final class CustCustomerEntity_Extension
{
[DataEventHandler(tableStr(CustCustomerEntity), DataEventType::MappedEntityToDataSource)]
public static void CustCustomerEntity_onMappedEntityToDataSource(Common _sender, DataEventArgs _eventArgs)
{
CustCustomerEntity custCustomerEntity = _sender;
DataEntityContextEventArgs dataEntityContextEventArgs = _eventArgs;
DataEntityDataSourceRuntimeContext _dataSourceCtx = dataEntityContextEventArgs.parmEntityDataSourceContext();
if (_dataSourceCtx.name() == dataEntityDataSourceStr(CustCustomerEntity, CustTable))
{
CustTable custTable = _dataSourceCtx.getBuffer();
custTable.initFromCustGroup(CustGroup::find(custTable.CustGroup));
}
}
}
Apply to D365FFO Platform Update 11 Spring 2017
venerdì 22 dicembre 2017
giovedì 20 luglio 2017
AX2012: Force ROLE CENTER page to your custom page
In case of you don't have the Enterprise Portal installed or you system (or you don't want install it) but you want the show your own custom page to users on Role Center into Dynamics AX 2012, for example your intranet or sharepoint website, you can do it quite simple.
Attention: This is a not supported procedure, do it only for testing purpose
These are steps:
Attention: This is a not supported procedure, do it only for testing purpose
These are steps:
- Create on localhost for example a WEBSITE and put inside a ASPX page
- Comment out lines 11 and 12 on Form EPWebSiteParameters > Data Sources > WebSiteTable > InternalUrl > validate method
- Insert your website inside enterprise portal configuration (System Administration > Setup > Enterprise Portal > WebSite)
- Link your user to a EPRoleCenter Profile (System Administration > Common > Users > User profiles) for example Accountant
- Modify method getCurrentUsersHomepageURLPath of ProfileManager class, comment out whole code and return your own ASPX page, for mine example default.aspx
- Close Dynamics AX client and reopen it, now your role center page is your own page
The link can be something like this:
menuitemaction://CueRun+CueId=35637150593/
In this case the form related to Cue is opened
Links are catched by method processLink of SysHelp, refer to that class or standard rolecenter links for more information to create your own custom role page.
giovedì 5 gennaio 2017
HOWTO: Run a BATCH using x++ (Helps for debug batch's in a simple way)
On AX2012 batch run always over a CIL context.
For debugging a BATCH without attach Visual Studio to AOS instance you can run in this way:
1. Create the batch job and assing a batch group not managed by a batch server
2. Create this method on BatchRun class:
server static public void runJobStaticCodeIL(RecId batchId)
{
container ret;
XppILExecutePermission xppILExecutePermission;
;
xppILExecutePermission = new XppILExecutePermission();
xppILExecutePermission.assert();
ret = runClassMethodIL(classStr(BatchRun), staticMethodStr(BatchRun, runJobStaticCode), [batchId]);
CodeAccessPermission::revertAssert();
}
3. On batch activity get the JOB ID
2. Run the follow script
static void batchRun(Args _args)
{
Batch batch;
;
select batch where batch.BatchJobId == 5637161890;
BatchRun::runJobStaticCodeIL(batch.RecId);
}
Now you can debug it!
For debugging a BATCH without attach Visual Studio to AOS instance you can run in this way:
1. Create the batch job and assing a batch group not managed by a batch server
2. Create this method on BatchRun class:
server static public void runJobStaticCodeIL(RecId batchId)
{
container ret;
XppILExecutePermission xppILExecutePermission;
;
xppILExecutePermission = new XppILExecutePermission();
xppILExecutePermission.assert();
ret = runClassMethodIL(classStr(BatchRun), staticMethodStr(BatchRun, runJobStaticCode), [batchId]);
CodeAccessPermission::revertAssert();
}
3. On batch activity get the JOB ID
2. Run the follow script
static void batchRun(Args _args)
{
Batch batch;
;
select batch where batch.BatchJobId == 5637161890;
BatchRun::runJobStaticCodeIL(batch.RecId);
}
Now you can debug it!
Iscriviti a:
Post (Atom)
AX 2012: The request was aborted: Could not create SSL/TLS secure channel
The error you're encountering, "The request was aborted: Could not create SSL/TLS secure channel," can occur due to various re...
-
Ussally you have to save a report to an output file for example store it or send it over mail. Here an example to save a report into Excel...
-
A simple way to export a data entity, using the powerful data management framework. You need a definition group, where the entity is mapped ...
-
NumberSeq numberSeq; InventTransferTable inventTransferTable; InventTransferLine inventTransferLine; InventDim inventDim; ; ttsbegin; ...