web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

In x++ dialog button

(0) ShareShare
ReportReport
Posted on by 1,215

Hi guys,

i want to add a button below image 

8132.Img.PNG

so that i wrote a code below and below my code after lookup side shows now i want to add in a Right side.

 public Object dialog()
    {
        FormBuildButtonControl buttonControl;

        DialogGroup            dlgGroup;

        FormBuildGroupControl  buttonGroup;
        dialog  = new Dialog("Import Transactions from Excel");
        dialog = super();

       
        dlgUploadGroup          = dialog.addGroup("@SYS54759");
        formBuildControl        = dialog.formBuildDesign().control(dlgUploadGroup.name());
        dialogCol = dialog.addFieldValue(extendedTypeStr(MPTransColMapping),colMapping);
        //dialogCol1 = dialog.addFieldValue(extendedTypeStr(MPTransColMapping),colMapping);
        buttonControl =  formBuildControl.addControl(FormControlType::Button,'Genarate template');
        buttonControl.text("@SYS339537");
        buttonControl.registerOverrideMethod(methodStr(FormButtonControl, clicked), methodStr(MPMassImportTransactions, clicked),this);
        dlgUploadGroup.columns(1);
        //dlgUploadGroup          = dialog.addGroup("@SYS54759");
       // formBuildControl        = dialog.formBuildDesign().control(dlgUploadGroup.name());
       fileUploadBuild         = formBuildControl.addControlEx(classstr(FileUpload), "Upload");
       fileUploadBuild.style(FileUploadStyle::MinimalWithFilename);
       fileUploadBuild.fileTypesAccepted(".xlsx");



        return dialog;

    }

what did i mistake please give us a solution.

Thanks.

I have the same question (0)
  • Verified answer
    vinitgoyal2005 Profile Picture
    6,332 on at
    RE: In x++ dialog button

    Hi,

    Try below code

    Dialog                  dlg             = new Dialog("Import Transactions from Excel");
            DialogGroup             dlgGroup, dlgGroup2;
            FormBuildGroupControl   buttonGroup,buttonGroup2;
            FormBuildButtonControl  buttonControl;
            FormBuildStringControl  stringControl;
    
            dlgGroup        = dlg.addGroup("@SYS54759");
            dlg.formBuildDesign().dialogSize(0);
            buttonGroup     = dlg.formBuildDesign().control(dlgGroup.formBuildGroup().id());
            buttonGroup.columns(2);
           
            stringControl = buttonGroup.addControl(FormControlType::String,extendedTypeStr(CustAccount));
            stringControl.extendedDataType(extendedTypeNum(CustAccount));
                  
            buttonControl =  buttonGroup.addControl(FormControlType::Button,'Genarate template');
            buttonControl.text("@SYS339537");
    
            dlgGroup2        = dlg.addGroup('ButtonGroup2');
            dlgGroup2.frameType(FormFrameType::None);
            buttonGroup2     = dlg.formBuildDesign().control(dlgGroup2.formBuildGroup().id());
            buttonGroup2.addControlEX(classstr(FileUpload), "Upload");

    the output of it looks like below :

    pastedimage1598189539230v1.png

    You will have to update the code according to your field, I don't have your custom code. I have created only dialog in a job, you will need to update it as per your RunBaseBatch. 

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: In x++ dialog button

    Riyas,

    Right now we have one dialog group and 3 controls under it. You are able to get two columns in the dialog, but the 3rd control declared (Upload control) is appearing on the right.

    I want to to test if we keep only 2 controls under the first group, how they appear on the dialog. This is only possible if we move the 3rd control to a separate group.

  • Riyas ahamed F Profile Picture
    1,215 on at
    RE: In x++ dialog button

    please give us a Example why do we create another dialog group in the same parameter i want to Right side.

  • Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: In x++ dialog button

    Riyas,

    Can you try creating a new dialog group move the upload dialog field under it? I should help you in seperating the controls.

  • Riyas ahamed F Profile Picture
    1,215 on at
    RE: In x++ dialog button

    i tried in your code my output below image,

    logo1.PNG

    i want to only generate button only in Right side so that what should i do its possible ?

    Thanks for your time. 

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: In x++ dialog button

    Please try this code -

    dlgUploadGroup.frameType(FormFrameType::None); 
    dlgUploadGroup.columns(2);

    I tried this and it's working fine for me.

  • Riyas ahamed F Profile Picture
    1,215 on at
    RE: In x++ dialog button

    Thanks for your replay Vinit Goyal ,

    i tried dlgUploadGroup.columns(2) but not working on it browser file alignment changed.

    what to be done ?

  • Suggested answer
    vinitgoyal2005 Profile Picture
    6,332 on at
    RE: In x++ dialog button

    Hi,

    Try changing dlgUploadGroup.columns(1) to dlgUploadGroup.columns(2).

    Let us know if that works.

  • Suggested answer
    vinitgoyal2005 Profile Picture
    6,332 on at
    RE: In x++ dialog button

    Hi,

    Try changing dlgUploadGroup.columns(1) to dlgUploadGroup.columns(2).

    Let is know if that works.

  • Riyas ahamed F Profile Picture
    1,215 on at
    RE: In x++ dialog button

    No, its came output design an a Right side and above my code output result below my image.

    logo.PNG

    Now, i want to show right side 'Generate button' how to change above my code i tried many way won't proper alignment please give us a solution.  

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Sohaib Cheema Profile Picture

Sohaib Cheema 665 User Group Leader

#2
Martin Dráb Profile Picture

Martin Dráb 595 Most Valuable Professional

#3
Yng Lih Profile Picture

Yng Lih 558

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans