How do I pre-populate the CallCode field in Service Call Center?

Hello,

I need to pre-populate the CallCode field in Service Call Center to be ‘Received’.
I followed the directions in the PDF for education call Business Process Management.
It had me create a new Post processing method directive for ServiceCallCenter.
I tried the ‘GetNewFSCAllHd’ method.
I added a ‘set field’ and set the 1st ‘specified’ to CallCode and set 2nd ‘specified’ to “RCV”.
I enabled and saved. Opened a new service call center ticket and instead of the field being blank, it said ‘None Selected’. If you click it to select, it already has the Received’ highlighted.

I then went back and changed RCV to Received, same thing.

How do I get it to already be selected in the drop down menu?

All help is appreciated.
Thanks,
Shawn

Hello,

Anybody have any ideas?

I think the issue might be that you’re running the BPM in post processing, so the field is being set after the record is created but it doesn’t trigger a save/refresh in the form. Try moving this to Base Processing and see if that works. It should get swept up in the form refresh from creating the new ticket.

From my understanding, it is not wise to replace the base processing. The manuals say that it can cause unforeseen issues because it replaces what Epicor has for the base process.

Anybody have any ideas?

I have tried the base processing and it messed up the adding of a service call. Removed it.

Tried Pre-processing, no help. Looks like it should be post processing but not sure how to get it to populate the drop down correctly.

Method Directives always struck me as overly complex for exactly these reasons. Kinda like using a sledgehammer to drive a finishing nail.

For what it’s worth, I handle defaulting fields through an In-Transaction Data Directive that sets the field on an added row rather than messing with the Method Directive at all. Are you on E10 and have you tried that route?

@jstephens,

I just tried triggering the field set from An In-Transaction data directive but when I create a new service call, it doesn’t do anything.

Don’t the in-transactions only happen on updates?

I see what you’re driving at now. Yes, the In-Transaction fires when the data is being committed. When the “New” button is clicked a temporary record is stood up but nothing is written to the database yet, so the value isn’t there. It can still be applied to new records (added rows) only, but still has to wait for the commit. You’re looking to default the form value on new record creation, not necessarily the data (the data then gets written with the commit). My misunderstanding - sorry for the wild goose chase.

I’ll keep playing with BPMs/Customizations as time permits and update when I find something.

@jstephens

Thanks! I really appreciate any time you put into it.

I have tried multiple things but can’t get it working.

If anyone else has any ideas to help us, it would be appreciated also!

Thanks,

Shawn

I played around the the BPMs a bit more and never got anything working. Switching to a form customization returned a more promising result though.

We’re not licensed for the Service Call Center, but I was able to see that the CallCode is a system retriever combobox. I used the Sales Territory on the Quote screen as a model and the example should carry through to any of these style of comboboxes.

The gist of the customization is to define a bool to indicate that you’ve set the default and then keep pushing it back to that default when the initialization tries to switch it to something else (this happens a lot while the form calls various updates). Then, when the user goes to change the value, clear that you’ve set the default so that they can keep their changes.

using System.Reflection;

public class Script
{
	bool defaultSalesTerSet = false;
	
	// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
	// Begin Wizard Added Module Level Variables **

	private EpiBaseAdapter oTrans_adapter;
	// End Wizard Added Module Level Variables **

	// Add Custom Module Level Variables Here **

	public void InitializeCustomCode()
	{
		// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
		// Begin Wizard Added Variable Initialization

		this.oTrans_adapter = ((EpiBaseAdapter)(this.csm.TransAdaptersHT["oTrans_adapter"]));
		this.oTrans_adapter.AfterAdapterMethod += new AfterAdapterMethod(this.oTrans_adapter_AfterAdapterMethod);
		// End Wizard Added Variable Initialization

		// Begin Wizard Added Custom Method Calls

		// End Wizard Added Custom Method Calls
		

		Erp.UI.Controls.Combos.SalesTerCombo salesTer = (Erp.UI.Controls.Combos.SalesTerCombo)csm.GetNativeControlReference("3f726047-a408-448d-99d5-5217f5e9612c");
		salesTer.RowSelected += new Infragistics.Win.UltraWinGrid.RowSelectedEventHandler(this.SalesTerSelected);
		salesTer.BeforeDropDown += new System.ComponentModel.CancelEventHandler(this.SalesTerBeforeDropDown);
	}

	public void DestroyCustomCode()
	{
		// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
		// Begin Wizard Added Object Disposal

		this.oTrans_adapter.AfterAdapterMethod -= new AfterAdapterMethod(this.oTrans_adapter_AfterAdapterMethod);
		this.oTrans_adapter = null;
		// End Wizard Added Object Disposal

		// Begin Custom Code Disposal

		// End Custom Code Disposal
		

		Erp.UI.Controls.Combos.SalesTerCombo salesTer = (Erp.UI.Controls.Combos.SalesTerCombo)csm.GetNativeControlReference("3f726047-a408-448d-99d5-5217f5e9612c");
		salesTer.RowSelected -= new Infragistics.Win.UltraWinGrid.RowSelectedEventHandler(this.SalesTerSelected);
		salesTer.BeforeDropDown -= new System.ComponentModel.CancelEventHandler(this.SalesTerBeforeDropDown);
	}

	private void oTrans_adapter_AfterAdapterMethod(object sender, AfterAdapterMethodArgs args)
	{
		switch (args.MethodName)
		{
			case "GetNewQuoteHed":
			{
				//get a reference to the control
				Erp.UI.Controls.Combos.SalesTerCombo salesTer = (Erp.UI.Controls.Combos.SalesTerCombo)csm.GetNativeControlReference("3f726047-a408-448d-99d5-5217f5e9612c");
				//use reflection to force retrieval of the values
				MethodInfo mi = salesTer.GetType().GetMethod("retrieveNow", BindingFlags.Instance | BindingFlags.NonPublic);
				mi.Invoke(salesTer, new object[]{true});
				//assign the default value
				salesTer.Value = "13";
				defaultSalesTerSet = true;
				break;
			}
		}

	}
	
	private void SalesTerSelected(object sender, Infragistics.Win.UltraWinGrid.RowSelectedEventArgs e)
	{
		if (defaultSalesTerSet)
		{
			//get a reference to the control
			Erp.UI.Controls.Combos.SalesTerCombo salesTer = (Erp.UI.Controls.Combos.SalesTerCombo)csm.GetNativeControlReference("3f726047-a408-448d-99d5-5217f5e9612c");
			//push the default back to our value
			salesTer.Value = "13";
		}
	}
	
	private void SalesTerBeforeDropDown(object sender, CancelEventArgs e)
	{
		defaultSalesTerSet = false;
	}
}

This is certainly not the only way to do this - just something I cobbled together.