Quote Line BPM Help


(Aaron Willett) #1

I’m trying to create a BPM that prevents a user from changing a part number on a quote line.
Once the line is created and established, we’d prefer them to delete the line and create a new one instead of changing the part for various business reasons.

I’m having troubles achieving that result.
Through a trace, I see that it’s using ChangePartNumMaster and ChangePartNum. Some scenarios only one gets called while other scenarios, they both get called. Trying to get something to block changing the part on those has been difficult as somethings still change like an update is being done within those methods.

Here’s an instance where both are called and then one is called:

  1. Find a quote with an existing line
  2. Change the part number (ChangePartNumMaster and ChangePartNum gets called)
  3. Block message comes up (Set on ChangePartNumMaster)
  4. Click OK to the message
  5. Immediately change the part number again
  6. Block message does not come up (Only ChangePartNum gets called)

If I put the block on ChangePartNum, fields change, such as pricing, before the block comes up and even if I hit okay through the message, I can still hit save and it will take it. If I put it only on ChangePartNumMaster, the numbered scenario above will allow the user to still change the part.
If I put it on Update, then I can truly block the change at the very end, but fields visually change in the interim. Breaks get refreshed if they choose to do so, pricing for the new part pulls in, etc. I’m worried that if I do this, the user will waste time updating things before saving only to be hit with block message and have to start over, but maybe that’s the price they pay for not following our process?

Anyone have a more elegant solution to this?


(Jose C Gomez) #2

I would put a stop at a Data Directive level (if PartNUm changed from any to another and there is an Updated Row)
And yes the User will waste time but like you said if they are not following procedure you have to pay up
You could do it also in a customization on Before Field change but BPM would be the sure fire way to go


(Aaron Willett) #3

I tried the data directive as you described, but it does not work as planned.
Especially when it comes to kits. I can change the part and a message will show up that says “If you change the parent, the kits will be deleted”. You can then hit “Yes” to that message which removes the kit components. THEN the block message comes up after they have all been deleted.


(Jose C Gomez) #4

AH Kits! Yup Kits are a nightmare… Then maybe a Before Field Change on a Customization may be your best bet. It has the nice feature of being able to be 'Canceled" gracefully


(Aaron Willett) #5

Tell me about it…

I’ll give the BeforeChange a shot and report back.


(Pierre Hogue) #6

Jose,

you mention about a gracefully way to cancel…I did not see a args.Cancel available as a textbox would have…
What is you method?
I tought of the following: args.Proposed value = args.Row[“fieldName”].ToString()…(put back the original value… )
thanks


(Aaron Willett) #7

It’s a little buggy, but this is what I was working with; you had the same thought as I did.

private void QuoteDtl_BeforeFieldChange(object sender, DataColumnChangeEventArgs args)
{
	// ** Argument Properties and Uses **
	// args.Row["FieldName"]
	// args.Column, args.ProposedValue, args.Row
	// Add Event Handler Code
	switch (args.Column.ColumnName)
	{
		case "PartNum":
			MessageBox.Show("Part Change is not allowed, Holmes!", "Part Change Warning", MessageBoxButtons.OK, MessageBoxIcon.Error);
			args.ProposedValue = args.Row["PartNum"];
			break;
		default:
			break;
	}
}