Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

After creating UIbuilder class for one dailog field, rest dialog field disappear. How to get all dialog fields?

(0) ShareShare
ReportReport
Posted on by 210

[DataContractAttribute,SysOperationContractProcessingAttribute(classstr(TPO_PlantProdUIBuilder))]
class TPO_PlantProductionContract
{
    InventSiteId        inventSiteId;
    SchedFromDate       schedFromDate;
    SchedToDate         schedToDate;
    OprNum              oprNum;
    ProdId              prodId;
    [DataMemberAttribute('InventSiteId')]
    public InventSiteId parmPlantId(InventSiteId _inventSiteId = inventSiteId)
    {
        inventSiteId = _inventSiteId;
        return inventSiteId;
    }

    [DataMemberAttribute('FromDate')]
    public SchedFromDate parmStartDate(SchedFromDate _schedFromDate = schedFromDate)
    {
        schedFromDate = _schedFromDate;
        return schedFromDate;
    }

    [DataMemberAttribute('ToDate')]
    public SchedToDate parmToDate(SchedToDate _schedToDate = schedToDate)
    {
        schedToDate = _schedToDate;
        return schedToDate;
    }

    [DataMemberAttribute("OperationNumber")] 
    public OprNum parmOperationNum(OprNum _oprNum = oprNum)
    {
        oprNum = _oprNum;
        return oprNum;
    }

    [DataMemberAttribute('ProductionNumber')]
    public ProdId parmProductionNum(ProdId _prodId = prodId)
    {
        prodId = _prodId;
        return prodId;
    }

}
3007.ABC.PNG

  • vikash_ Profile Picture
    vikash_ 210 on at
    RE: After creating UIbuilder class for one dailog field, rest dialog field disappear. How to get all dialog fields?

    Hi Blue Wang,

    As you suggested, I have added the other dialog fields, but it's not working

     OperationNum = this.bindInfo().getDialogField(this.dataContractObject(),                            methodstr(TPO_PlantProductionContract,parmOperationNum));

           OperationNum.registerOverrideMethod(methodstr(FormStringControl, lookup),    methodstr(TPO_PlantProdUIBuilder,lookupOperNum ), this);

           ProductionNum   =   this.bindInfo().getDialogField(this.dataContractObject(),                            methodstr(TPO_PlantProductionContract,parmProductionNum));

           Plant =   this.bindInfo().getDialogField(this.dataContractObject(),                            methodstr(TPO_PlantProductionContract,parmPlantId));

           StartDate =   this.bindInfo().getDialogField(this.dataContractObject(),                            methodstr(TPO_PlantProductionContract,parmStartDate));

           EndDate =   this.bindInfo().getDialogField(this.dataContractObject(),                            methodstr(TPO_PlantProductionContract,parmToDate ));

  • Sergei Minozhenko Profile Picture
    Sergei Minozhenko 23,091 on at
    RE: After creating UIbuilder class for one dailog field, rest dialog field disappear. How to get all dialog fields?

    Hi Vikash,

    Your build method is missing super call

    public void build()
    
       {
            super();
    
           contract = this.dataContractObject();
           OperationNum = this.bindInfo().getDialogField(contract, methodstr(TPO_PlantProductionContract,parmOperationNum));
           
    
           OperationNum.lookupButton(2);
    
       }

  • Verified answer
    Blue Wang Profile Picture
    Blue Wang on at
    RE: After creating UIbuilder class for one dailog field, rest dialog field disappear. How to get all dialog fields?

    HI  Vikash,

    You only gave one field:

    dialogField = this.bindInfo().getDialogField(this.dataContractObject(), methodstr(TPO_PlantProductionContract,parmOperationNum));

    [DataMemberAttribute("OperationNumber")] 
        public OprNum parmOperationNum(OprNum _oprNum = oprNum)
        {
            oprNum = _oprNum;
            return oprNum;
        }

    81304.PNG

    Try to add others.

  • vikash_ Profile Picture
    vikash_ 210 on at
    RE: After creating UIbuilder class for one dailog field, rest dialog field disappear. How to get all dialog fields?

    Like siteId, Production number, start date, end date.

  • Blue Wang Profile Picture
    Blue Wang on at
    RE: After creating UIbuilder class for one dailog field, rest dialog field disappear. How to get all dialog fields?

    Hi Vikash,

    When you add SysOperationContractProcessingAttribute, then the dialog field is not generated from the contract class.

    Please check getFromDialog () in your Ui Builder class

  • vikash_ Profile Picture
    vikash_ 210 on at
    RE: After creating UIbuilder class for one dailog field, rest dialog field disappear. How to get all dialog fields?

    class TPO_PlantProdUIBuilder extends SrsReportDataContractUIBuilder

    {

       TPO_PlantProductionContract     contract;

       DialogField     OperationNum;  

       FormBuildComboBoxControl    formComboBoxControl;  

       public void lookupOperNum(FormIntControl _formIntControl)

       {

           Query query = new Query();

           QueryBuildDataSource DS;

           SysTableLookup sysTablelookup;

           //create a table lookup

           sysTablelookup = SysTableLookup::newParameters(tableNum(ProdJournalRoute),_formIntControl);

           sysTablelookup.addLookupfield(fieldNum(ProdJournalRoute, OprNum));

          // sysTablelookup.addLookupfield(fieldNum(ProdJournalRoute, OprId));

           //create a query

           DS = query.addDataSource(tableNum(ProdJournalRoute));

           DS.addRange(fieldNum(ProdJournalRoute, OprNum)).value('10');

           //assign the query and call lookup

           sysTablelookup.parmQuery(query);

           sysTablelookup.performFormLookup();

       }

       public void build()

       {

           contract = this.dataContractObject();

           OperationNum = this.addDialogField(methodstr(TPO_PlantProductionContract,parmOperationNum),contract);

           OperationNum.lookupButton(2);

       }

       public void postRun()

       {

           Dialog          dialogLocal = this.dialog();

           DialogField  dialogField;

           super();

           // This method should be called in order to handle events on dialogs.

           dialogLocal.dialogForm().formRun().controlMethodOverload(false);

           dialogField = this.bindInfo().getDialogField(this.dataContractObject(),                            methodstr(TPO_PlantProductionContract,parmOperationNum));

           dialogField.registerOverrideMethod(methodstr(FormStringControl, lookup),    methodstr(TPO_PlantProdUIBuilder,lookupOperNum ), this);

       }

    }

  • Sergei Minozhenko Profile Picture
    Sergei Minozhenko 23,091 on at
    RE: After creating UIbuilder class for one dailog field, rest dialog field disappear. How to get all dialog fields?

    Hi,

    Could you, please, share also UIBuilder class code?

  • nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: After creating UIbuilder class for one dailog field, rest dialog field disappear. How to get all dialog fields?

    What do you mean by "rest dialog field disappear"? What fields? How did the dialog look like before?

    Remember that we don't know how it was before, we only see what you have done and how it looks now (since that's all you shared).

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,489 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans