Thursday 15 May 2014

What is a static method? how they are accessed?

Static method  are  attached  to aclass but dont need that class should  be  instantiated  to exrcute  that method  they usually used to instantiate the class
Static  method  can be  accessed by doubled  colon(::)


Pubilc  static mystaticmethod()
{
}
then this method  can be  accessed by 
myclass::mystatic method();

Tuesday 13 May 2014

How to deploy all AX2012 report






There're 3 different ways to deploy Dynamics AX2012 reports:
Through AOT
AOT > SSRS Reports > Reports > right click on report > Deploy Element

Through Visual Studio
Open the report project > Right click on the project or solution node > Deploy

Through PowerShell
Publish-AXReport -ReportName *

Adding FileNameOpen Extended Data Type to a Form


After add EDT FileNameOpen to form using New -> stringEdit, 


add some form methods:

str fileNameLookupFilename()
{
    return '';
}

str fileNameLookupTitle()
{
    return "@SYS53008";
}

str fileNameLookupInitialPath()
{
    return '';
}
container fileNameLookupFilter()
{
    return ['All files','*.*'];
}

After get the file path, call insert method:

public void AvInsertAttachment(filename file, int i)
{    
    DocuRef docuRef;
    DocuActionArchive archive;
    ;           
    
    if(file)
    {
        ttsbegin;
        docuRef.clear();
        docuRef.RefRecId = DirPartyEntity.RecId;
        docuRef.RefTableId = tableNum(CustTable);
        docuRef.RefCompanyId = DirPartyEntity.dataAreaId;
        docuRef.Name = strFmt("Consultant Attachment %1", i);
        docuRef.TypeId = 'File';
        docuRef.insert();
        archive = new DocuActionArchive();
        archive.add(docuRef, file);
        ttsCommit;
    }
}
Result:

Queries in AX 2012

EXPANDED QUERY IN THE AOT

Query query;
QueryRun queryRun;
QueryBuildDataSource qbds;
QueryBuildRange qbr;
SalesTable SalesTable;
;
query = new Query();
//this line attaches a table to the qbds data source object
qbds = query.addDataSource(TableNum (SalesTable));

//this line attaches a range to the 'SalesTable' 
//data source, the range is the CustAccount
qbr = qbds.addRange(FieldNum (SalesTable,CustAccount));

// The range is set to '2001'
qbr.value ('2001');

// The query will sort by sales id
qbds.addSortField (FieldNum(SalesTable,SalesId));

// The queryRun object is instantiated using the query
queryRun = new QueryRun(query);

// The queryRun object loops through all records returned
while (queryRun.next())

{
// The current record is assigned to the salesTable variable
SalesTable = queryRun.get(tableNum(SalesTable));
print SalesTable.SalesId;
}

Data Manipulation - Insert, Update, Delete



// INSERT

custTable custTable;
;
custTable.accountNum ="1234";
custTable.name ="John Customer";
custTable.insert();
_________________________________________________________________________________

//UPDATE

SalesTable salesTable;
;
ttsbegin;
while select forupdate salesTable
where salesTable.CustAccount =="2001"
{
salesTable.SalesName ="New Enterprises";
salesTable.update();
}
ttscommit;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


InventTable InventTable;
;
ttsbegin;
while select forupdate InventTable
where InventTable.ItemGroupId =="Television"
{
InventTable.ItemPriceToleranceGroupId ="2%";
InventTable.update();
}
ttscommit;
Microsoft

_________________________________________________________________________________

//DELETE

CustTable custTable;
;
ttsbegin;
Select forUpdate custTable
where custTable.accountnum =="2032";
custTable.delete();
ttscommit;

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//DELETE_from

CustTable custTable;
;
delete_from custTable
where custTable.AccountNum =="4018";

While Select



CustTable custTable;
while select accountNum, name, address from custTable
{
print custTable.AccountNum, " ", custTable.Name, " ",
custTable.Address;
pause;
}
_________________________________________________________________________________

