How do I show customer memos on order entry screen

Classic menus.
does anyone have any code I could look at for showing all memos for a customer tagged as Sales on the order entry screen? Either a box I can add or a popup showing all the memos. Our sales team would like to see them when they enter the customer for order entry. I do not know coding so I could use a step by step instructions and help please.

Hi Judd, warm welcome.

Not sure if this is what exactly you are looking for but this could get you started or might get you closer to what you want.

A BPM at Method Directive for SalesOrder → Update → Pre-Processing should help with condition as


and custom code:

 var CatchCustNum = from OrderHed_Row in ttOrderHed
                   join CashHead_Row in Db.CashHead on new { OrderHed_Row.Company, OrderHed_Row.CustNum }
                                                  equals new { CashHead_Row.Company, CashHead_Row.CustNum } 
                   where (CashHead_Row.TranType == "CMemo")
                   select new { OrderHed_Row, CashHead_Row };
foreach (var result in CatchCustNum)
{
    var transactionInfo = $"{result.CashHead_Row.CreditMemoNum}, {result.CashHead_Row.InvoiceNum}, {result.CashHead_Row.OrderNum}";
    this.PublishInfoMessage($"CustomerNum: {result.CashHead_Row.CustID} has credit memo {transactionInfo} of {result.CashHead_Row.DocTranAmt}", Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Grid, "SalesOrder.Update.PreProcessing", "Method Directive IT");
}

This shows all the existing credit memo. You can change or add details however you like. This is just for an example.

Thank you, I will give it a try in my test area.

Im very confused. I created a new directive for pre processing. The conditions were not quite the same. they were not ttOrderHed.CustNum they were ds.OrderHed.CustNum. I almost understand the custom code, I cannot seem to get ice.memo with conditions to work I get errors everywhere when I check the syntax.

Are you talking about this?


Where is your directive at ?

Can you share the code which shows error?

the TT vs DS is just a change they made from earlier versions. That’s a normal difference.



Here is what I see.

The Quotes are wrong. If you copy pasted the code, the quotes won’t be right. Delete them, and type them in.

I edited his code block to use code block and not quote, so not you can copy paste without the " getting messed up.

And you’re going to have to change the tt tables to ds.whatever records.

2 Likes

I think I got it down to 3 errors Im not sure what to do with.

You need a final " at the end. See how the ); is in blue? That means it still thinks it’s part of the string.

Nope, actually this is still wrong.

And a bunch more. Look at all of your quotation marks, you can see the ones that aren’t right.

1 Like

I think I have it correct, no errors anyway.


What do I need to do next, and what should I expect?

It should make a pop up message for the user whenever it gets triggered, based on your conditions.

1 Like

I got the sample one to work and I think I am close on the memo one.
I am trying to join ice.memo.company to erp.orderhead.company
and ice.memo.key1 to erp.orderhead.custnum
can you tell me what I have done wrong?

var CatchCustNum = from OrderHed_Row in ds.OrderHed
join memo in Db.Memo on new { OrderHed_Row.Company, OrderHed_Row.CustNum }
equals new { memo.Company, memo.CustNum }
where (memo.categoryid =="SLS")
select new { OrderHed_Row, memo };
foreach (var result in CatchCustNum)
{
var transactionInfo = $"{result.memo.memoNum}, {result.memo.memodesc}, {result.memo.memodate}";
this.PublishInfoMessage($"CustomerNum: {result.memo.memodesc} has credit memo {transactionInfo} of {result.memmo.memouserid}", Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Grid, "SalesOrder.Update.PreProcessing", "Method Directive memo");
}var CatchCustNum = from OrderHed_Row in ds.OrderHed
join memo in Db.Memo on new { OrderHed_Row.Company, OrderHed_Row.CustNum }
equals new { memo.Company, memo.CustNum }
where (memo.categoryid =="SLS")
select new { OrderHed_Row, memo };
foreach (var result in CatchCustNum)
{
var transactionInfo = $"{result.memo.memoNum}, {result.memo.memodesc}, {result.memo.memodate}";
this.PublishInfoMessage($"CustomerNum: {result.memo.memodesc} has credit memo {transactionInfo} of {result.memmo.memouserid}", Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Grid, "SalesOrder.Update.PreProcessing", "Method Directive memo");
}

image

Use memo.Key1 where you used memo.CustNum

That should fix this error.

To see what fields you have in that database table press “Ctrl + Space”. That will pop up list of columns in that table.

Am I getting Closer? I have tried to change Memo.Key1 with (int) and (int?) Mem.key1 is a string field and custnum is a INT field
Here is my new code. Where am I going wrong?

Double click on the error and it will take you to where the error is. Start with the first one. I can see the issue by comparing your two screen shots.

1 Like

Another approach could be with an embedded dashboard with a DBBrowse link.
When the Customer Shipment is created and the order entered onto a line, the embedded dashboard is filtered to show information on for this shipment.

The memo lines appear for the order. The color coding is showing where the memo is placed in the system.

WIth Kinetic - a BAQ widget could be used in the same means. (on my to do list)

I have used these with Order entry, Purchase order entry, customer shipments and PO receipts.

To filter them out, use memo codes to do this.

Thank you, I will look into this as well.

How was this resolved? I followed it to this point, but am stuck with an error.
And if I try (int)Memo.Key1 it gives the same type error that Judd shows.

@Judds
@Banderson