Lock Custom Field on the Sales Order  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Lock Custom Field on the Sales Order

Postby SBarnes » Mon Sep 26, 2016 1:52 pm

Hi All,


Is there a way to lock a custom line field on a sales order the following doesn't work?



#region "LineCustomFieldPlugin"
public class LineCustomFieldPlugin : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaLineCustomFieldPlugin
{


public void FormatCell(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic BusinessLogicHost, JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm FormObject, int Col, int Row, JiwaFinancials.Jiwa.JiwaApplication.IJiwaLineCustomFieldValues HostItem, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomField CustomField, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomFieldValue CustomFieldValue)
{
if ( CustomField.PluginCustomField.Name == "ConsolidateHistText")
{

GridObject.ActiveSheet.Cells[Row, Col].Locked = true;
GridObject.LockColumn(true, "ConsolidateHistText",Row);

}
}

}
#endregion
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1620
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Lock Custom Field on the Sales Order  Topic is solved

Postby SBarnes » Tue Oct 04, 2016 10:59 am

To answer my own problem and hopefully help others.

You need to add an event handler to the form for LineCustomSettingValuesDisplayed such as

Code: Select all
salesform.LineCustomSettingValuesDisplayed += LineCustomDisplayed;


And then have a function such as the following, note that custom fields are referenced by the PluginName.CustomFieldName.

Code: Select all
   public void LineCustomDisplayed(JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomField customField, int Row, ref JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject)
   {
      
      GridObject.LockColumn(true,"MyPluginName.ConsolidateHistText",Row);
   }
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1620
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175


Return to Technical and or Programming

Who is online

Users browsing this forum: FAST WebCrawler [Crawler] and 15 guests