Page 1 of 1

Unlock custom line field on Closed sales

PostPosted: Mon Apr 14, 2025 3:43 pm
by DannyC
I've got a text box on a sales order line custom field.
When the sales order is closed, I want this column to still be allowed edits.

Can't work out how to do it.
I've tried in the LineCustomFieldPlugin section, FormatCell.
Code: Select all
GridObject.LockColumn(false,"My ColName", Row);


Also have tried similar code in the LineDisplayed event of the form, and the sales order ReadEnd event.

None have worked. What's the trick?

v. 7.2.1. SR22.

Re: Unlock custom line field on Closed sales  Topic is solved

PostPosted: Mon Apr 14, 2025 4:11 pm
by Mike.Sheen
LineDisplayed of the form will definitely do what you want - if you've tried that already and it's not working then your "My ColName" is probably wrong - hard to say for sure without a sample, but usually that's what trips most people up.

Use the manage grid function to see the key of the column - you'll see it's actually {Plugin Name}.{Custom field name} - to you might need to change "My ColName" to "My Plugin Name.My ColName".

Re: Unlock custom line field on Closed sales

PostPosted: Mon Apr 14, 2025 5:20 pm
by DannyC
your "My ColName" is probably wrong


Yep.
This is better
Code: Select all
String.Format("{0}.{1}", _plugin.Name, "My ColName")


Needed on LineDisplayed and the SalesOrderLineChanged events.

Re: Unlock custom line field on Closed sales

PostPosted: Mon Apr 14, 2025 5:26 pm
by Mike.Sheen
DannyC wrote:Yep.
This is better
Code: Select all
String.Format("{0}.{1}", _plugin.Name, "My ColName")



Are you saying that resolved your issue? Or were you just pointing out that your example was over-simplified and you already were using {Plugin Name}.{Column Name} ?

DannyC wrote:Needed on LineDisplayed and the SalesOrderLineChanged events.

No need to do both - just LineDisplayed will suffice.

Re: Unlock custom line field on Closed sales

PostPosted: Tue Apr 15, 2025 11:53 am
by DannyC
Are you saying that resolved your issue?

Yes. By having both the plugin name and the custom field name, that was what I was missing and resolved the issue.