I have table called DetailPurchased, one of the its column named MASTER_STATUS_ID which has Association relationship with table MasterStatus. MasterStatus contains data : “Sold” and “Available”. DetailPurchased UI have MasterStatus drop down as one of its UI component. Want to ask how to set default value to that Drop Down with “Available” when the UI open?
You can set initial values for entity attributes in a number of ways, see examples here. In your case perhaps the best way is to set masterStatus attribute of the DetailPurchased entity in the initNewItem() method of the DetailPurchased editor screen. The value will appear in the linked visual component.
If you need to work with screen datasources, you should move your logic to the ready() method, because in initNewItem() they are not initialized yet. So it should be something like this:
public class SalesLineItemEdit extends AbstractEditor {
I am getting the error below when I try to launch from studio however.
I feel like I should be passing something into PersistenceHelper.isNew() but am unsure what that would be.
error: method isNew in class PersistenceHelper cannot be applied to given types;
if (PersistenceHelper.isNew()) {
^
required: Object
found: no arguments
reason: actual and formal argument lists differ in length
1 error
FAILED