Workflow creation in Master Planning Module for Planned Order Details

Hi Everyone,

I am trying to create a workflow for Planned Order Details in Master Planning Module in AX 2009.

But what i observed is, in the Form ReqTransPo> Datasources > ReqTrans , there is a

JoinSource as ReqPO and LinkType as InnerJoin.

I had created a workflow for ReqPo datasource, but in the Main method the record is not selecting , i am passing the below code.

public static void main(Args args)

{

TC_MasterPlanningWorkflow MasterPlanningWorkflow;

ReqPo reqPo;

ReqTrans reqTrans;

;

reqpo = args.record();

MasterPlanningWorkflow = TC_MasterPlanningWorkflow::construct();

if (args.menuItemName() == menuitemactionstr(TC_MasterPlanSubmitToWorkflow) ||

args.menuItemName() == menuitemactionstr(TC_MasterPlanResubmitToWorkflow))

{

MasterPlanningWorkflow.init(args.record(), args.menuItemName(), args.caller().getActiveWorkflowConfiguration(), args.caller().getActiveWorkflowWorkItem(), null);

}

else

{

MasterPlanningWorkflow.init(args.record(), args.menuItemName(), null, null, args.caller());

}

if (MasterPlanningWorkflow.dialogOk())

{

if (MasterPlanningWorkflow.parmSubmit())

{

MasterPlanningWorkflow.submit();

}

else

{

MasterPlanningWorkflow.reSubmit();

}

if (args.menuItemName() == menuitemactionstr(TC_MasterPlanSubmitToWorkflow) ||

args.menuItemName() == menuitemactionstr(TC_MasterPlanResubmitToWorkflow))

args.caller().updateWorkflowControls();

}

}

May i know where i had done the mistakeā€¦

Thanks in advanceā€¦