CustTable custTable;
;
while select custTable
where custTable.AccountNum > "4005"
&& custTable.AccountNum < "4017"
{
print custTable.AccountNum , " ",custTable.Name;
}
pause;
_________________________________________________________________________________
//Sorting Obtion index

CustTable custTable;
;
while select custTable index AccountIdx
{
print custTable.AccountNum, " ", custTable.Name;
}
pause;

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 //ORDER BY


CustTable custTable;
;
while select custTable order by AccountNum desc
{
print custTable.AccountNum, " ", custTable.Name;
}
pause;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

//GROUP BY
SalesTable salesTable;
;
while select count(salesid) from salesTable group by
CustGroup
{
print salesTable.CustGroup," ",salesTable.salesid;
}
pause;

_________________________________________________________________________________
//Aggregate
sum -->Returns the sum of the values in a field.
avg -->Returns the average of the values in a field.
maxof -->Returns the maximum of the values in a field.
minof -->Returns the minimum of the values in a field.
count -->Returns the number of records that satisfy the statement. Count can only be used on numerical fields, since the result will be returned in that field.



select sum(amountMST) from ledgerTrans;
sumAmountMST = ledgerTrans.amountMST;
select count(recId) from ledgerTrans;
countLedgerTrans = ledgerTrans.recId;






Look up







// create in Form/Fields/fields name/Methods
public void lookup(FormControl _formControl, str _filterStr)
{

    ;
    lookupMaster::lookupMasterNumber(_formControl);
}




//Create in class/ new method
public static boolean lookupMasterNumber(FormStringControl   _ctrl)

{
    SysTableLookup          sysTableLookup = SysTableLookup::newParameters(tablenum(Master1), _ctrl);
    Query                   query;
    QueryBuildDataSource    qdbsTransport;
    AvVendorRoleTable       avVendorRoleTable;
 
    ;
    //display
    sysTableLookup.addLookupfield(fieldnum(Master1, MasterNumber), true);
    sysTableLookup.addLookupfield(fieldnum(Master1, MasterID));

    //logic and assign table & field
    query           = new Query();
    qdbsTransport   = query.addDataSource(tablenum(Master1));
    qdbsTransport.addRange(fieldnum(Master1, AvStatus)).value(queryValue(Avstatus::Approve));
 

    sysTableLookup.parmQuery(query);
    sysTableLookup.performFormLookup();
    return true;
}

Dialog Boxes

Dialog Boxes


static void Simple_Dialog(Args _args)
{
dialog dlg;
dialogGroup dlgGroup;
dialogField dlgField;
;
dlg = new dialog("Simple Dialog");
dlgGroup = dlg.addGroup("Customer");
dlgField = dlg.addField(TypeID(custAccount),"Account Number");

if (dlg.run())
{
print dlgField.value();
pause;
}
}

Pack and Unpack

Pack and Unpack


ClassDeclaration

class Tutorial_RunbaseBatch extends RunBaseBatch
{
    // Packed variables
    TransDate       transDate;
    CustAccount     custAccount;

    // Dialog fields
    DialogField     dlgCustAccount;
    DialogField     dlgTransDate;

    #define.CurrentVersion(1)
    #define.Version1(1)
    #localmacro.CurrentList
        transDate,
        custAccount
    #endmacro
}

Dialog


