Hi,
I've got an DOM object that can have multiple "services" sections. Is there a way to have by default one option added and selected? (which also can be deleted, but in 98% of the cases we want to add this specific service)
Hi Gerwin,
On any FieldDescriptor, you can define a default value. (Last property in the table here) You could assign the value for that specific service there. This way, when you create a DomInstance in a form of a low-code app, it will already assign it as the value.
Does this answer your question?
We can probably leverage the OnDomInstanceCrud automation script entry point to create an initial section (https://docs.dataminer.services/user-guide/Advanced_Modules/DOM/DOM_ModuleSettings/ExecuteScriptOnDomInstanceActionSettings.html?q=OnDomInstanceCrud)?
You could use the CrudType to immediately return if it’s not equal to ‘Create’.
Oh, ok, I misunderstood. I do not fully understand what you mean by a default section. Are you creating your DomInstances in a low-code app form or a script?
When using the form, an initial section should be shown where the aforementioned default values should be filled in.
Could you explain your use-case in a bit more detail?
Sure we’ve got an DOM which is an Job entry form from our booking guys for our operational team, however sometimes there are services that are added to a job for our invoice department, there is one that is almost always added (unless otherwise noted) so i when i create a new instance with an lowcode app i would like to have an auto select on the first service name, which is an other dom instance list since we want to be able to give the bookings an easy way to add services)
sure
it's the services section. Where there is now Service Type (which is DomInstancefieldDescriptor, so i can't select and default one) i would like to have an default option.
Thanks for the screenshot. This clears things up a lot for me.
If the ‘Service Type’ DomInstance you want to be selected as default is always the exact same DomInstance, it should be possible to use that ID as the default value just like I suggested in my initial comment. I just tried this myself, and it seems to work fine on 10.3.3. (When adding an extra section, it currently does not assign the default value which may or may not be what you are looking for)
If, however, that ID is not always the same, I’m afraid that there is nothing built in at the moment that would fill it in for you depending on some specified condition. You could make this work with the OnDomCrud script that Sebastiaan referenced, but this would require you to save the new DomInstance first so the script is run, and then continue defining the services. You could make this more user-friendly by introducing states & transitions, but it won’t be as simple as just a create form.
Right, i think it’s an issue then with the way i create DOM instance, we’ve had a script got deployed called DOM Editor that doesn’t support this functionality. Or it might be an version issue. We currently run 10.2.12
Unfortunately not, i have the multiple on the section itself (it consist on a DOM instnace link, start and end datetime etc)
so yes most fields can have an default, exept the section itself (and not if it’s linked to another DOM instance)