BPM C# code question

Yes, I have it resolved, thanks to Jose who pointed me to a very good document. The design change a little bit. It use Part_UD fields to update OrderDtl and UD field. Here is the code


foreach (var od in ttOrderDtl)
{
   var pt = (from ptRow in Db.Part
                  where string.Compare(od.Company, ptRow.Company, true) == 0 && 
                             string.Compare(od.PartNum, ptRow.PartNum, true) == 0
                  select ptRow).FirstOrDefault();

   if (pt != null)
   {
      od.SetUDField("SalesRepID1_c",pt.SalesRepID1_c);
      od.SetUDField("SalesRepName1_c",pt.SalesRepName1_c);
      od.RepRate1 = pt.RepRate1_c;
      od.RepSplit1 = pt.RepSplit1_c;
   }
}
Db.Validate();

Thanks everyone who join the discussion in this topic

I am new to BPM. I am trying to write a method directive on sales order update to execute C# code to perform following tasks:


1. Get the current order number

2. For each order line, using PartNum to lookup Part table

3. Update OrderDtl->ShortChar01 with Part->ShortChar01


I could not find any document about the C# code in BPM. 


Could someone give me some advice on how to accomplish this.


Thanks 



Read the E10 Converted Code Programmers Guide in EpicWeb it shows you how to call business objects and such from BPM


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Tue, Sep 22, 2015 at 9:23 AM, yzou79@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p></p><p><span>I am new to BPM. I am trying to write a method directive on sales order update to execute C# code to perform following tasks:</span></p><p><span><br></span></p><p><span>1. Get the current order number</span></p><p><span>2. For each order line, using PartNum to lookup Part table</span></p><p><span>3. Update OrderDtl-&gt;ShortChar01 with Part-&gt;ShortChar01</span></p><p><span><br></span></p><p><span>I could not find any document about the C# code in BPM. </span></p><p><span><br></span></p><p><span>Could someone give me some advice on how to accomplish this.</span></p><p><span><br></span></p><p><span>Thanks </span></p><p><span><br></span></p><p><span><br></span></p><p></p>

</div>
 


<div style="color:#fff;min-height:0;"></div>

Why are you trying to get that information into OrderDtl.ShortChar01 is there a particular use case that doesn’t meet the following?

 

If it’s for reporting you can always get it from the part through RDD linking.

If it’s for displaying in the screen save yourself a UD field and use a foreign key view.

 

Joshua Giese
Technology Solutions : CTO

Direct Phone:    920.593.8299
Office Phone:    920.437.6400 x342

http://wcibags.com/email/emailFooter4.jpg

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, September 22, 2015 8:24 AM
To: vantage@yahoogroups.com
Subject: [Vantage] BPM C# code question

 

 

I am new to BPM. I am trying to write a method directive on sales order update to execute C# code to perform following tasks:

 

1. Get the current order number

2. For each order line, using PartNum to lookup Part table

3. Update OrderDtl->ShortChar01 with Part->ShortChar01

 

I could not find any document about the C# code in BPM. 

 

Could someone give me some advice on how to accomplish this.

 

Thanks 

 

 

Thanks, Jose. I will read that document.
Thanks, Joshua. I don't know the purpose of this project. I am a developer with limited knowledge about Epicor and was assigned to this task by my boss. I will pass your remark to my boss. 

Because I think it’s important enough to stress…

 

Always try to make sure you understand the why and how it will be used when doing a project so you can make sure you are deploying the “right tool for the job”. A lot of it should be just the enjoyment of solving a problem the most effectively, if a user asks for a textbox added and I just put it out there, and then I found out the textbox is used to "flag" records as "PENDING INVOICE" because the end user doesn't know that Shipped Slips automatically go to the pending invoice queue. That means I've built a "solution" to a non-existent problem.

Joshua Giese
Technology Solutions : CTO

Direct Phone:    920.593.8299
Office Phone:    920.437.6400 x342

http://wcibags.com/email/emailFooter4.jpg

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, September 22, 2015 10:07 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: BPM C# code question

 

 

Thanks, Joshua. I don't know the purpose of this project. I am a developer with limited knowledge about Epicor and was assigned to this task by my boss. I will pass your remark to my boss. 

I think it would be great to answer a question if you are able but, avoid turning questions back on the requester for justification…

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, September 22, 2015 11:24 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Re: BPM C# code question


Because I think it’s important enough to stress…

