Back to connectors… Back to Sage 200...

Prepopulating the Despatch Receipt Number when despatching an order (10 replies)

David F
6 years ago
David F 6 years ago

One of my customers provides me with a ticket number that I would like to use as the Despatch Receipt Number when Iman despatches an order. In Sage, the Despatch Receipt Number is at line level. I know that Iman's Sales Order Despatch has the facility to set the Despatch receipt number at header level. How would I achieve this at line level? There can more than one distinct ticket number per Sales Order.

Support
6 years ago
Support 6 years ago

David, this isn't possible, though I am not sure if I understand the issue.

You're not able set the Despatch Receipt Number (this is generated by Sage).

Thanks

https://www.realisable.co.uk/wp-content/uploads/2018/09/S200Despatched.png
David F
6 years ago
David F 6 years ago

Thank you for advising me.

I have two possible solutions to this issue and would like to know which one the Iman Sage 200 2016 connector is more likely to support.

Solution 1 : Add ticket number as an extra field on the SOPDespatchReceiptLine table via Sage Object Store Builder. This would result in a SQL Table called SOPDespatchReceiptLineX containing the despatch receipt line id and the ticket number.

Solution 2 : Add a custom table via Sage Object Store Builder that contains an id, the DespatchReceiptNo and Ticket Number.

Support
6 years ago
Support 6 years ago

David, in reply to Solution 2 what is the id field? Is it just the id to the record in the custom table (and not the ReceiptDespatchLineId)?

Thanks

David F
6 years ago
David F 6 years ago

In solution 2,  the id is just the id to the record. 

Support
6 years ago
Support 6 years ago

David, solution 2 would be the better approach.

However, you'd need to insert the records directly using the DB Writer (as the Sage200 Connector doesn't have the ability to write to custom tables).

Thanks

David F
6 years ago
David F 6 years ago

Thank you for the advice. I have adopted solution 2. I need to get the max id of the custom table to set the unique record ids so I set up a lookup with the select clause Max(LineTicketId) as MaxLineId.

When I try to use the lookup, I keep getting type mismatch on Resolved Function - LOOKUP("GETMAXLINEID","MaxLineId",,False) .  What do I need to do to get this to work? The custom table is currently empty.

Support
6 years ago
Support 6 years ago

David, you're missing a value in the third argument. Alter the lookup to include an empty string.

Lookup("GETMAXLINEID","MaxLineId","",False)

Thanks

David F
6 years ago
David F 6 years ago

I have set the value in the third argument. It's possible that MaxLineId doesn't contain a value because there are no records on file. I have tried various formulas but just keep getting errors like the one below:

Error whilst evaluating field [MaxId] on transaction type [SOPDespatchReceiptAdjustment].
Resolved Function - IIf(ISNUMERIC(Lookup("GETMAXLINEID","MaxLineId","",False)),Lookup("GETMAXLINEID","MaxLineId","",False) + 1,1)
Error - Description: Type mismatch: '[string: ""]'
Line=1 Pos=0

MaxId is a field that I created in a map transform to test the formula. Where in the resolved function is the type mismatch and how do I correct it?

Support
6 years ago
Support 6 years ago

David, its because your Lookup is returning.

I would suggest you alter the Lookup query to something like..

ISNULL(Max(LineTicketId), 0) as MaxLineId

Then your script is simple

Lookup("GETMAXLINEID","MaxLineId","",False)

David F
6 years ago
David F 6 years ago

Thank you for help with this. Everything works now.

Contact

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close

Request Demo

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close

Access Downloads

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close