Change Quantities on a Sales Quote  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Change Quantities on a Sales Quote

Postby TomW » Tue Jul 05, 2016 4:15 pm

Hi,

Some time back I put a plug in together that generates a quote from a Excel spreadsheet. This works fine but, now I have been asked to add another field to the shreadsheet for the quantities. Not all quatities are going to set to more than the default 1 only selected ones. I am currently using the following to add the item:

salesQuoteEntryForm.SalesQuote.SalesQuoteLines.AddInventoryItem(partNoToAdd,JiwaFinancials.Jiwa.JiwaSales.SalesQuote.SalesQuoteLineCollection.SalesQuoteLineInventorySeedTypes.e_SalesQuoteLinePartNo,ref newKey, null, 0);


I cannot find any way to alter the quantity throught the plugin. Could you guys point me in the right direction here it would be much appreciated.

Many Thanks

Tom
TomW
Occasional Contributor
Occasional Contributor
 
Posts: 22
Joined: Wed Jun 24, 2015 11:02 am
Topics Solved: 1

Re: Change Quantities on a Sales Quote

Postby Mike.Sheen » Sun Jul 31, 2016 12:05 pm

TomW wrote:Hi,

Some time back I put a plug in together that generates a quote from a Excel spreadsheet. This works fine but, now I have been asked to add another field to the shreadsheet for the quantities. Not all quatities are going to set to more than the default 1 only selected ones. I am currently using the following to add the item:

salesQuoteEntryForm.SalesQuote.SalesQuoteLines.AddInventoryItem(partNoToAdd,JiwaFinancials.Jiwa.JiwaSales.SalesQuote.SalesQuoteLineCollection.SalesQuoteLineInventorySeedTypes.e_SalesQuoteLinePartNo,ref newKey, null, 0);


I cannot find any way to alter the quantity throught the plugin. Could you guys point me in the right direction here it would be much appreciated.

Many Thanks

Tom


Hi Tom,

Just set the Quantity property after adding the line to the quote - the AddInventoryItem method returns a newKey by reference, and this is the index to the newly added line - so:
Code: Select all
salesQuoteEntryForm.SalesQuote.SalesQuoteLines[newKey].Quantity = 10;


Mike
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: 2446
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Change Quantities on a Sales Quote

Postby TomW » Mon Aug 01, 2016 9:14 am

Hi Mike

You guys must be a bit busy working on a Sunday, thanks for the reply it a return a couple of issues.

What I tried was
Code: Select all
salesQuoteEntryForm.SalesQuote.SalesQuoteLines.AddInventoryItem(partNoToAdd,JiwaFinancials.Jiwa.JiwaSales.SalesQuote.SalesQuoteLineCollection.
SalesQuoteLineInventorySeedTypes.e_SalesQuoteLinePartNo,ref newKey, null, 0);         
salesQuoteEntryForm.SalesQuote.SalesQuoteLines[newKey].Quantity = 10;

The above returned 2 errors

The first one was Argument 1: cannot convert from 'object to int' I fixed that by casting newKey to and int
Code: Select all
lNum = (int)newKey;

now I am left with this next error
TomW
Occasional Contributor
Occasional Contributor
 
Posts: 22
Joined: Wed Jun 24, 2015 11:02 am
Topics Solved: 1

Re: Change Quantities on a Sales Quote

Postby TomW » Mon Aug 01, 2016 9:17 am

Sorry Mike pressed the wrong button

The final error

'JiwaFinancials.Jiwa.JiwaSales.SalesQuote.SalesQuoteLine' does not contain a definition for 'Quantity' and no extension method 'Quantity'

This bring me back to the problem I had initially where I could find no reference to the Quantity.

Thanks

Tom
TomW
Occasional Contributor
Occasional Contributor
 
Posts: 22
Joined: Wed Jun 24, 2015 11:02 am
Topics Solved: 1

Re: Change Quantities on a Sales Quote  Topic is solved

Postby Mike.Sheen » Sun Aug 07, 2016 4:24 pm

TomW wrote:Sorry Mike pressed the wrong button

The final error

'JiwaFinancials.Jiwa.JiwaSales.SalesQuote.SalesQuoteLine' does not contain a definition for 'Quantity' and no extension method 'Quantity'

This bring me back to the problem I had initially where I could find no reference to the Quantity.

Thanks

Tom


Sorry, Tom - my mistake - it's QuantityOrdered, not Quantity.

Mike
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: 2446
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 19 guests