Make sales order comments bigger

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

Re: Make sales order comments bigger

Postby DannyC » Wed Nov 19, 2025 10:11 am

OK, found the cause of the exception.

Unfortunately it was your code, not mine :o
Row comes first, then column.
so this works fine.
Code: Select all
((FarPoint.Win.Spread.CellType.TextCellType)_salesOrderForm.grdLines.ActiveSheet.Cells[Row, _salesOrderForm.grdLines.ActiveSheet.Columns["PartNo"].Index].CellType).MaxLength = 1000;


I can now physically enter in 1000 chars into the comments but as per OP they're not going to be entered by a user, the comments come from a quote. Moot point anyway.
When I save the sales order, I'm only left with the first 200 chars.

It's something on save that is doing it.
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31

Re: Make sales order comments bigger

Postby Mike.Sheen » Wed Nov 19, 2025 10:36 am

DannyC wrote:OK, found the cause of the exception.

Unfortunately it was your code, not mine :o

Row comes first, then column.

Oops!
DannyC wrote:When I save the sales order, I'm only left with the first 200 chars.

It's something on save that is doing it.


Yep - I've checked the code for the save of the sales order line and this is the setting of the SQL Parameter for the comment text:
Code: Select all
SQLParam = New SqlParameter("@HistoryText_Comment", System.Data.SqlDbType.VarChar)
SQLParam.Value = Left(HistoryText, 200)
SQLCmd.Parameters.Add(SQLParam)


Maybe add a handler on SaveEnding and do a little loop issuing UPDATE SO_Lines SET HistoryText = '{SalesOrderLine.CommentText}' WHERE InvoiceLineID = '{SalesOrderLine.RecID}' for each line which is a comment line.

FWIW V8 does not truncate comments to 200 characters on save, and the DisplayLine method also does not set the MaxLength to 200, but Integer.MaxValue.
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: Make sales order comments bigger

Postby DannyC » Wed Nov 19, 2025 11:41 am

add a handler on SaveEnding and do a little loop


Ah ha! That was the trick.

Really appreciate the help Mike.
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31

Re: Make sales order comments bigger

Postby DannyC » Tue Dec 16, 2025 12:30 pm

The attached plugin works OK to get the details from inventory & add it as a comment line to a quote.

I've discovered, after client had reported it still truncates to 200 chars, that when the partno is entered on the quote line, it correctly brings the Aux3 value into the quote.
I have been testing by hitting <tab> after the partno is entered, but they are in the practise of using <enter>, not <tab>.
Using <enter> jumps to the next line and puts the cursor into the partno field.

It's when the cursor is put in the PartNo field (now a comment) that the extended chars are truncated to 250 (or 255?) characters.

I've been fiddling about with different plugin code but I can't find the correct syntax for keeping the MaxLength at 1000 chars when the comment has focus.

Can you assist?
Attachments
Plugin Attkey Sales Quote Get PartNo details c.xml
(36.85 KiB) Downloaded 315 times
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 0 guests