Set label in red when editor is mandatory and empty on quick entry panels
Description
Environment
Attachments
relates to
Activity

Nicolas Micoud March 12, 2019 at 4:23 PM
Hello,
My 2nd patch tries to find if location is mandatory or not.
And it's ok when the panel opens.
But as you felt it, if Name and Phone are QuickEntry field and QE panel is opened from payment (where location is not mandatory), filling the Phone make the locationID field mandatory, but its label is not updated to red.
So the thing to do is to have a dynamic way to find if the location field is mandatory (that will be called when opening the panel and when filling a field of a BPLoc tab).
-> The location field may be not mandatory on opening, and became mandatory because Phone was filled
So I don't think just a change at beginning could be enough.
nb: I'm not familiar with QE panels as I'm still using a duplicated/customized version of WBPartner for BPartners (logics are too complex)
QuickEntry panels are just used for single tab window.
As we start a new client - without this complexity - i wanted to play with them
Regards,
Nicolas
Carlos Ruiz March 12, 2019 at 2:48 PM
Hi
> I don't see where my patch is wrong
I haven't tested but probably this will fail, enable Name and Phone as quick entry fields on BP Location tab.
In that case if you fill the phone or name - the location is mandatory, but your patch is making the location not mandatory. And I think it will try to save a null and fail there.
> And I'm sorry, I don't understand your suggestion.
> Could you elaborate more, I'm lost here
My modifications call editor.updateStyle just on fields on the first tab, and then when any field of another tab is touched, then it calls editor.updateStyle for the fields of THAT tab.
So, if the location is mandatory, calling the editor.updateStyle for location at the beginning must do the trick that you're looking for.
Regards,
Carlos Ruiz

Nicolas Micoud March 10, 2019 at 12:51 PM
Hi ,
I don't see where my patch is wrong as it only paint the label if the parent table is not listed in the SysConfig (and that will throw an error message when validating the panel).
And I'm sorry, I don't understand your suggestion.
Could you elaborate more, I'm lost here
AFAIU, the editor.updateStyle() will only set the label in red or black, according to the mandatory property of the field.
But in Business Partner > Location tab, the BPartnerLocation.LocationID field is always mandatory thus the QE field will always be red, no ?
I think I'm missing something here :-/
Thanks,
Nicolas
Carlos Ruiz March 9, 2019 at 7:39 PM
Hi , I think the patch is wrong as the BPLocation field is still mandatory in the tab, but your patch is setting it as non-mandatory.
My suggestion would be to look if the same condition as the Callout is reached and just call editor.updateStyle(); for that field.
Regards,
Carlos Ruiz

Nicolas Micoud March 9, 2019 at 2:04 PM
Hi ,
And here's the patch that paint the location label field if the caller table is not present in the BPARTNER_QUICK_ENTRY_OPTIONAL_LOCATION_TABLES
Regards,
Nicolas

Nicolas Micoud March 1, 2019 at 7:14 AM
Hi ,
Yes, it's nearly perfect, thanks
Issue is for location label... it should be colored in red is table is not present in the new SysConfig (BPARTNER_QUICK_ENTRY_OPTIONAL_LOCATION_TABLES) and thus should be considered as mandatory.
WDYT ?
Regards,
Nicolas
Carlos Ruiz February 28, 2019 at 9:45 PM
Hi ,
I did commit cbbac38 - I think this is closer to what you want.
Just the first tab is rendered as mandatory - when a field of another tab is touched then all tab style is updated.
The part not implemented, and I think is OK, is making mandatory the detail in case the field is mandatory in the window, the user is (and it has been always) able to save master without detail - except the hardcoded case for location.
Regards,
Carlos Ruiz
Carlos Ruiz February 28, 2019 at 5:25 PM
> If I set C_Order.AD_User_ID as mandatory, I should not be able to leave
> the QuickEntry panel with the ContactName unfilled (as it is present in
> the parent window and the QE panel).
That's not how quick entry works at this moment - it would allow to save and leave the field empty.
> But perhaps the solution is only a way to inform users that the sub tabs fields
> are not "really" mandatory (I can assure you that they will call me and say
> "Why is the field in red if not mandatory ?"... and the only answer I will have
> will be "Ask Carlos !" )
If a user ask me such question, then I would explain: those fields are mandatory in case you want to create a record in THAT specific group of fields.
Regards,
Carlos Ruiz

Nicolas Micoud February 28, 2019 at 3:56 PM
Hi Carlos,
Thanks for the explanation, but "it is not the mandatoriness of C_Order.AD_User_ID which makes the ad_user optional or mandatory." ; that's the origin of the problem, no ?
If I set C_Order.AD_User_ID as mandatory, I should not be able to leave the QuickEntry panel with the ContactName unfilled (as it is present in the parent window and the QE panel).
But perhaps the solution is only a way to inform users that the sub tabs fields are not "really" mandatory (I can assure you that they will call me and say "Why is the field in red if not mandatory ?"... and the only answer I will have will be "Ask Carlos !" )
I need to find time to try to find a solution for achieving this. I'll keep you informed about progress.
Thanks,
Nicolas
Carlos Ruiz February 28, 2019 at 3:41 PM
Hi , it is not the mandatoriness of C_Order.AD_User_ID which makes the ad_user optional or mandatory.
By default in any quick entry window - all the tabs below the first are optional, and there is just ONE big exception (probably hardcoded) with the location on business partner quick entry - this was made that way when developing quick entry to make it backward compatible with the previous form coded quick entry window which had the location mandatory.
So, in principle - any quick entry will show all mandatory fields in red - as I would expect as a hint for the user about what is required to fill - and the fields are properly grouped by tab, so IMHO is easy for a user to know that just the first group (tab) is mandatory, and the other groups below (tabs) are mandatory just when filling that specific group, otherwise, the whole group is optional.
I find the red for mandatory a lot better than having black labels and user trying to figure which fields are mandatory, or being forced to push the save button to know which fields are.
Regards,
Carlos Ruiz

Nicolas Micoud February 27, 2019 at 1:25 PM
I understand your point of view, but I'm not sure "my" users will share it
Any idea for making a kind of link between the QuickEntry.ContactName and the C_Order.AD_User_ID fields ?
If not, as a workaround, I guess it should be possible to use the CSS Style and apply a "black label" style when QUICK_ENTRY_MODE is set to Y.
Details
Details
Assignee

Reporter

Hi,
If you open the quick entry panel from an order, labels of related mandatory fields are not colored in red.
And you will raise a popup error if trying to validate the panel if those fields are not filled