Apply button on forms - need to use a manual one

Apply button on forms - need to use a manual one

SMillsYS3X2
Advocate Advocate
237 Views
5 Replies
Message 1 of 6

Apply button on forms - need to use a manual one

SMillsYS3X2
Advocate
Advocate

I have a case where I need to have an apply button output warnings instead of actually running. What is the iLogic for the 'Apply' Button? Or some way to grey it out unless other conditions are met?

I've been using the default one, and I'm not sure how to affect it.

0 Likes
238 Views
5 Replies
Replies (5)
Message 2 of 6

WCrihfield
Mentor
Mentor

Hi @SMillsYS3X2.  As far as I know, there is only one option for including an 'Apply' button in an iLogic Form, and that is through the property named 'Predefined Buttons', which is only available while you have the top most node in the form editor selected (the node representing the whole form & its title).  That property has a drop-down list, with one of the values being 'OK Cancel Apply'.  When using that option, changes made within the form will only be 'sent' to the Document when you click either the Apply button, or the OK button.  When you only have the 'Done' button, then changes made within the form immediately effect the Document.  And as far as I know, we do not have any control over how those buttons function.  However, we can include other iLogic rules in our iLogic Form, which will show-up as a button in your Form.  When you do that, there is usually a property named 'On Click Action' for that 'rule button' where we can set the what all else we want to happen besides just running the rule, that we want to happen when we click that rule button.  However, if going that route, an iLogic rule will not know about any 'modified / changed' values in that Form, if they have not yet been 'sent' to the Document.  We simply do not have much access to iLogic Forms from iLogic rules, other than showing them, closing them, and possibly getting a notification about the Form closing, and why it closed, if it was shown by that same rule.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 6

SMillsYS3X2
Advocate
Advocate

And there is no way to even 'grey it out'? Like it's unusable unless 'form value A' is at least half of 'form value B'?

0 Likes
Message 4 of 6

WCrihfield
Mentor
Mentor

Nope.  We can do that with a 'rule button', because it would have that 'Enabling Parameter Name' property, but not with the Form's main Apply button.  There is no 'node' for the main Form buttons, and no other properties like that for each button when the main Form node is selected.  Even if there was a control like that which was dictated by the value of a Boolean parameter's value, the change would need to happen to the Boolean parameter's value in the Document before it would effect another control in the Form, so it would seem like defeating the purpose.  There would need to be the ability to include some 'controls' in the Form that are not based on properties or parameters of the Document, that way the changes within the form that have not been applied to the document yet can be 'evaluated' before actually sending them to the document.

In order to get that level of control, you may have to build your own Form another way, such as going the Windows Forms route with vb.net or using Visual Studio, or maybe even a VBA UserForm.  All those other options are much more complex, and complicated to do, but also offer a lot more flexibility and control over how they 'act & behave'.  I'm out for the day after sending this, so I may check back tomorrow, if I get a chance.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 5 of 6

SMillsYS3X2
Advocate
Advocate

Just to cover the possibility, isn't there an iLogic code that is the same as an the apply button? I don't mind manually making one if that is what it takes.

0 Likes
Message 6 of 6

WCrihfield
Mentor
Mentor

I wish there were something like that, but I do not know of anything like that.  Clicking an iLogic Form's built-in Apply button somehow tells it to send any modified values in the Form to the Document.  About the only thing I can think of from a code point of view that is anywhere near that is the 'update' or 'rebuild' methods, but those have nothing to do with iLogic Forms.  The only access we have to iLogic Forms from an iLogic rule originate from the uniquely iLogic code term 'iLogicForm', which is a Rule Object.  That gives us access to 5 methods (all for showing or closing forms), and 3 properties, which are all for finding the names of forms, and a setting for remembering their positions and sizes.  None of that has anything to do with the Apply button within an iLogic Form.  If you created an iLogic rule that does nothing but attempt to update a document, then placed that into an iLogic Form as a rule button, clicking that button would run that rule, but the rule that gets ran does not know about anything that may have been in that form before you clicked that rule button, if it has not been sent to the document yet.  The rule would be able to access that document, but not that form.

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)