web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Vendor Hold Drop down Button

(0) ShareShare
ReportReport
Posted on by 2

Hi ,

    I can able to disable the On Hold Button Under Maintain Group of Vendor Master using Event handler  

    [FormDataSourceEventHandler(formDataSourceStr(VendTable, VendTable), FormDataSourceEventType::Activated)]
    public static void VendTable_OnActivated(FormDataSource sender, FormDataSourceEventArgs e)
    {

        #define.BUTTONNAME('VendorStatusApproval')
        VendTable        vendTable    = sender.cursor();
        FormRun             element         = sender.formRun();
        FormControl         Button     = element.design(0).controlName(formControlStr(VendTable, OnHoldDropDialogButton));
        Button.enabled(**condition**);
    }

pastedimage1658595725078v1.png

But How can I disable the Vendor Hold Dropdown Field I have tried to add this line of code 

FormControl         Button     = element.design(0).controlName(formControlStr(VendOnHoldUpdate, OnHold));

But I am getting the runtime object error . 

pastedimage1658598213707v2.png

I have even tried Chain of command for the vendor hold field But it doesnt trigger anything 

How Can I disable the vendor hold drop down?

[ExtensionOf(formDataSourceStr(VendTable,VendTable))]
final class VendTable_DS_Extension
{
    public int active()
    {
        int ret = next active();
        VendTable vendTable= this.cursor();

        this.object(fieldNum(Vendtable, Blocked)).allowEdit(false);
        return ret;
    }

}

I have the same question (0)
  • Komi Siabi Profile Picture
    13,047 Most Valuable Professional on at
    RE: Vendor Hold Drop down Button

    Great! congrats

  • NoobGamer Profile Picture
    2 on at
    RE: Vendor Hold Drop down Button

    Hi Komi ,

             I have achieved it through chain of command and found the table buffer for the VendTable . and everything is working fine now.

  • NoobGamer Profile Picture
    2 on at
    RE: Vendor Hold Drop down Button

    Hi Nuno maia,

                   Based on the requirement it should be Enabled /Disabled depending on the condition .While adding the new vendor the vendor hold status should be on Hold (All) . I am using power Automate to change the status from All - No based on the Approval .  And it should be always disabled .if that is the case I can remove the permissions form users

  • NoobGamer Profile Picture
    2 on at
    RE: Vendor Hold Drop down Button

    Thanks for the reply Komi, I need to Enable / Disable the Vendor Hold Field and the other fields in the VendOnHoldUpdate based on the vendor Hold status.

    [FormEventHandler(formStr(VendOnHoldUpdate), FormEventType::Activated)]
        public static void VendOnHoldUpdate_OnActivated(xFormRun sender, FormEventArgs e)
        {
    
            sender.design().controlName(formControlStr(VendOnHoldUpdate, OnHold)).enabled(false);
        }

    But In this code instead of adding the static false value , I need to make use of VendTable Buffer (VendTable.Blocked)dynamic condition . How can I achieve that ?

  • nunomaia Profile Picture
    23 Moderator on at
    RE: Vendor Hold Drop down Button

    That form is controlled by security privilege VendOnHoldUpdate, can you simple remove that permission from users to disable form ?  

  • Komi Siabi Profile Picture
    13,047 Most Valuable Professional on at
    RE: Vendor Hold Drop down Button

    Hi,

    Your initial request says 'How can I disable the Vendor Hold Dropdownwhich I think had been addressed.

    Could you please tell us what exactky you wanna achieve ?

  • NoobGamer Profile Picture
    2 on at
    RE: Vendor Hold Drop down Button

    And I dont see any datasource/data Field /DataMethods in the form Properties .  How does the fields are populating in this form from the VendTable  without any datasource . Is it possible to get the VendTable Buffer in this form

  • NoobGamer Profile Picture
    2 on at
    RE: Vendor Hold Drop down Button

    Hi Komi ,

             I cannot find the dataSource in the VendOnHoldUpdate form , How can I get the table buffer of VendTable inside this method .

    pastedimage1658778811941v1.png

  • Suggested answer
    Komi Siabi Profile Picture
    13,047 Most Valuable Professional on at
    RE: Vendor Hold Drop down Button

    Great, 

    Kindly mark the answer to close this thread. 

  • NoobGamer Profile Picture
    2 on at
    RE: Vendor Hold Drop down Button

    Thanks Komi . That works

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,351

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 874 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 638 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans