Wednesday, 8 June 2016

To append string using computed column in View

public static server str POConfirmationJournal()

{
TableName viewName = tableStr(DESPurchOpenLines);
return SysComputedColumn::add(SysComputedColumn::returnField(viewName,identifierStr(PurchTable),fieldStr(PurchTable,PurchId)),
SysComputedColumn::cast(SysComputedColumn::returnLiteral('-1'), 'VARCHAR'));
 
}
 
 
 


 

Tuesday, 24 May 2016

To find Minimum DateTime from all records of a table

DateTimeUtil::applyTimeZoneOffset(vendPurchOrderJour.DESPODateTime, DateTimeUtil::getUserPreferredTimeZone());

Tuesday, 10 May 2016

Create lookup form and add the lookup form to the form control in AX 2012

1. To create lookup form, first create a query(Optional) with the required data sources and appropriate relations.
2. Create a lookup form with the query as datasource. Set the style property of the design to Lookup.
3. In the form init(), the following code has to be written after Super()

    element.selectMode(DirPartyTable_Name);

where DirPartyTable_Name is control in the grid.
4.Go the form control for which lookup form needs to be assigned(Navigate to the control in the design list ) and override lookupReference(Lookup) based on the field type and add the following code in the method
public Common lookupReference()
{

    Args                args;
    FormRun             formRun;
    DirPartyTable       selectedRecord;

    args = new Args();
    args.name(formStr(SalesRepLookup));
    args.caller(element);

    formRun = classfactory.formRunClass(args);
    formRun.init();
    formRun.selectRecordMode(this);
    this.performFormLookup(formRun);

    selectedRecord = formRun.selectRecordModeSelectedRecord();

    return selectedRecord;
}
That's it we are done with the lookup form.




Friday, 1 April 2016

To hide form tab page for a specific role

Please follow below steps to give specific access to form control

1.       Set needed permission on tab page\control property to manual
2.       Drag the tab to all permissions node under the permissions node
3.       Go to form related privilege- form> add-in> security tool> find related role and privilege
4.       Go to privilege and drag the form into privilege>permissions>forms node and then drag the tab.

5.       Now give no access on dragged tab page.

Thursday, 31 March 2016

SysOperation framework

http://devexpp.blogspot.in/2013/11/introduction-to-sysoperation-framework.html

Monday, 14 March 2016

Bundle batch process in AX 2012

Below is the link to bundle batch process in AX 2012

https://letsdodynamicsax.wordpress.com/2015/07/16/how-to-bundle-batch-process-in-ax-2012/

Open VS in CUS layer

1. To open VS in VS, properties of VS has to bet in Target as shown below
2. "E:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe" /AXConfig C:\Users\sbandy\Desktop\AXCUS.axc

where E:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe is the path where VS is installed and is the path where AX configuration is present.