Thursday, 14 August 2014

Simple Steps to Generate Number Sequence In Table Level


Step 1:-
               Create an EDT SerialNo.
Step 2:-
              Select the module which you want to generate number sequence.
Step 3:-

              write the following code load module() on NumberSequenceModuleCustomer.

     datatype.parmDatatypeId(extendedTypeNum(SerialNo));
    datatype.parmWizardIsContinuous(true);
    datatype.parmWizardIsManual(NoYes::No);
    datatype.parmWizardIsChangeDownAllowed(NoYes::No);
    datatype.parmWizardIsChangeUpAllowed(NoYes::No);
    datatype.parmWizardHighest(999999);
    datatype.parmSortField(27);
    datatype.addParameterType(NumberSeqParameterType::DataArea, true, false);
    this.create(datatype);
    this.mcrLoadModules(datatype);

Step 4:-
     
    Write the following code on a New method on CustParameterTable.

client server static NumberSequenceReference numRefSerialNo()
{
     return NumberSeqReference::findReference(extendedTypeNum(SerialNo));
}

Step 5:-
         Write the following code on a Job and Run it.


static void serialNo(Args _args)
{
    NumberSeqModuleCustomer  NumberSeqModuleCustomer = new NumberSeqModuleCustomer();
    ;
    NumberSeqModuleCustomer.load();
}

Step 6:-

        Organization Administration >> CommonForms >> Numbersequences>>Numbersequences>> Generate >> run the wizard.

Fill the require Details and Click Generate


Step 7:-

          AccountsReceivable ----> Setup ----> AccountsReceivableParameters ----> NumberSequence

        


Step 8:-

              Create  Table Add the EDT and write following code in initValue() Method.


  public void initValue()

{

  NumberSeq  numberSeq;

 SerialNo num;
 super();
 numberSeq = NumberSeq::newGetNum(CustParameters::numRefSerialNo());
num = numberSeq.num();
this.SerialNo=num;
}

Step 9:-

             Select Cntrl+N Number Sequences is Generated.



   

USING CHECK BOX ENABLE / DISABLE RECORDS WITH THE GRID


Step 1:-

             Create a table and Add some  fields.

Step 2:-

            Add table as a data sources, Create a form.

Step 3:-

          Create a grid under design tab and add fields to the grid.

Step 4:-

           Add a check box to the form.

 Step 5:-



 Write the following code in modified method.

public Boolean modified()
{
boolean ret;
ret = super();
if(checkbox.value()==true)
{
while select CheckBoxTable
{
CheckBoxTable_ds.object(fieldnum(CheckBoxTable,Name)).visible(true);
CheckBoxTable_ds.object(fieldnum(CheckBoxTable,RegNo)).visible(true);
CheckBoxTable_ds.object(fieldnum(CheckBoxTable,Testbox)).visible(true);
}

}
else
{
while select RecId from CheckBoxTable where CheckBoxTable.TestBox == true
{
CheckBoxTable_ds.object(fieldnum(CheckBoxTable,RegNo)).visible(false);
CheckBoxTable_ds.object(fieldnum(CheckBoxTable,Testbox)).visible(false);
CheckBoxTable_ds.object(fieldnum(CheckBoxTable,Name)).visible(false);

}
}

CheckBoxTable_ds.refresh();
return ret;
}


Step 6:-

      Select the check box it will enables the grid.      



OUTPUT:-

       

         Un select the check box it disables the grid.





Tuesday, 12 August 2014

USING COMMAND BUTTON,NEW,DELETE & SAVE THE RECORDS WITHOUT CODING







Step 1:-
            create a table add some fields.

Step 2:-
           Add the newly created table as a data sources to form.

















Step 3:-
           Drag and drop fields in design & Add new buttons.


Step 4:-
       
         Assign button level properties ----> command select the command "Save".





Step 5:-

         As same the above followed by add  New & Delete select the perfect command to perform required action.



Output:-