Lock a sales order line  Topic is solved

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

Re: Lock a sales order line

Postby Mike.Sheen » Mon Aug 16, 2021 2:54 pm

DannyC wrote:EDIT: So I've done more testing. LockRow does work after all!


So after all that - what was the trick to getting it to work for you? You're initial post stated LockRow didn't seem to work for you - and now you've got it to work for you - what was the missing bit?
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: Lock a sales order line  Topic is solved

Postby DannyC » Thu Aug 19, 2021 6:45 pm

The trick?

I needed to fire the code from the LineDisplayed event i.e
Code: Select all
salesOrderForm.LineDisplayed += SalesOrderForm_LineDisplayed;


   public void SalesOrderForm_LineDisplayed(object sender, System.EventArgs e, JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrderLine SalesOrderLine, int Row)
   {
      JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.BaseSalesOrderEntryForm salesOrderForm = (JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.BaseSalesOrderEntryForm)sender;
      if (!SalesOrderLine.CommentLine && SalesOrderLine.QuantityDemand > 0)
      {
         for(int row = 0; row <= salesOrderForm.grdLines.ActiveSheet.RowCount - 1; row++)
         {
            if (salesOrderForm.grdLines.get_GridText("Key", row).ToString() == SalesOrderLine.RecID)
            {
               salesOrderForm.grdLines.LockRow(row, true);
               break;
            }
         }
      }
   }



I was trying the LockRow from other events in the business logic. Silly now that I know the above works. All a part of the learning experience. ;)
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31

Previous

Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 1 guest