How to check if field has value in newly created record in BP before saving?
Hello,
I'm currently having a problem where I need to run a process that creates a new record of a section but not allow the saving of that record to go through if two fields aren't populated.
Is there a way to stop a record save to go through unless certain fields are populated? Like set the fields to required in the Business Process element? I don't see an option for that. Or is the only way to save the record and then use conditionals to check if the values are set and open edit page of the newly created record with a hint to the user?
Thanks in advance so much for the help.
/Per
Like
Hello,
The latest versions of the application allow the records creation even if the required fields are not populated. The only option is to use section filter to find the records where the required fields are not filled in.
We will register your idea for our R&D team to consider its implementation in future application version.
Regards,
Dean
Hello again and thank you for the response,
In full transparency this question is from the Creatio Sales Analyst certification test. It asks me to create a process which creates a new record from my custom section. The questions specifies: "This process must open a new record page in the “Returns” section and check whether the “Notes” and “Reason” fields are populated before the new record can be saved."
I don't know how to interpret this other than to make sure the process-created new record cannot be saved unless these fields are populated, which would mean to make them required I guess but I don't see an option to do that. There is the option asking when this element is considered completed and here specifying that Reason and Notes must be filled in, but even this does not stop the record from saving, I only think it stops the process element from proceeding into the flow.
Am I interpreting the question wrong perhaps?
Thank you again for any response.
/Per
If you want to enforce a field to be required, or filled in there are two options:
If always required: When adding the field in the wizard, check the box fir "Is require in DB". Or modify the object and set required to "Application level"
If conditionally required: On the page the field is on, set up a business rule to make the field required when some condition is set.
For the scenario you posted (from the cert assignment) you could add a boolean field "From process", but not add to page. Then from the process set a default value of true for this column, and use a business rule to require the values if the From process column is true or something along those lines. There's likely other ways you could do this, but that should work.
Ryan
Hello,
You can also use Open Edit Page element. Once it is opened, the required fields will have to be filled out to save the record.
Regards,
Dean
Hello again guys,
It worked using the bool on the section which is turned to true during the process, and then using a business rule to make the fields required based on that bool. I was specifically trying to make the fields required during the business process and this worked.
Thank you so much for your help, both of you! Hope you have a pleasant weekend ahead of you.
Thanks again!
/Per
Option 1. Why not check that the values are there before saving the record.
Option 2. Set filed as required in the object designer, this will work for all filed types other than numeric
Option 3 . Use C# to intercept onSaving event with entityEventListener https://academy.creatio.com/documents/technic-sdk/7-15/entity-event-layer (Requires programming)