I have a custom dialog form with a control attached to HcmEmployment.DefaultDimension. The form works as expected to allow selection of the individual dimension. However, when the form is brought up in subsequent runs, the previous financial dimension values are populated. How can I clear those values to allow the user to start from a clean form?
Clearing out financial dimension form control values
I tried this following method and it appears to be working with initial tests. I created a temp table with a single defaultdimension field. I related it to DimensionAttributeValueSet. I used this table in my form much like I did with HcmEmployment with the exception that I called create() and insert() on my temp table. Again, it seems to be working. Curious if such an approach may have any unseen issues I'm not aware of.
Clearing out financial dimension form control values
Hi Bharani,
The control is linked to HcmEmployment as a Dimension entry control. I would prefer to have an unbound control but I'm not sure how that is accomplished. When you say to follow the SalesTable form example, are you referring to the SalesOrderCreate (or something like that) form? Could you provide specifics?
Clearing out financial dimension form control values
Then you need to add a DimensionEntry control to your form.
Here someone suggested that you need a specialization of the control, but I don't think it's necessary. I would have to try it and I don't have time at the moment.
It'll help if actually try to add the unbound control and explain your particular problem if you run into any, instead of waiting for others.
Clearing out financial dimension form control values
I don't have time to cover all the options; we can discuss it next week if needed. But one example you can look at is AssetTransferMassUIBuilder. There they don't need a modeled form at all, as usual with dialogs. The default dialog is generated from the contract class and modified by the UI builder class.
Clearing out financial dimension form control values
You get errors when you try to save the record, but you don't want to save it anyway, therefore even the attempt is a bug. If you want to use a data source, you should avoid saving (by overriding write() and validateWrite() method of the DS and not calling super() there).
But yes, you can use unbound controls. Dialog typically don't have data sources.
Clearing out financial dimension form control values
I proceeded with Martin's suggestion to use the create() method on HcmEmployment for a new record without any defaultdimension value. It clears the values on the form. However, because it is creating a new HcmEmployment record, I get errors requiring Worker and Company. My custom form will be responsible for creating the worker (and accompanying employment, dirpersonname, position) through code so there is no worker to assign to HcmEmployment at this point. Not sure it's appropriate to pivot the question on this post, but is it possible to include the financial dimensions into the form without linking it to a datasource? I probably will add a new post just in case changing the nature of the question is bad form.
Clearing out financial dimension form control values
Hi Martin,
Pardon the lack of details. For reasons I won't go into, I'm creating HcmWorker based on input from this form through code. For the HcmEmployment record, I need to gather the financial dimension values. I found it easiest to include the HcmEmployment datasource so I can just pull in the defaultdimension onto the form. Would appreciate it if there's a better option that wouldn't require the datasource. Thank you.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.