If you create an HTML cell in a form section and select the button feature, entering a condition into "applicable when" does not incorporate that condition.
As a workaround, I attempted to manually enter it into the HTML using the following in red based on what I learned about applicability from exporting to XML, but I get a syntax error.
<button class="k-primary aw_custom_form_button" data-ref="<operation name="View Primary Reason" type="start_process" operand="ViewReasonFromForm" parameters="AssertionReason" applicability_condition="AssertionReason.PrimaryReason.Name <> '' AND (InitiativeCondition.Initiative.Sponsor=LoggedInPerson OR LoggedInPerson.Role.Conditions='Responsible (Full)')" image_cls="fa fa-edit" display_text="false"> <description>View Primary Reason</description> </operation>">
</button>
I got ID>0 instead of Name<>'' (shown below) to not give me a syntax error, but it still doesn't hide the button:
<button class="k-primary aw_custom_form_button" data-ref="<operation name="View Primary Reason" type="start_process" operand="ViewReasonFromForm" parameters="AssertionReason" applicability_condition="AssertionReason.PrimaryReason.ID>0 AND (InitiativeCondition.Initiative.Sponsor=LoggedInPerson OR LoggedInPerson.Role.Conditions='Responsible (Full)')" image_cls="fa fa-edit" display_text="false"> <description>View Primary Reason</description> </operation>">
</button>
HTML cell button leaves off the applicability condition
HTML cell button leaves off the applicability condition
v8.1 on Windows 10 / MySQL 5.6 (local), v8.1 on Windows Server 2016 / MySQL 5.6 (server)
Re: HTML cell button leaves off the applicability condition
easiest to use a SECTION START around it...
<<IF Invoice.Status='Approved' or Invoice.Status='Scheduled' AND Invoice.ps_Ticket.TicketNum IS UNDEFINED THEN SHOW SECTION_START>>
<button onClick="AwareApp.startProcessFromForm ('CreateTicket','new_tab', this, false)" type="button" class="MyButton" role="button"><i class="fa fa-ticket"> </i> Create Ticket</button>
<<SECTION_END>>
<<IF Invoice.ps_Ticket.TicketNum IS DEFINED THEN SHOW SECTION_START>>
<button onClick="AwareApp.startProcessFromForm ('ViewTicket','new_tab', this, false)" type="button" class="MyButton" role="button"><i class="fa fa-ticket"> </i> View Ticket</button>
<<SECTION_END>>
This shows a CREATE TICKET button when there isn't one, and later, only a VIEW TICKET button.
<<IF Invoice.Status='Approved' or Invoice.Status='Scheduled' AND Invoice.ps_Ticket.TicketNum IS UNDEFINED THEN SHOW SECTION_START>>
<button onClick="AwareApp.startProcessFromForm ('CreateTicket','new_tab', this, false)" type="button" class="MyButton" role="button"><i class="fa fa-ticket"> </i> Create Ticket</button>
<<SECTION_END>>
<<IF Invoice.ps_Ticket.TicketNum IS DEFINED THEN SHOW SECTION_START>>
<button onClick="AwareApp.startProcessFromForm ('ViewTicket','new_tab', this, false)" type="button" class="MyButton" role="button"><i class="fa fa-ticket"> </i> View Ticket</button>
<<SECTION_END>>
This shows a CREATE TICKET button when there isn't one, and later, only a VIEW TICKET button.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
Re: HTML cell button leaves off the applicability condition
Good thought, Jaymer, but I'm afraid that using sections doesn't address my particular use case (which I neglected to identify). I'm placing buttons next to certain relationship attributes that they operate on.
v8.1 on Windows 10 / MySQL 5.6 (local), v8.1 on Windows Server 2016 / MySQL 5.6 (server)
Re: HTML cell button leaves off the applicability condition
OK, I'm not arguing, but I don't get it.JonP wrote:I'm afraid that using sections doesn't address my particular use case (which I neglected to identify). I'm placing buttons next to certain relationship attributes that they operate on.
If you can already make an HTML cell work (alignment, columns, etc.), then I don't see the difference between using
AIM's builtin way to hide a HTML button (which u can't get to work), and
SECTION_START to hide the same button.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
Re: HTML cell button leaves off the applicability condition
There are two times when I should not reply to email, right after I get up and right before I go to sleep. I should get a tattoo with that statement like in Memento.
In my sleepiness, I assumed that section start/end affected the whole row. And in my laziness I did not bother to try your solution, which is actually more elegant than what I was trying to do since I have four buttons, two of which will always be hidden.
Also, your solution allows me to use IS [UN]DEFINED, which I don't believe the applicability condition allows me to do.
Sorry about that and thanks for the beautiful hack!
In my sleepiness, I assumed that section start/end affected the whole row. And in my laziness I did not bother to try your solution, which is actually more elegant than what I was trying to do since I have four buttons, two of which will always be hidden.
Also, your solution allows me to use IS [UN]DEFINED, which I don't believe the applicability condition allows me to do.
Sorry about that and thanks for the beautiful hack!
v8.1 on Windows 10 / MySQL 5.6 (local), v8.1 on Windows Server 2016 / MySQL 5.6 (server)
Re: HTML cell button leaves off the applicability condition
Glad it worked for you - but its not a hack.
Mark Bailey copied & pasted that code to me a while back. Nifty.
jaymer...
Mark Bailey copied & pasted that code to me a while back. Nifty.
jaymer...
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL