web
You’re offline. This is a read only version of the page.
close
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

I have the same question (0)
  • nmaenpaa Profile Picture
    101,160 Moderator on at

    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).

  • Sergei Minozhenko Profile Picture
    23,093 on at

    Hi,

    Could you, please, share also UIBuilder class code?

  • vikash_ Profile Picture
    210 on at

    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);

       }

    }

  • Blue Wang Profile Picture
    on at

    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
    210 on at

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

  • Verified answer
    Blue Wang Profile Picture
    on at

    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.

  • Sergei Minozhenko Profile Picture
    23,093 on at

    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);
    
       }

  • vikash_ Profile Picture
    210 on at

    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 ));

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 544 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans