Hey All, Working with NAV 16I've got a page action on a card page that creates a new customer record, essentially. It's called 'Create Client'My goal is to make a certain field on this page, 'Client Code' mandatory. I don't need the field to be mandatory ALL the time, only when they call the creation process from this page action. I tried to set field properties to accomplish my task:ShowMandatory for Client Code = TRUEBut this doesn't actually enforce that the user enter this code before closing the card page. NotBlank for Client Code = YES This didn't work because it only prevents the user from closing the page with a blank client code IF it originally was filled in. In my situation now I need it to be enforced, where if a record will be saved from the action then a 'Client Code' must be entered.Are there any properties that I missed? The code for the page action:
Create Client - OnAction()// create a new ClientRob_CreateSubContact(2);
<Action106> - OnAction()CreateCustomer(ChooseCustomerTemplate);
<Action107> - OnAction()CreateVendor;
<Action108> - OnAction()CreateBankAccount;
New Work Order - OnAction()IF VAR_CreditHold THEN ERROR('Customer has credit hold. Cannot create work order.');
// exit is customer is inactiveIF (Inactive) THEN ERROR(TEXT_009);
IF (VAR_CustomerRec.GET("No.")) THEN IF (CONFIRM(TEXT_010)) THEN VAR_CustomerRec.CreateWorkOrder();
In reply to sbhatbng:
In reply to Rob :
1 I would perform this check in table-trigger OnModify. Recommended to do it via Events.
2 Property NotBlank does only work on fields that are part of primary-key.
3 Property ShowMandatory only informs the user, that the field should contain some value. It does not demand anything.
Otherwise: More correct syntax is using FIELDCAPTION:ERROR('Please insert a value into the field "%1".', FIELDCAPTION("Client Code"));
And to be perfect, use Textconstants ;)