Make fields mandatory by using workspace classes
Important
The finance and operations (Dynamics 365) mobile app and platform have been deprecated. For more information, see Removed or deprecated platform features.
When you use the mobile app designer to select fields for actions, some properties can be inferred. These properties include the field length, the type, and whether the field is mandatory. The workspace classes can be used to update these properties. For example, you might want to specify that the Name field is mandatory when a customer record is created, as shown in the following images.
Follow these steps to make the Delivery terms field mandatory by using the workspace class.
Get the control name by using the app designer. In this example, the control name is DynamicDetail_DlvTerm.
Add the following code to set the Mandatory property for the control. This code uses the reflection-based setProperty method to set the Mandatory property.
public SysAppWorkspaceMetadata getWorkspaceMetadata() { SysAppWorkspaceMetadata appMetadata; appMetadata = super(); var createCustAction = appMetadata.getAction("createCust"); this.setCustAccountMandatory(createCustAction); return appMetadata; } private void setCustAccountMandatory(SysAPpActionMetadata _createCustAction) { var custAccount = +createCustAction.getControl("DynamicDetail_DlvTerm"); custAccount.setProperty("Mandatory", true); }
Build the solution, and then update the app metadata on the mobile app.
The Delivery terms field is now marked as Mandatory, as shown in the following illustration.
Povratne informacije
https://aka.ms/ContentUserFeedback.
Stiže uskoro: Tijekom 2024. postupno ćemo ukinuti servis Problemi sa servisom GitHub kao mehanizam za povratne informacije za sadržaj i zamijeniti ga novim sustavom za povratne informacije. Dodatne informacije potražite u članku:Pošaljite i pogledajte povratne informacije za