Always try to make sure you understand the why and how it will be used when doing a project so you can make sure you are deploying the “right tool for the job”. A lot of it should be just the enjoyment of solving a problem the most effectively, if a user asks for a textbox added and I just put it out there, and then I found out the textbox is used to "flag" records as "PENDING INVOICE" because the end user doesn't know that Shipped Slips automatically go to the pending invoice queue. That means I've built a "solution" to a non-existent problem.
Joshua Giese
Technology Solutions : CTO
Direct Phone: 920.593.8299
Office Phone: 920.437.6400 x342
[Image removed by sender. http://wcibags.com/email/emailFooter4.jpg%5d<http://www.wcibags.com/>
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, September 22, 2015 10:07 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: BPM C# code question



Thanks, Joshua. I don't know the purpose of this project. I am a developer with limited knowledge about Epicor and was assigned to this task by my boss. I will pass your remark to my boss.



[Non-text portions of this message have been removed]

Joe I totally disagree. Developers/IT need to be far more involved than ever before to ensure agile and efficient solutions are implemented. Blindly being a sheep to the requestor is not good for anyone it’s how bloat and garbage collection happen.

 

Joshua Giese
Technology Solutions : CTO

Direct Phone:    920.593.8299
Office Phone:    920.437.6400 x342

http://wcibags.com/email/emailFooter4.jpg

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, September 22, 2015 10:44 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Re: BPM C# code question

 

 

I think it would be great to answer a question if you are able but, avoid turning questions back on the requester for justification…

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, September 22, 2015 11:24 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Re: BPM C# code question


Because I think it’s important enough to stress…

Always try to make sure you understand the why and how it will be used when doing a project so you can make sure you are deploying the “right tool for the job”. A lot of it should be just the enjoyment of solving a problem the most effectively, if a user asks for a textbox added and I just put it out there, and then I found out the textbox is used to "flag" records as "PENDING INVOICE" because the end user doesn't know that Shipped Slips automatically go to the pending invoice queue. That means I've built a "solution" to a non-existent problem.
Joshua Giese
Technology Solutions : CTO
Direct Phone: 920.593.8299
Office Phone: 920.437.6400 x342
[Image removed by sender. http://wcibags.com/email/emailFooter4.jpg]<http://www.wcibags.com/>
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, September 22, 2015 10:07 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: BPM C# code question



Thanks, Joshua. I don't know the purpose of this project. I am a developer with limited knowledge about Epicor and was assigned to this task by my boss. I will pass your remark to my boss.


[Non-text portions of this message have been removed]

Yep, that’s a fair point. I just think sometimes it’s tough for a developer to come here to ask a question only to be challenged for justifications.

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, September 22, 2015 12:01 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Re: BPM C# code question


Joe I totally disagree. Developers/IT need to be far more involved than ever before to ensure agile and efficient solutions are implemented. Blindly being a sheep to the requestor is not good for anyone it’s how bloat and garbage collection happen.

Joshua Giese
Technology Solutions : CTO
Direct Phone: 920.593.8299
Office Phone: 920.437.6400 x342
[Image removed by sender. http://wcibags.com/email/emailFooter4.jpg%5d<http://www.wcibags.com/>
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, September 22, 2015 10:44 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Re: BPM C# code question



I think it would be great to answer a question if you are able but, avoid turning questions back on the requester for justification…

From: vantage@yahoogroups.com<mailto:vantage@yahoogroups.com> [mailto:vantage@yahoogroups.com]
Sent: Tuesday, September 22, 2015 11:24 AM
To: vantage@yahoogroups.com<mailto:vantage@yahoogroups.com>
Subject: RE: [Vantage] Re: BPM C# code question


Because I think it’s important enough to stress…

Always try to make sure you understand the why and how it will be used when doing a project so you can make sure you are deploying the “right tool for the job”. A lot of it should be just the enjoyment of solving a problem the most effectively, if a user asks for a textbox added and I just put it out there, and then I found out the textbox is used to "flag" records as "PENDING INVOICE" because the end user doesn't know that Shipped Slips automatically go to the pending invoice queue. That means I've built a "solution" to a non-existent problem.
Joshua Giese
Technology Solutions : CTO
Direct Phone: 920.593.8299
Office Phone: 920.437.6400 x342
[Image removed by sender. http://wcibags.com/email/emailFooter4.jpg%5d<http://www.wcibags.com/<http://wcibags.com/email/emailFooter4.jpg%5d%3chttp:/www.wcibags.com/>>
From: vantage@yahoogroups.com<mailto:vantage@yahoogroups.com> [mailto:vantage@yahoogroups.com]
Sent: Tuesday, September 22, 2015 10:07 AM
To: vantage@yahoogroups.com<mailto:vantage@yahoogroups.com>
Subject: [Vantage] Re: BPM C# code question



Thanks, Joshua. I don't know the purpose of this project. I am a developer with limited knowledge about Epicor and was assigned to this task by my boss. I will pass your remark to my boss.


[Non-text portions of this message have been removed]



[Non-text portions of this message have been removed]

Lol it wasn’t meant as a justification but exploratory questions for him to implement the best solution.

 

A wise man once told me “You’re only ever one question away from reality”. Ask someone how they are doing they will say “I’m good you?”, ask more specific questions and you find out they’re a hot mess.

 

Joshua Giese
Technology Solutions : CTO

Direct Phone:    920.593.8299
Office Phone:    920.437.6400 x342

http://wcibags.com/email/emailFooter4.jpg

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, September 22, 2015 11:18 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Re: BPM C# code question

 

 

Yep, that’s a fair point. I just think sometimes it’s tough for a developer to come here to ask a question only to be challenged for justifications.

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, September 22, 2015 12:01 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Re: BPM C# code question


Joe I totally disagree. Developers/IT need to be far more involved than ever before to ensure agile and efficient solutions are implemented. Blindly being a sheep to the requestor is not good for anyone it’s how bloat and garbage collection happen.

Joshua Giese
Technology Solutions : CTO
Direct Phone: 920.593.8299
Office Phone: 920.437.6400 x342
[Image removed by sender. http://wcibags.com/email/emailFooter4.jpg]<http://www.wcibags.com/>
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, September 22, 2015 10:44 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Re: BPM C# code question



I think it would be great to answer a question if you are able but, avoid turning questions back on the requester for justification…

From: vantage@yahoogroups.com<mailto:vantage@yahoogroups.com> [mailto:vantage@yahoogroups.com]
Sent: Tuesday, September 22, 2015 11:24 AM
To: vantage@yahoogroups.com<mailto:vantage@yahoogroups.com>
Subject: RE: [Vantage] Re: BPM C# code question


Because I think it’s important enough to stress…

Always try to make sure you understand the why and how it will be used when doing a project so you can make sure you are deploying the “right tool for the job”. A lot of it should be just the enjoyment of solving a problem the most effectively, if a user asks for a textbox added and I just put it out there, and then I found out the textbox is used to "flag" records as "PENDING INVOICE" because the end user doesn't know that Shipped Slips automatically go to the pending invoice queue. That means I've built a "solution" to a non-existent problem.
Joshua Giese
Technology Solutions : CTO
Direct Phone: 920.593.8299
Office Phone: 920.437.6400 x342
[Image removed by sender. http://wcibags.com/email/emailFooter4.jpg]<http://www.wcibags.com/<http://wcibags.com/email/emailFooter4.jpg%5d%3chttp:/www.wcibags.com/>>
From: vantage@yahoogroups.com<mailto:vantage@yahoogroups.com> [mailto:vantage@yahoogroups.com]
Sent: Tuesday, September 22, 2015 10:07 AM
To: vantage@yahoogroups.com<mailto:vantage@yahoogroups.com>
Subject: [Vantage] Re: BPM C# code question



Thanks, Joshua. I don't know the purpose of this project. I am a developer with limited knowledge about Epicor and was assigned to this task by my boss. I will pass your remark to my boss.


[Non-text portions of this message have been removed]


[Non-text portions of this message have been removed]

Joe,
I have to side with Josh here, we are here to help others and sometimes a little kick in the pants its the best help you can give. If he learns why he is doing this project maybe we can then help him find a better solution. Most "clients" don't know what they really need, they know what they think they want. It is our job as developers to figure out the what the end goal is and to find a solution to the real problem.


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Tue, Sep 22, 2015 at 11:44 AM, Joe Englert englertj@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p>I think it would be great to answer a question if you are able but, avoid turning questions back on the requester for justification…


From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, September 22, 2015 11:24 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Re: BPM C# code question


Because I think it’s important enough to stress…

Always try to make sure you understand the why and how it will be used when doing a project so you can make sure you are deploying the “right tool for the job”. A lot of it should be just the enjoyment of solving a problem the most effectively, if a user asks for a textbox added and I just put it out there, and then I found out the textbox is used to "flag" records as "PENDING INVOICE" because the end user doesn't know that Shipped Slips automatically go to the pending invoice queue. That means I've built a "solution" to a non-existent problem.
Joshua Giese
Technology Solutions : CTO
Direct Phone: 920.593.8299
Office Phone: 920.437.6400 x342
[Image removed by sender. http://wcibags.com/email/emailFooter4.jpg]<http://www.wcibags.com/>
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, September 22, 2015 10:07 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: BPM C# code question



Thanks, Joshua. I don't know the purpose of this project. I am a developer with limited knowledge about Epicor and was assigned to this task by my boss. I will pass your remark to my boss.


[Non-text portions of this message have been removed]

</div>
 


<div style="color:#fff;min-height:0;"></div>

Completely agree on the need to understand the why before even starting to figure out a solution. 

Understanding why usually helps build it better and can be expanded if needed.

And the biggest reason to ask why is if they can't explain why they need it very well, very likely they don't need to be doing it.

Something that needs to be asked as part of the why is how does the current system handle what you want and why can't you do it that way? 

Jim Kinneman
Encompass Solutions, Inc
Color me outnumbered. ☺ I give people the benefit of the doubt – they’ve already gotten the job, I assume they are professionals who don’t need analysis 101. If they need a general question answered, they’d ask it.

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, September 22, 2015 2:39 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: BPM C# code question



Completely agree on the need to understand the why before even starting to figure out a solution.

Understanding why usually helps build it better and can be expanded if needed.

And the biggest reason to ask why is if they can't explain why they need it very well, very likely they don't need to be doing it.

Something that needs to be asked as part of the why is how does the current system handle what you want and why can't you do it that way?

Jim Kinneman
Encompass Solutions, Inc



[Non-text portions of this message have been removed]
Have you gotten anywhere with this issue?  I need to do a similar operations.

GreatBeachVacation,


Can you give some more information on what you are needing to do?