Ilogic - vb code to apply in a form

goran_nilssonK2TWB
Contributor
Contributor

Ilogic - vb code to apply in a form

goran_nilssonK2TWB
Contributor
Contributor

Hello 

 

I have a form with OK / Cancel / Apply buttons at bottom. I want to make a ilogic code that makes Apply by script instead of press the Apply buttom at bottom. Is that possible?

0 Likes
Reply
Accepted solutions (1)
408 Views
6 Replies
Replies (6)

CCarreiras
Mentor
Mentor

Hi!

 

I dont know if i am undertanding...

Do you want a form that triggers changes immediately, or... You don't even want to have a form, just trigger the rule?

 

1 If you want the first case:

Select None:

CCarreiras_0-1701703443886.png

 

2 If you want just to fire the rule, create a iTrigger event (example: trigger the rule when i save the document)

 

Or, instead of creating a form just create a button to fire the rule:

 

Select edit, and select a rule, it will create a button to fire the rule you choose.

CCarreiras_1-1701703851773.png

 

 

CCarreiras

EESignature

goran_nilssonK2TWB
Contributor
Contributor

Hello @CCarreiras 

 

Instead of first enter a new value in a field (1) and then enter another field (2) and then press Apply (3), before I am able to run the rule (4), I want to only enter the new value and then run the rule (only 1 and 4), see attached picture.

I hope you understand my mention.

0 Likes

WCrihfield
Mentor
Mentor

I think that is only possible when the rule that the button runs is an 'internal' rule (not an external iLogic rule).  When the rule is internal, you have multiple options for what happens when you click that button.  When the rule is external, you do not have those options.  When the iLogic Form is 'Global', you always need to 'apply' changes before they will change the document.  When using internal iLogic Form, changes happen automatically.  I know it sucks, but that's just the way it is right now.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes

goran_nilssonK2TWB
Contributor
Contributor

Hello @WCrihfield

It's an internal form and rules.

0 Likes

WCrihfield
Mentor
Mentor
Accepted solution

Hi @goran_nilssonK2TWB.  If both the rule and the form are internal, then I am not sure why you may be needing to enter two different things, then click the Apply button before clicking the rule button.  But, I may still be able to help with some of that.  @CCarreiras already showed how to change which buttons are available at the bottom of the main form, but this tip should help avoid at least one or two of those extra clicks.  While editing that form and the form editor is open, select the iLogic rule button line item in the upper right list, then look down below that at its properties.  There should be an area of the properties named "Behavior" which may need to be expanded down, then within that area is a property named "On Click Action".  You can use the drop-down control beside its Value area to choose a different action sequence that you want it to do when clicked.  I generally always recommend one of the last two, depending on the situation ("Apply and then Run Rule" or "Apply and then Close and then Run Rule").

WCrihfield_0-1701784740696.png

Apply 'sends' any changes made in the form to the document.  Close means close the form.

 

If making those changes still does not solve your problem, then you may need to explain this situation in a lot more detail, such as what all is going on when you start that form, what those entries in the form represent, what your expectations are about what should happen while the form is open, and what the rule is supposed to do.

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes

goran_nilssonK2TWB
Contributor
Contributor

Thanks @WCrihfield 

It solved my issue and saved me a lot of extra click at Apply button

0 Likes