How to Make Adding a Quote Contact Mandatory

We are running Epicor 9.05.702a and trying to figure out how to make it so that quotes cannot be entered without adding a customer contact.

We’ve gone into Extended Properties and made the “QuoteCnt.ConNum” field required, but that only works if they actually navigate to the People/Contacts/Details tab and add a contact (or add in the new menu). If they never try to add a contact, they can create the quote without an error popup telling them they have not filled out that field.

Does anyone know how we can require them to add a contact before the quote can be saved? Thanks in advance for your input.

This BPM won’t allow a quote to be saved if there is no customer contact. Maybe it will get you started in the right direction.

/Add source code that should be executed before the designed actions here/

{&CALL_DESIGNED_ACTIONS}

for first ttQuoteHed no-lock where ttQuoteHed.RowMod = ‘A’ or ttQuoteHed.RowMod = ‘U’:

if available ttQuoteHed then do:
	for first CustCnt no-lock where (CustCnt.Company = ttQuoteHed.Company and CustCnt.CustNum = ttQuoteHed.CustNum).
	end.
end.
	if NOT available CustCnt then do:
		{lib/PublishEx.i &ExMsg = "'Before a quote or an order can be saved, a customer must have a contact.'"}.
	end.

end.

/Add source code that should be executed after the designed actions here/

Hi Sue - thanks for your reply, I’m afraid I am a bit of a novice when it comes to BPM’s. Without a step by step, I’m not sure where I’m adding this code. If it’s not too much trouble could you please elaborate a little?

It’s best to develop BPMs in a test environment. I do my development work on a test server to make sure I don’t affect performance in the live database. You can use test or pilot to develop the BPM if you don’t have a test server. Epicor 9 has separate BPMExec areas for live, test, pilot and train on the server so BPMs for a test database shouldn’t affect your live database.

  1. Go into Method Directives (System Management>Business Process Management>Setup>Method Directives).
  2. Search Method Codes by Business Object for the Business Object Quote.
  3. Choose the Update Method for Quote.
  4. Create a new Pre-Processing method directive.
  5. Enter a description such as “Customer Contact Mandatory”.
  6. Enter a descriptive group such as “Mandatory”.
  7. Check the Prevent Endless Loops check box.
  8. Click on the Actions button.
  9. Choose the Advanced button at the bottom of the Actions form.
  10. Copy and paste (or enter) the ABL programming between {&CALL_DESIGNED_ACTIONS) and /Add source code that should be executed after the designed actions here/.
  11. The result should look like the script I posted.
  12. Click on Ok to save the script. (It won’t let you save it if there are errors in the code.)
  13. Click on Ok to save the Actions.
  14. Click the Enabled check box and save the pre-processing method directive.
  15. Test by adding a quote without a contact (BPM should block saving a quote) and with a contact (quote should save without messages/errors).
  16. If you have problems testing the BPM simply un-check the Enabled check box on the pre-processing method and save it. Then you can work on the BPM and try again until it’s working correctly.

Good luck!

Sue

Thank you for all of your help. I had everything right up until I tried to put the code in Conditions instead of Actions, LOL. Unfortunately, in testing the BPM it still allowed me to save the Quote without adding a contact and the message never popped up. I’m wondering if some of the other BPM I have are interfering.

It is possible something else is interfering. Here is the same code I sent with a ridiculous amount of displayed messages that would tell you if the BPM is working. It will display messages as the BPM runs regardless of whether the customer has contacts or not. The messages aren’t very descriptive, but you can follow the progress of the BPM when it runs. You will need to remove the /* and */ marking the display message code as comments.

/Add source code that should be executed before the designed actions here/

{&CALL_DESIGNED_ACTIONS}

/{lib/PublishInfoMsg.i &InfoMsg = “‘start BPM’”}./
for first ttQuoteHed no-lock where ttQuoteHed.RowMod = ‘A’ or ttQuoteHed.RowMod = ‘U’:

if available ttQuoteHed then do:
	/*{lib/PublishInfoMsg.i &InfoMsg = "'found ttQuoteHed'"}*/
	for first CustCnt no-lock where (CustCnt.Company = ttQuoteHed.Company and CustCnt.CustNum = ttQuoteHed.CustNum).
	/*{lib/PublishInfoMsg.i &InfoMsg = "'found first CustCnt'"}.
	{lib/PublishInfoMsg.i &InfoMsg = "'end2'"}.*/
	end.
/*{lib/PublishInfoMsg.i &InfoMsg = "'end3'"}.*/
end.
	if NOT available CustCnt then do:
		{lib/PublishEx.i &ExMsg = "'Before a quote or an order can be saved, a customer must have a contact.'"}.
	/*{lib/PublishInfoMsg.i &InfoMsg = "'end4'"}.*/
	end.

/*{lib/PublishInfoMsg.i &InfoMsg = “‘end1’”}.
the previous InfoMsg (w/end1) was never displayed */
end.

/* When using a customer w/contacts end2, end3, and end1 were displayed.
When using a customer wo/contacts no end messages were displayed, it falls thru & gives the error messsage. */

/Add source code that should be executed after the designed actions here/

Thank you!

For those still on E9, here is a little ad for E10 BPMs…
I have always loved BPMs, going way back to V8… but the above solution in E10 takes no coding… no progress code… no c# code.
The same exact functionality can be done in an “In-Transaction” data BPM, with a “Condition” that does the query. you build the query almost exactly like a BAQ (Except HERE you can see the TT records. Of cource, you can also have more complexity with the flowchart capabilities in the BPM…

1 Like