Dirty flag on Sales Order  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Dirty flag on Sales Order

Postby indikad » Fri Jan 22, 2016 4:57 pm

I am looking to check if the current sales order on the screen is waiting for a save ( "isDirty ?")
for that matter on any screen object would be nice - but sales order window for now.

*I need to do this from a event that is not generated by Sales Order process - such as from a custom button. That is the reason I need the "Dirty" flag.

Thanks.
indikad
Frequent Contributor
Frequent Contributor
 
Posts: 182
Joined: Thu Jun 18, 2009 1:14 pm
Topics Solved: 2

Re: Dirty flag on Sales Order  Topic is solved

Postby Mike.Sheen » Fri Jan 22, 2016 6:58 pm

All maintenance type forms have a property, "BusinessLogic" which has a ChangeFlag property.

In your button click handler, use FindForm to get the form (eg: sales order form), and then check the BusinessLogic.ChangeFlag property to see if it is dirty.

i.e.:
Code: Select all
Private Sub MyButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
    Dim form As JiwaApplication.Maintenance.UserInterface = sender.FindForm
    If form.BusinessLogic.ChangeFlag Then
        ' Changes pending
    End If
End Sub
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: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Dirty flag on Sales Order

Postby indikad » Wed Jan 27, 2016 12:00 pm

Thanks Mike.
indikad
Frequent Contributor
Frequent Contributor
 
Posts: 182
Joined: Thu Jun 18, 2009 1:14 pm
Topics Solved: 2

Re: Dirty flag on Sales Order

Postby indikad » Thu Jan 28, 2016 11:32 am

HI Mike,

I had a small issue - when I click my custom button I get an error . the error is
"Public member "findForm" on type "UltraToolsbarsManager" not found. Module - getMembers

However I resolved this by directly accessing the globaly saved sales order form variable rather than using the sender.
Last edited by indikad on Thu Jan 28, 2016 11:42 am, edited 1 time in total.
indikad
Frequent Contributor
Frequent Contributor
 
Posts: 182
Joined: Thu Jun 18, 2009 1:14 pm
Topics Solved: 2

Re: Dirty flag on Sales Order

Postby Mike.Sheen » Thu Jan 28, 2016 11:40 am

indikad wrote:I have a small issue - when I click mu custom button I get an error . the error is
"Public member "findForm" on type "UltraToolsbarsManager" not found. Module - getMembers


The UltraToolsbarsManager is not a control, it is a component and thus has no FindForm property - but you can get to the form using the "DockWithinContainer" property of the UltraToolsbarsManager.

e.g.:
Code: Select all
    Public Sub SalesOrderForm_Toolbar_ToolClick(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinToolbars.ToolClickEventArgs)      
        If e.Tool.Key = "Create Purchase Orders" Then         
         Dim salesOrderForm As JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.BaseSalesOrderEntryForm = DirectCast(sender, Infragistics.Win.UltraWinToolbars.UltraToolbarsManager).DockWithinContainer
            CreatePurchaseOrders(salesOrderForm)
        End If
    End Sub


When you mentioned button in your original post, I thought you meant a button control, not a ribbon tool.
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: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Dirty flag on Sales Order

Postby indikad » Thu Jan 28, 2016 11:43 am

Hi Mike,

thanks It works. - good tip.
indikad
Frequent Contributor
Frequent Contributor
 
Posts: 182
Joined: Thu Jun 18, 2009 1:14 pm
Topics Solved: 2


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 5 guests