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.
*This post is locked for comments
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();
Still stuck on this...cannot find a solution
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.
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.
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;
}
\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'; } }
Hi Paul,
You don't have to reference form controls. You need to set the datasource field values.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,219 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156