LockColumn for Purchase Order Line custom fields  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

LockColumn for Purchase Order Line custom fields

Postby Crowe » Mon Sep 16, 2024 2:03 pm

I am having issues finding the right event to get GridObject.LockColumn to work for custom fields on Purchase Order Lines.

I have this working for Sales Orders with this in the class LineCustomFieldPlugin:
Code: Select all
public void FormatCell(IJiwaBusinessLogic BusinessLogicHost, JiwaGrid GridObject, IJiwaForm FormObject, int Col, int Row, IJiwaLineCustomFieldValues HostItem,
CustomField CustomField, CustomFieldValue CustomFieldValue)
{
    string pluginName = CustomField.PluginCustomField.CustomFieldCollection.Plugin.Name;
    if (FormObject is SalesOrderEntryForm)
    {
        var salesOrderForm = (SalesOrderEntryForm)FormObject;
        salesOrderForm.LineCustomSettingValuesDisplayed += delegate
        {
            int rowCount = salesOrderForm.grdLines.ActiveSheet.RowCount;
            if (Row >= rowCount) return;
                   
            GridObject.LockColumn(true, string.Format("{0}.{1}", pluginName, "CustomFieldName"), Row);
        };
    }
}


However, Purchase Order doesn't seem to have LineCustomSettingValuesDisplayed and none of the events I tried worked. Is there an equivalent event I can use?
Crowe
I'm new here
I'm new here
 
Posts: 3
Joined: Wed Jun 14, 2023 4:45 pm

Re: LockColumn for Purchase Order Line custom fields  Topic is solved

Postby Mike.Sheen » Mon Sep 16, 2024 2:51 pm

You have to do this the long, boring way - which is in each place where a line is displayed, set the lock status.

Some forms have a LineDisplayed event which you could use that - sales orders and quotes do - but unfortunately purchase orders do not.

We've identified this deficiency and have it logged as an improvement : DEV-10656.

I've done up a plugin for the purchase order form (attached) which covers all the events you need to handle to lock or unlock custom line fields - see if that suits your needs.
Attachments
Plugin PO Custom Line Fields Lock.xml
(17.89 KiB) Downloaded 28 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: 2488
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 770

Re: LockColumn for Purchase Order Line custom fields

Postby Crowe » Mon Sep 16, 2024 6:01 pm

That worked wonderfully, thank you very much.
Crowe
I'm new here
I'm new here
 
Posts: 3
Joined: Wed Jun 14, 2023 4:45 pm


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 9 guests