How to Soft-Code Default Values for New Records

Posted by franchiset on 18-Aug-2017 10:51

Hello,

We want to soft-code the default values for certain key fields. For example, a user may be authorized to access only a certain location or locations. If they are in a KUIB app that enables them to add new employee records, we want to default the locationNo to only a specified location, such as the location they are authorized to maintain.

Is there a way we can accomplish this so when the user accesses the KUIB New record function, that the initial record values are populated with soft-coded initial values?

For example, the Business Entity excerpt below illustrates the general idea. We tried specifying a field for the value on the annotation line, but apparently a constant value is expected.

DEFINE VARIABLE defaultLocationNo AS CHARACTER NO-UNDO.

assign
defaultLocatioNo = assign based on user's role and what locations they are allowed to access.
.

@openapi.openedge.entity.field.property (field=“locationNo“, name=“default”, value=defaultStoreNo).

Alternatively, if we can't default the initial value on the new record, we could add some code at the back-end to change a blank locationNo to the proper locationNo before updating the database. Setting it to the proper value initially (and validating the data at the back-end before updating the data) seems like a preferable approach.

Thank you.

Regards,

Carl

All Replies

Posted by Shelley Chase on 18-Aug-2017 12:37

Hi Carl,

I will private message you to discuss these use cases. We are working on samples for your use cases that will be posted when they are available for anyone else interested in the solution.

Thanks

-Shelley

This thread is closed