Disable a Standard Button thru customization

Thanks for all of your helpful suggestions - I choice to create a custom
button to 'cover' the one that I wanted to disable

And it works nicely.



Jane





[Non-text portions of this message have been removed]
Hello

I need to disable a Standard Epicor Button, The 'Change Id' button
on the Supplier Maintenance Form, using code conditioned on the
company that is running the program.

I am calling my code from the 'Initialize custom code'.

My code is has follows:

if vendorForm.session.CompanyID <> "002" then

btnChgVendorID.Enabled = false

btnchgVendorID.Readonly = True

end if

When the Form is loaded the button is diabled but when a Vendor
Number is entered, the form enables the button. I have not been
able to disable it.

I have never asked a question thru this group before so I am hoping
that I have composed this correctly.

Thank you for your help

Jane
You will most likely need to use the wizards to create an event
handler for the enabled changed event for the button. Then inside the
event handler sub use some thing like

If ((btnChgVendorID.Enabled = True) And (vendorForm.session.CompanyID
<> "002)) Then

btnChgVendorID.Enabled = false

End IF



That way whenever the form tries to re-enable the button you disable
it again.


--- In vantage@yahoogroups.com, "jr082944" <jholdridge@...> wrote:
>
> Hello
>
> I need to disable a Standard Epicor Button, The 'Change Id' button
> on the Supplier Maintenance Form, using code conditioned on the
> company that is running the program.
>
> I am calling my code from the 'Initialize custom code'.
>
> My code is has follows:
>
> if vendorForm.session.CompanyID <> "002" then
>
> btnChgVendorID.Enabled = false
>
> btnchgVendorID.Readonly = True
>
> end if
>
> When the Form is loaded the button is diabled but when a Vendor
> Number is entered, the form enables the button. I have not been
> able to disable it.
>
> I have never asked a question thru this group before so I am hoping
> that I have composed this correctly.
>
> Thank you for your help
>
> Jane
>
I'm guessing the adapter method that loads the record is resetting your initialized (no record loaded) form control properties.

Open your app (changes only unless you are a glutton for punishment) and then start up a trace log.

Enter a vendor number (and presumably your control properties will revert to their normal pre-initialized state).

Open the trace log and see what adapter was called (and what method) and make a note of it. If you are lucking, you might also see a log entry indicating the extended properties change to your control(s).

Now, create an after_adapter subroutine using the wizard and set up a Case for the Method used when you entered the vendor number.

Within that Case, imbed your original code to restore your desired control properties after the adapter method resets them to standard states.

You may find that there are multiple methods that cause problems - so be prepared to trap a LOT of after _adapter method Cases.

Rob Brown



--- On Fri, 6/6/08, jr082944 <jholdridge@...> wrote:

From: jr082944 <jholdridge@...>
Subject: [Vantage] Disable a Standard Button thru customization
To: vantage@yahoogroups.com
Date: Friday, June 6, 2008, 11:54 AM






Hello

I need to disable a Standard Epicor Button, The 'Change Id' button
on the Supplier Maintenance Form, using code conditioned on the
company that is running the program.

I am calling my code from the 'Initialize custom code'.

My code is has follows:

if vendorForm.session. CompanyID <> "002" then

btnChgVendorID. Enabled = false

btnchgVendorID. Readonly = True

end if

When the Form is loaded the button is diabled but when a Vendor
Number is entered, the form enables the button. I have not been
able to disable it.

I have never asked a question thru this group before so I am hoping
that I have composed this correctly.

Thank you for your help

Jane
You can also try to change the visibility to hidden instead of trying
to disable to button. Sometimes that works when background Vantage
processes enable what you try to disable.

--- In vantage@yahoogroups.com, "jr082944" <jholdridge@...> wrote:
>
> Hello
>
> I need to disable a Standard Epicor Button, The 'Change Id' button
> on the Supplier Maintenance Form, using code conditioned on the
> company that is running the program.
>
> I am calling my code from the 'Initialize custom code'.
>
> My code is has follows:
>
> if vendorForm.session.CompanyID <> "002" then
>
> btnChgVendorID.Enabled = false
>
> btnchgVendorID.Readonly = True
>
> end if
>
> When the Form is loaded the button is diabled but when a Vendor
> Number is entered, the form enables the button. I have not been
> able to disable it.
>
> I have never asked a question thru this group before so I am hoping
> that I have composed this correctly.
>
> Thank you for your help
>
> Jane
>
Here is a bit of a cheat to get around this problem. Create a custom button and *cover* the button you want to disable with it. depending on what you need, you can change the visibility of the custom button to reveal or hide the actual standard button.

Thanks,
Kunal



----- Original Message ----
From: jr082944 <jholdridge@...>
To: vantage@yahoogroups.com
Sent: Friday, June 6, 2008 10:54:20 AM
Subject: [Vantage] Disable a Standard Button thru customization


Hello

I need to disable a Standard Epicor Button, The 'Change Id' button
on the Supplier Maintenance Form, using code conditioned on the
company that is running the program.

I am calling my code from the 'Initialize custom code'.

My code is has follows:

if vendorForm.session. CompanyID <> "002" then

btnChgVendorID. Enabled = false

btnchgVendorID. Readonly = True

end if

When the Form is loaded the button is diabled but when a Vendor
Number is entered, the form enables the button. I have not been
able to disable it.

I have never asked a question thru this group before so I am hoping
that I have composed this correctly.

Thank you for your help

Jane






[Non-text portions of this message have been removed]