Create Student Marks Sheet In AX 012

create Table With Req Fields.



2)and write code in table Level modifiedField Method

public void modifiedField(FieldId _fieldId)
{
    if(this.Techincal1 >=35 && this.Technical2 >=35 && this.ApptitudeTest >=35)
    {
        this.DLSStatus =DLSStatus::Pass;
    }
    else
    {
        this.DLSStatus = DLSStatus::Fail;
    }

    this.Total = (this.ApptitudeTest+this.Techincal1+this.Technical2);
    this.Percentage =((this.Total/300)*100);
    if(this.Percentage <=60)
    {
        this.DLSGrade = DLSGrade::D;

    }
    else if(this.Percentage >=60 && this.Percentage <=70)
    {
        this.DLSGrade =DLSGrade::C;
    }
    else if(this.Percentage > 70 && this.percentage <=85)
    {
        this.DLSGrade = DLSGrade::B;
    }
    else if(this.Percentage >85)
    {
        this.DLSGrade =DLSGrade::A;
    }

    super(_fieldId);

**And Also Validate fields(<0 &&>100)

public boolean validateField(FieldId _fieldIdToCheck)
{
    boolean ret;

    ret = super(_fieldIdToCheck);
    if(ret)
    {
    switch(_fieldIdToCheck)
    {
    case fieldNum(DLSInterviewDetails,ApptitudeTest):
    if(this.ApptitudeTest <0 || this.ApptitudeTest >100)
    {
        error("Should give within 0 to 100 values only");
         this.ApptitudeTest=0;
    }
    break;
    case fieldNum(DLSInterviewDetails,Techincal1):
    if(this.Techincal1 <0 || this.Techincal1 >100)
    {
        error("Should give within 0 to 100 values only");
        this.Techincal1=0;
    }
    break;
    case fieldNum(DLSInterviewDetails,technical2):
    if(this.Technical2 <0 || this.Technical2 >100)
    {
        error("Should give within 0 to 100 values only");
        this.Technical2=0;
    }
    break;
    }
    }
    return ret;
}

Comments

Popular posts from this blog