One small doubt in ax

Hi All,

I am using throw error in the void method of one class.But using that throw error cmd it is stopping some process.Can anybody tell me how to resolve it.

Hi,

Can u tell me the functionality and why you use that throw error command and what are the other services stopped…

Thanks and Regards,

Enrique

I am attaching some pay components for the employee.for ex:-Basic pay,Dearness Pay,Conveyallowance,washing allowance,pension contribution.In that baisc pay and deraness pay are attached in the form whereas for conveyance allowance we have added some validdation by throwing that error.Only thing con all should not be attached due to that validation but washing and pension contribution need to be attached.But due to throw command it is stopping by attaching washing all and pension contribution.

Can anybody help me in this.

Not clear how and what validation your code handles? Put some example code for more understanding…

if(PayChar == iDMS_PayCharacter::EZNPAYConveyanceAllowance)
{
if(EmplTable.EZN_EClass == iDMS_EClass::Class1
|| EmplTable.EZN_EClass == iDMS_EClass::Class2
|| EmplTable.EZN_EClass == iDMS_EClass::ClassS1)
{
throw error(“Conveyance allowance is not allowed for class s1,s2 employees”);

}
}

void calcPayElement()
{
if(PayChar == iDMS_PayCharacter::EZNPAYConveyanceAllowance)
{
if(EmplTable.EZN_EClass == iDMS_EClass::Class1
|| EmplTable.EZN_EClass == iDMS_EClass::Class2
|| EmplTable.EZN_EClass == iDMS_EClass::ClassS1)
{
throw error("@USM564");

}
}

}

Hi,

Put the debugger and see when the throw error is executed. When an error is thrown, it wont update anything and it will stop the whole thing related to it. Else, dont use throw error. instead, just display the error message in info…