Page 1 of 1

Renaming and locking a field

PostPosted: Wed May 11, 2016 11:17 am
by Atronics
How do I
1. rename a field? e.g. IN_Main.SecondaryCost
2. lock a field to eliminate inadvertent changes

Re: Renaming and locking a field

PostPosted: Thu May 12, 2016 10:19 pm
by Mike.Sheen
Atronics wrote:How do I
1. rename a field? e.g. IN_Main.SecondaryCost
2. lock a field to eliminate inadvertent changes


You reference to IN_Main.SecondaryCost suggests you want to rename the table column - we don't support that. You can, however rename the label presented to the user on the Inventory Maintenance form. A plugin can do that - add the Inventory Maintenance form to a plugin's forms list, and in the Setup method set the Text property of the desired control. You can find the control name using the permissions function (via the ribbon) when the Inventory Maintenance form is loaded - it will list all the control names for you.

Regarding locking a field to prevent editing - using the permissions system to do that is the easiest - no coding required, just load the Inventory Maintenance form and select the permissions tool on the ribbon and select Disallow for the write permission to the desired user groups. Remember that when setting disallow permissions, it applies no matter what other user groups a user is a member of - so you only need to have users be the member of one group with that permission set to disallow.

Re: Renaming and locking a field

PostPosted: Fri May 13, 2016 4:49 pm
by Atronics
Mike, I am at the edge of my capabilities with this. COuld you give me an example of the code that I need to insert "in the Setup method" and where.
Much appreciated.

Re: Renaming and locking a field

PostPosted: Sun May 15, 2016 8:50 pm
by Mike.Sheen
Atronics wrote:Mike, I am at the edge of my capabilities with this. COuld you give me an example of the code that I need to insert "in the Setup method" and where.
Much appreciated.


Then you shouldn't be attempting this.

We've given you plenty of plugins in the past which should have served you well as a starting point for a plugin like which you're asking for. If you're not able to do it yourself, then perhaps you should recruit a developer who can. It's quite apparent to me now that you're not a developer and have no interest in being one.

Our largesse in these forums by providing plugins is intended to help developers gain skills and knowledge to be effective in developing plugins for Jiwa. You don't seen to be doing anything other than asking us to write plugins for free. We don't do that here. We'll help if you've have a crack at it, and provide guidance - but only if you're a developer and have actually demonstrated you've tried to solve the problem on your own first. I think we've been pretty generous with you so far, but it's time to reign back what we do for free.

We CAN do it for you, but you need to pay for it. You can contact [email protected] and ask for a quote. Note: You need to be clear on what you want - we charge by the hour, and if what you asked for on your quote isn't what you wanted, then we will bill you for amendments.

Mike

Re: Renaming and locking a field

PostPosted: Mon May 16, 2016 11:19 am
by Atronics
Mike,
I am simply trying to provide a solution to a client requirement. If I don't know how to do this, then I ask someone who can provide the necessary assistance. You are correct. I am not a software developer, you are; and I am seeking your assistance, which has been very gratefully accepted in the past.
John

Re: Renaming and locking a field  Topic is solved

PostPosted: Tue May 17, 2016 9:30 pm
by Mike.Sheen
I've created a bug for a generic solution to allow users to rename labels themselves on all forms - DEV-4949.

In the meantime, the attached plugin does specifically what you asked for - renames the label for the SecondaryCost field on inventory maintenance. You'll need to edit the code to set the text to be exactly what you want (look for "XXX" and change that to what you want).

The code which renames the field is shown below:
Code: Select all
public void Setup(JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm JiwaForm, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
{
    var inventoryForm = (JiwaFinancials.Jiwa.JiwaInventoryUI.InventoryMaintenanceForm)JiwaForm;
    inventoryForm.SecondaryCostLabel.Text = "XXX";
}


Mike