Saturday 20 April 2024

AX365 Workflow bar is not showing in normal steps

 public static class KPFVendTableForm_Extension

{

    [FormEventHandler(formStr(VendTable), FormEventType::Initializing)]

    public static void SalesTableListPage_OnInitializing(xFormRun sender, FormEventArgs e)

    {

        FormRun                VendTableListPage         = sender;

        FormBuildDesign VendTableListPageDesign = VendTableListPage.form().design();


        VendTableListPageDesign.workflowEnabled(true);

        VendTableListPageDesign.workflowDatasource(tableStr(VendTable));

        VendTableListPageDesign.workflowType(workflowTypeStr(KPFVendorWorkflowType));

    }


    [PostHandlerFor(classStr(FormDataUtil), staticMethodStr(FormDataUtil, canSubmitToWorkflow))]

    public static void FormDataUtil_Post_canSubmitToWorkflow(XppPrePostArgs args)

    {

        Common             record               = args.getArg(identifierStr(_record));

        VendTable          salesTable           = record as VendTable;

        boolean            ret                  = args.getReturnValue();


        if (record.TableId == tableNum(VendTable))

        {

            if (salesTable.VendorStatus == KPF_ProductWorkflowBaseEnum::Draft)

            {

                ret = boolean::true;

            }

            else

            {

                ret = boolean::false;

            }

        }

        args.setReturnValue(ret);

    }


    [PostHandlerFor(formStr(VendTable), formMethodStr(VendTable, canSubmitToWorkflow))]

    public static void SalesTable_Post_canSubmitToWorkflow(XppPrePostArgs args)

    {

        FormRun salesTableDetails = args.getThis();

        formDataSource salesTableDS    = salesTableDetails.dataHelper().FindDataSource(formDataSourceStr(VendTable, VendTable));

        VendTable salesTable    = salesTableDS.cursor();

        boolean ret    = args.getReturnValue();

        if (salesTable.VendorStatus == KPF_ProductWorkflowBaseEnum::Draft)

        {

            ret = true;

        }

        else

        {

            ret = false;

        }

        args.setReturnValue(ret);

        salesTableDetails.design().controlName('WorkflowActionBarButtonGroup').visible(true);

    }


}

AX365 X++ run code after posting a sales order

 [ExtensionOf(ClassStr(SalesInvoiceJournalPost))]

final class SalesInvoiceJournalPost_Extension

{

   protected void endPost()

   {

       next endPost();

       Info(strFmt("SalesId : %1",custInvoicejour.salesId));

   }

}

Monday 25 March 2024

𝐆𝐢𝐭𝐇𝐮𝐛 𝐂𝐡𝐞𝐚𝐭𝐬𝐡𝐞𝐞𝐭

 1. 𝐑𝐞𝐩𝐨𝐬𝐢𝐭𝐨𝐫𝐲 𝐁𝐚𝐬𝐢𝐜𝐬:

- Clone a Repository:
Command:
git clone <repository_url>


- Initialize a Repository:
Command:
git init


2. 𝐖𝐨𝐫𝐤𝐢𝐧𝐠 𝐰𝐢𝐭𝐡 𝐁𝐫𝐚𝐧𝐜𝐡𝐞𝐬:
- Create a New Branch:
Command:
git branch <branch_name>


- Switch to a Branch:
Command:
git checkout <branch_name>


- Create and Switch to a New Branch:
Command:
git checkout -b <new_branch_name>


- List Branches:
Command:
git branch


3. 𝐂𝐨𝐦𝐦𝐢𝐭𝐭𝐢𝐧𝐠 𝐂𝐡𝐚𝐧𝐠𝐞𝐬:
- Stage Changes:
Command:
git add <file_name>


- Stage All Changes:
Command:
git add .


- Commit Changes:
Command:
git commit -m "Commit message"


4. 𝐏𝐮𝐥𝐥𝐢𝐧𝐠 𝐚𝐧𝐝 𝐏𝐮𝐬𝐡𝐢𝐧𝐠:
- Pull Changes from Remote:
Command:
git pull origin <branch_name>


- Push Changes to Remote:
Command:
git push origin <branch_name>


5. 𝐌𝐞𝐫𝐠𝐢𝐧𝐠 𝐂𝐡𝐚𝐧𝐠𝐞𝐬:
- Merge Branch into Current Branch:
Command:
git merge <branch_name>


6. 𝐖𝐨𝐫𝐤𝐢𝐧𝐠 𝐰𝐢𝐭𝐡 𝐑𝐞𝐦𝐨𝐭𝐞𝐬:
- Add a Remote Repository:
Command:
git remote add <remote_name> <repository_url>


- List Remote Repositories:
Command:
git remote -v


7. 𝐇𝐚𝐧𝐝𝐥𝐢𝐧𝐠 𝐂𝐨𝐧𝐟𝐥𝐢𝐜𝐭𝐬:
- Check for Conflicts:
Command:
git diff


- Resolve Conflicts and Continue Merge:
Command:
git add <file_name>
git merge --continue


8. 𝐆𝐢𝐭𝐇𝐮𝐛 𝐀𝐜𝐭𝐢𝐨𝐧𝐬:
- Workflow Syntax Checking:
Command:
git pull origin <branch_name>
git push origin <branch_name>


9. 𝐌𝐢𝐬𝐜𝐞𝐥𝐥𝐚𝐧𝐞𝐨𝐮𝐬:
- Check Git Status:
Command:
git status


- View Commit History:
Command:
git log


- Ignore Files (Add to `.gitignore`):
Command:
echo "<file_name>" >> .gitignore