public Object dialog()
{
    DialogRunbase       dialog = super();
    #resAppl
;
    dialog.addImage(#ImageEmployee);
    dialog.addInfoImage();
    dlgTransDate = dialog.addFieldValue(typeid(TransDate),transDate);

    dialog.addTabPage("@SYS76580");
    dlgCustAccount = dialog.addFieldValue(typeid(CustAccount),custAccount);

    return dialog;
}

Pack

public container pack()
{
    return [#CurrentVersion,#CurrentList];
}



Unpack

public boolean unpack(container packedClass)
{
    Version version = RunBase::getVersion(packedClass);
;
    switch (version)
    {
        case #CurrentVersion:
            [version,#CurrentList] = packedClass;
            break;
        default:
            return false;
    }

    return true;
}

Main


static void main(Args args)
{
    Tutorial_RunbaseBatch    tutorial_RunBase;
 
;
    tutorial_RunBase = Tutorial_RunbaseBatch::construct();

    if (tutorial_RunBase.prompt())
    {
        tutorial_RunBase.run();
    }

MaCROS

Macros


#define.Text('This is a test of macros')
#define.Number(200)

static void Datatypes_macro_library(Args _args)
{
    // Referencing macro library has to be done in the class declaration
    // or in the declaration like in this example
    #MacroTest

    ;
    info(strfmt("Text: %1. Number: %2", #Text, #Number));
}


Local Macro

static void Local_Macro(Args _args)
{
    // Define the local macro    #localmacro.WelcomeMessage    {        info("Welcome to Carz Inc.");
        info("We have the best offers for rental cars");
    }

    #endmacro;  

    // Use the local macro  
    #WelcomeMessage
}


Deploy all report


Open Windows PowerShell as an administrator by following these steps:


1. Click Start > Administrative Tools.


2. Right-click the Microsoft Dynamics AX 2012 Management Shell option.


3. Click Run as administrator.


4. To deploy a specific report, enter the name of the report. For example, to deploy the CustTransList report, enter the following command:


 Publish-AXReport -ReportName CustTransList


5. To deploy two or more specific reports, enter the names of the reports. For example, to deploy the CustTransList and CustTransOpenPerDate reports,

   enter the following command:


 Publish-AXReport -ReportName CustTransList, CustTransOpenPerDate



6. To deploy all reports, enter the following command:


 Publish-AXReport ReportName *

Monday 12 May 2014

How to delete Label Files from AX 2012

How to delete Label Files from AX 2012

Here are the steps to delete Label Files from AX 2012:

  • Create a new model. You could call it "LabelsBeGone".
  • Open the AOT and move the Label File(s) you want to get rid of to the new model.
  • Close AX and stop the AOS.
  • Use AXUtil to delete the new model.
  • Delete the label files from the server folder; C:\Program Files\Microsoft Dynamics AX\60\Server\...\bin\Application\Appl\Standard
  • Start the AOS.
  • Skip the upgrade wizard.

Hiding a data member attribute from dialogs


[DataMemberAttribute, SysOperationControlVisibilityAttribute(false)]
public int parmIntProperty(int _parmIntProperty = parmIntProperty)
{
    parmIntProperty = _parmIntProperty;

    return parmIntProperty;
}

Wednesday 7 May 2014

Work Flow in AX-2012 steps:

Work Flow in AX-2012 steps:

Steps:
First create one enum type (approval state)
One table having(Ex: WFTable)
Enum field
Submitted by field
Submitted date field
//And one edit field(NA)
Here in that table 5 methods mandatory
1.Find():
public static WFTable find(Name    Name, boolean _forupdate = false)
{
    WFTable WFTable;//        leaveRequests;
;
    WFTable.selectForUpdate(_forupdate);

    if(Name)
    {
        select WFTable
            where WFTable.Name == Name;
    }

    return WFTable;
}

2.findRecId():
static WFTable findRecId(RecId    _recId,
                           boolean  _forUpdate = false)
{
    WFTable WFTable;
    ;

    if (_recId)
    {
        WFTable.selectForUpdate(_forUpdate);

        select firstonly WFTable
            where WFTable.RecId == _recId;
    }
    return WFTable;
}


3.can submit():
public boolean canSubmit()
{
;
    if(this.WFEnabled == ApprovalState::NotSubmitted  && this.RecId)
        return true;
    else
        return false;
}

4.cansubmittedworkflow():
Display boolean CanSubmitToWorkFlow(str _workflowtype =  '')
{
 return this.canSubmit();
}

5.UpdateWorkflowState ():
public static void UpdateWorkflowState(RefRecId _recId, ApprovalState _state)
    {
        WFTable WFTable = WFTable::findRecId(_recId, true);
         
        ttsBegin;

        
        WFTable.WFEnabled = _state;

        /
          WFTable.update();
        ttsCommit;
   }


Then next Create a query and add data source as our table
And then create form and design the form
Here in design properties set this three property as mandatory
(Workflow enabled-yes
Workflow data source-our table name
Workflow type- our workflow type             ::this properties are set in last)

And then go to AOT:
1.Create workflow category-  R.C properties – here select module name(in which module ur working)
2.workflow type-rc-add ins –create workflow type through wizard
Set properties as:
Name- name of workflow type
Category- name of our category type
Query- name of query which u created
 Document Menu item- name of form or list page menu item(in which form or list page ur showing the list page status)
Document web menu item –NA
Generate menu item –Rich client
//(no need to give field groups)
3.approval- rc-add ins –create workflow Approval through wizard
Set properties as:
Name- approval name
Workflow document- document item name
Document preview field group-no need to give
Document menu item- our form or list page menu item name
Document web menu item- na
Generate menu item-rich client
Enable deny outcome-na
4. I f we need task also same R.c-on task-add ins – generate task wizard-here also set the properties
Then drag in to workflow type supported items like as approval
Name-name of the task
Workflow document- document item name
Document preview field group-no need to give
Document menu item- our form or list page menu item name
Document web menu item- na
Generate menu item-rich client


Then click next above window opens
Here we add two things one returned and completed then next click ok



5. Incremental CIL
6. drag the approval and task(first) to our workflow type supported element
And then


Write code in classes:
WFApprEventHandler():

Classdeclaratio():
class WFApprEventHandler implements    WorkflowElementCanceledEventHandler,  WorkflowElemChangeRequestedEventHandler,
                                                        WorkflowElementCompletedEventHandler, WorkflowElementReturnedEventHandler,
                                                        WorkflowElementStartedEventHandler, WorkflowElementDeniedEventHandler,
                                                        WorkflowWorkItemsCreatedEventHandler
{
}

Canceled():
public void canceled(WorkflowElementEventArgs _workflowElementEventArgs)
{
     WFTable::UpdateWorkflowState(_workflowElementEventArgs.parmWorkflowContext().parmRecId(), ApprovalState::Cancelled);
}

changeRequested():
public void changeRequested(WorkflowElementEventArgs _workflowElementEventArgs)
{
    WFTable::UpdateWorkflowState(_workflowElementEventArgs.parmWorkflowContext().parmRecId(), ApprovalState::ChangeRequest);
}

Completed():
public void completed(WorkflowElementEventArgs _workflowElementEventArgs)
{
    WFTable::UpdateWorkflowState(_workflowElementEventArgs.parmWorkflowContext().parmRecId(), ApprovalState::Approved);
}




created ():
public void created(WorkflowWorkItemsEventArgs _workflowWorkItemsEventArgs)
{
    // TODO:  Write code to execute once work items are created.
}


denied ():
public void denied(WorkflowElementEventArgs _workflowElementEventArgs)
{
   WFTable::UpdateWorkflowState(_workflowElementEventArgs.parmWorkflowContext().parmRecId(), ApprovalState::Returned);
}



returned ():
public void returned(WorkflowElementEventArgs _workflowElementEventArgs)
{
    WFTable::UpdateWorkflowState(_workflowElementEventArgs.parmWorkflowContext().parmRecId(), ApprovalState::Returned);
}

Started():
public void started(WorkflowElementEventArgs _workflowElementEventArgs)
{
    WFTable::UpdateWorkflowState(_workflowElementEventArgs.parmWorkflowContext().parmRecId(), ApprovalState::PendingApproval);
}


WFTypeEventHandler():

Classdeclaration():

class WFTypeEventHandler implements    WorkflowCanceledEventHandler,  WorkflowCompletedEventHandler,
                                                        WorkflowStartedEventHandler
{
}

Canceled():
public void canceled(WorkflowEventArgs _workflowEventArgs)
{
    WFTable::UpdateWorkflowState(_workflowEventArgs.parmWorkflowContext().parmRecId(), ApprovalState::Cancelled);
}


completed ():
public void completed(WorkflowEventArgs _workflowEventArgs)
{
    WFTable::UpdateWorkflowState(_workflowEventArgs.parmWorkflowContext().parmRecId(), ApprovalState::WorkflowCompleted);
}


started ():
public void started(WorkflowEventArgs _workflowEventArgs)
{
    WFTable::UpdateWorkflowState(_workflowEventArgs.parmWorkflowContext().parmRecId(), ApprovalState::Submitted);
}





WFTypeSubmitManager():

Classdeclaration():
public class WFTypeSubmitManager
{
    Name                        Name;
    WFTable                     WFTable;
    WorkflowVersionTable        workflowConfigurationTable;
    WorkflowComment             workflowComment;
    boolean                     submit;
    WorkflowWorkItemTable       workflowWorkItemTable;
    UserId                      userId;
    MenuItemName                menuItemName;
    WorkflowTypeName            workflowTemplateName;
    EPWorkflowControlContext    workflowControlContext;
}

dialogOk():

public boolean dialogOk()
{
    WorkflowSubmitDialog workflowSubmitDialog;
    WorkflowWorkItemActionDialog workflowWorkItemActionDialog;

    boolean ok;
    ;
    if (menuItemName == menuitemactionstr(WFTypeSubmitMenuItem))
    {
        workflowSubmitDialog = WorkflowSubmitDialog::construct(this.parmWorkflowConfigurationTable());
        workflowSubmitDialog.run();
        this.parmWorkflowComment(workflowSubmitDialog.parmWorkflowComment());
        ok = workflowSubmitDialog.parmIsClosedOK();
    }
    else if (menuItemName == menuitemactionstr(WFApprResubmitMenuItem))
    {
        workflowWorkItemActionDialog = WorkflowWorkItemActionDialog::construct( workflowWorkItemTable,
        WorkflowWorkItemActionType::Resubmit,
        new MenuFunction(menuitemactionstr(WFApprResubmitMenuItem), MenuItemType::Action));
        workflowWorkItemActionDialog.run();
        this.parmWorkflowComment(workflowWorkItemActionDialog.parmWorkflowComment());
        ok = workflowWorkItemActionDialog.parmIsClosedOK();
        userId = workflowWorkItemActionDialog.parmTargetUser();
    }
    return ok;
}


Init():
public void init( Common _documentRecord,
                    MenuItemName _menuItemName,
                    WorkflowVersionTable _workflowConfigurationTable,
                    WorkflowWorkItemTable _workflowWorkItemTable,
                    EPWorkflowControlContext _workflowControlContext
                    )
{
    this.parmWFTable(_documentRecord);
    this.parmSubmit(_menuItemName == menuitemactionstr (WFTypeSubmitMenuItem));
    this.parmMenuItemName(_menuItemName);
    if (_workflowControlContext)
    {
        this.parmWorkflowControlContext(_workflowControlContext);
        this.parmWorkflowWorkItemtable (_workflowControlContext.getActiveWorkflowWorkItem());
        this.parmWorkflowComment(_workflowControlContext.getWorkflowComment());
        this.parmWorkflowTemplateName (_workflowControlContext.getActiveWorkflowConfiguration().WorkflowTable().TemplateName);
    }
    else
    {
        this.parmWorkflowConfigurationTable(_workflowConfigurationTable);
        this.parmWorkflowWorkItemtable(_workflowWorkItemTable);
        this.parmWorkflowTemplateName (this.parmWorkflowConfigurationTable().WorkflowTable().TemplateName);
    }


}

parmMenuItemName():
public MenuItemName parmMenuItemName(MenuItemName _menuItemName = menuItemName)
{
    ;
    menuItemName = _menuItemName;
    return menuItemName;
}


parmSubmit ():
public boolean parmSubmit(boolean _submit = submit)
{
;
submit = _submit;
return submit;
}

parmWFTable():
public WFTable parmWFTable(WFTable _WFTable = WFTable)
{
    ;
    WFTable = _WFTable;
    return WFTable;
}

parmWorkflowComment():
public WorkflowComment parmWorkflowComment(WorkflowComment _workflowComment = workflowComment)
{
;
workflowComment = _workflowComment;
return workflowComment;
}

parmWorkflowConfigurationTable():
public WorkflowVersionTable parmWorkflowConfigurationTable(WorkflowVersionTable _workflowConfigurationTable = workflowConfigurationTable)
{
;
workflowConfigurationTable = _workflowConfigurationTable;
return workflowConfigurationTable;
}

parmWorkflowControlContext():
public EPWorkflowControlContext parmWorkflowControlContext(EPWorkflowControlContext _workflowControlContext = workflowControlContext)
{
;
workflowControlContext = _workflowControlContext;
return workflowControlContext;
}

parmWorkflowTemplateName():
public WorkflowTypeName parmWorkflowTemplateName(WorkflowTypeName _workflowTemplateName = workflowTemplateName)
{
;
workflowTemplateName = _workflowTemplateName;
return workflowTemplateName;
}

parmWorkflowWorkItemtable():
public WorkflowWorkItemTable parmWorkflowWorkItemtable(WorkflowWorkItemTable _workflowWorkItemTable = workflowWorkItemTable)
{
;
workflowWorkItemTable = _workflowWorkItemTable;
return workflowWorkItemTable;
}

reSubmit():
private void reSubmit()
{
    Object WFTable_ds;
    NoYes                   reSubmittingFromWeb;

    // If we have a workflow control context, we are being resubmitted from EP
    reSubmittingFromWeb = this.parmWorkflowControlContext() == null ? NoYes::No : NoYes::Yes;
    ttsbegin;

    WorkflowWorkItemActionManager::dispatchWorkItemAction( workflowWorkItemTable, workflowComment, userId, WorkflowWorkItemActionType::Resubmit, menuItemName, false);
    WFTable_ds = WFTable.dataSource();
    WFTable = WFTable::findRecId(WFTable.RecId, true);

    WFTable.WFEnabled = ApprovalState::Submitted;
    WFTable.doUpdate();
    if (WFTable_ds)
    {
        WFTable_ds.write();
        WFTable_ds.refresh();
    }
    ttscommit;
}

submit():
private void submit()
{
    Object WFTable_ds;
    NoYes activatingFromWeb;
    ;
    // If we have a workflow control context, we are being activated from EP
    activatingFromWeb = this.parmWorkflowControlContext() == null ? NoYes::No : NoYes::Yes;

    ttsBegin;
    Workflow::activateFromWorkflowType( this.parmWorkflowTemplateName(),WFTable.RecId, this.parmWorkflowComment(),activatingFromWeb, curuserid());
    WFTable_ds = WFTable.dataSource();
    WFTable = WFTable::findRecId(WFTable.RecId, true);
    WFTable.SubBy = curuserid();
  //  WFTable.SubDate = utcDateTime2SystemDateTime(DateTimeUtil::utcNow());
    WFTable.WFEnabled = ApprovalState::Submitted;
    WFTable.doUpdate();
    if (WFTable_ds)
    {
        WFTable_ds.write();
        WFTable_ds.reread();
        WFTable_ds.refresh();
    }
    ttsCommit;
}

construct():
public static WFTypeSubmitManager construct()
{
    return new WFTypeSubmitManager();
}



Main():
public static void main(Args args)
{
    WFTypeSubmitManager WFTypeSubmitManager;
    //EmplContract EmplContract;
    WFTable           WFTable;
     // Variable declaration.
    recId recId;
    WorkflowCorrelationId workflowCorrelationId;
    Object                          callerDataSource;

    // Hardcoded workflow type name
    workflowTypeName workflowTypeName = workflowtypestr("WFType");

    // Initial note is the information that users enter when they
    // submit the document for workflow.
    WorkflowComment initialNote = "Enter any comments here.";
    WorkflowSubmitDialog workflowSubmitDialog;

    // The name of the table containing the records for workflow.
    FormDataSource   WFTable_ds;

    // Workflow Control Context
    EPWorkflowControlContext workflowControlContext;

    ;
    WFTable = args.record();
    WFTypeSubmitManager = WFTypeSubmitManager::construct();
    if (args.menuItemName() == menuitemactionstr(WFTypeSubmitMenuItem) ||
        args.menuItemName() == menuitemactionstr(WFApprResubmitMenuItem))
    {
        WFTypeSubmitManager.init(args.record(), args.menuItemName(), args.caller().getActiveWorkflowConfiguration(), args.caller().getActiveWorkflowWorkItem(),null);
    }
    else
    {
        WFTypeSubmitManager.init(args.record(), args.menuItemName(), nullnull, args.caller());
    }

    if (WFTypeSubmitManager.dialogOk())
    {
            if (WFTypeSubmitManager.parmSubmit())
            {
                WFTypeSubmitManager.submit();
            }
            else
            {
                WFTypeSubmitManager.reSubmit();
            }

            if (args.menuItemName() == menuitemactionstr(WFTypeSubmitMenuItem) ||
                args.menuItemName() == menuitemactionstr(WFApprResubmitMenuItem))
                    args.caller().updateWorkflowControls();
    }



    if (!webSession())
    {
        callerDataSource = args.record().dataSource();
        if (callerDataSource)
        {
            callerDataSource.research(true);
        }

        args.caller().updateWorkflowControls();
    }

}

WFTaskEventHandler:

Classdeclaration() :

class DN_ReserveTaskEventHandler implements    WorkflowElementCanceledEventHandler,  WorkflowElemChangeRequestedEventHandler,
                                                        WorkflowElementCompletedEventHandler, WorkflowElementReturnedEventHandler,
                                                        WorkflowElementStartedEventHandler, WorkflowElementDeniedEventHandler,
                                                        WorkflowWorkItemsCreatedEventHandler
{
}

Canceled();

public void canceled(WorkflowElementEventArgs _workflowElementEventArgs)
{
    /// TODO:  Write code to execute once the workflow is canceled.
}

changeRequested();

public void changeRequested(WorkflowElementEventArgs _workflowElementEventArgs)
{
    /// TODO:  Write code to execute once change is requested for the workflow.
}

Completed():

public void completed(WorkflowElementEventArgs _workflowElementEventArgs)
{
   WFTable::UpdateWorkflowState(_workflowElementEventArgs.parmWorkflowContext().parmRecId(),ApprovalState::TaskCompleted);
}

Created():

public void created(WorkflowWorkItemsEventArgs _workflowWorkItemsEventArgs)
{
    /// TODO:  Write code to execute once work items are created.
}

Denied():

public void denied(WorkflowElementEventArgs _workflowElementEventArgs)
{
    /// TODO:  Write code to execute once the workflow is denied.
}

Returned():

public void returned(WorkflowElementEventArgs _workflowElementEventArgs)
{
   WFTable::UpdateWorkflowState(_workflowElementEventArgs.parmWorkflowContext().parmRecId(),ApprovalState::Returned);

}
Started():

public void started(WorkflowElementEventArgs _workflowElementEventArgs)
{
 WFTable::UpdateWorkflowState(_workflowElementEventArgs.parmWorkflowContext().parmRecId(),ApprovalState::TaskStarted);
}





After that go to the module where u r working then go to area page-setup-workflow configuration

Click on that

Create new- select what u crated

Here u create flow diagram
Here give the
Basic settings
Assignment-user for task to ur id(only u)
Assignment-user for approval to approval persons (one r many)
Here we give the completion policy(for approval)-single approve
Here we give the time limit for approval(default r check all days)



SQL/SSRS Interview questions I thought of blogging some SQL/SSRS interview questions.

Below are some. I will add more, when I complete the compilation 1. What is OLTP(Online Transaction Processing)? OLTP stands ...