Hook Into Select Warehouse Dialog  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Hook Into Select Warehouse Dialog

Postby nsbandara » Mon Jul 31, 2017 8:16 pm

Hi,

Is there a way to hook select warehouse dialog (see attached) through a plugin and remove given warehouse from select list ?

Thanks.
Attachments
Capture.JPG
Select Warehouse Dialog
Capture.JPG (32.07 KiB) Viewed 1705 times
User avatar
nsbandara
Occasional Contributor
Occasional Contributor
 
Posts: 43
Joined: Tue Jul 16, 2013 5:02 pm
Location: Sri Lanka
Topics Solved: 11

Re: Hook Into Select Warehouse Dialog

Postby Mike.Sheen » Mon Jul 31, 2017 10:02 pm

nsbandara wrote:Hi,

Is there a way to hook select warehouse dialog (see attached) through a plugin and remove given warehouse from select list ?

Thanks.


Possibly - what version of Jiwa 7 are you wanting this for?
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: Hook Into Select Warehouse Dialog

Postby nsbandara » Tue Aug 01, 2017 2:08 pm

Jiwa Version 7.0.175
User avatar
nsbandara
Occasional Contributor
Occasional Contributor
 
Posts: 43
Joined: Tue Jul 16, 2013 5:02 pm
Location: Sri Lanka
Topics Solved: 11

Re: Hook Into Select Warehouse Dialog  Topic is solved

Postby Mike.Sheen » Tue Aug 01, 2017 5:17 pm

In the ApplicationManagerPlugin plugin class, add a handler for when the dialog loads - and in that handler, check the type - if it's the set current warehouse dialog (JiwaFinancials.Jiwa.JiwaSetCurrentWarehouseUI.MainForm - requiring a reference to the JiwaSetCurrentWarehouseUI assembly), then hide the desired node(s) in the treeview of the form.

i.e.:

Code: Select all
public void Setup(JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
{      
   JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.DialogFactory.AfterDialogStart += AfterDialogStart;
}

private void AfterDialogStart(JiwaFinancials.Jiwa.JiwaApplication.IJiwaDialog JiwaDialog)
{
   if (JiwaDialog is JiwaFinancials.Jiwa.JiwaSetCurrentWarehouseUI.MainForm)
   {
      // Hide an element of the selection treeview control
      JiwaFinancials.Jiwa.JiwaSetCurrentWarehouseUI.MainForm selectionForm = (JiwaFinancials.Jiwa.JiwaSetCurrentWarehouseUI.MainForm)JiwaDialog;
      
      foreach(Infragistics.Win.UltraWinTree.UltraTreeNode node in selectionForm.UltraTree1.Nodes)
      {            
         if (node.Text == "Victoria")
         {
            node.Visible = false;
         }
      }
      
   }
}


Sample plugin attached.
Attachments
Plugin Remove warehouse from change warehouse dialog.xml
(30.9 KiB) Downloaded 76 times
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 8 guests