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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Create New Prospect - Set Default Delivery Terms if Country/Region GBR

(0) ShareShare
ReportReport
Posted on by

We are looking at changing the form so we can set the Delivery terms to a certain value if the Country/Region is GBR. The problem I have is that the form DirPartyQuickCreateForm details group of fields are not on the from in the AOT. I think they are created by QuickCreate methods. I have never encountered these so I am lost on how to set the Delivery Terms field as it doesn't appear in the Design on the form. Selecting Personalise on the field and looking at the system name for that field in the form it is called quickCreateDetails_DlvTerm
smmBusRelTable(DirPartyEntity).DlvTerm. Looking at the code it uses the smmBusRelTable and uses a field group called QuickCreateDetails which populates the form with these fields.  But I don't know how to reference these in the methods on the form.

5140.Untitled.jpg

7115.Untitled.jpg

*This post is locked for comments

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,541 Super User 2025 Season 2 on at

    Hi Paul,

    You don't have to reference form controls. You need to set the datasource field values.

  • 5400 Profile Picture
    7,162 on at

    \Forms\DirPartyQuickCreateForm\Data Sources\LogisticsPostalAddress\Fields\CountryRegionId\Methods\modified

    public void modified()
    {
        super();
        element.updateControlBasedOnCountry();
        prevCountryRegionId = logisticsPostalAddress.CountryRegionId;
        if (logisticsPostalAddress.CountryRegionId == 'GBR')
        {
            DirPartyEntity.DlvTerm = 'dlv';
        }
    }


  • Community Member Profile Picture
    on at

    We tried something similar as below but get this error everytime:

    (Thanks for the help)

    Error executing code: The field with ID '0' does not exist in table 'smmBusRelTable'.

    Stack trace

    (C)\Forms\DirPartyQuickCreateForm\Data Sources\LogisticsPostalAddress\Fields\CountryRegionId\Methods\modified - line 7

    (C)\Classes\FormStringControl\modified

    public void modified()

    {  

           if (LogisticsPostalAddress.countryregionid=="GBR" && SysCountryRegionCode::isLegalEntityInCountryRegion([#isoGB]))

           {        

               dirpartyentity.dlvterm="EXW";

           }

       super();

       element.updateControlBasedOnCountry();

       prevCountryRegionId = logisticsPostalAddress.CountryRegionId;

    }

  • 5400 Profile Picture
    7,162 on at

    how are you getting 'smmBusRelTable' table, did you add any data source. I did not find any 'smmBusRelTable' table as data source in DirPartyQuickCreateForm. It is working fine in my environment.

  • Community Member Profile Picture
    on at

    no tables added. Searched for smmBusRelTable in the form and no hits. We are on AX2012 R2 and adding a Prospect type which I believe is the link to the smmBusRelTable.

  • Community Member Profile Picture
    on at

    Still stuck on this...cannot find a solution

  • Verified answer
    Community Member Profile Picture
    on at

    We found the answer. We could change the field on the quickcreate part of the form using this code:

    DirPartyEntity.setFieldValue("DlvTerm","EXW");

    element.redraw();

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

News and Announcements

Season of Giving Solutions is Here!

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
TAHER Mehdi Profile Picture

TAHER Mehdi 3

#2
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

#2
Nakul Profile Picture

Nakul 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans