Skip to main content

Good day,

I am developing a customization to make the selection of a Contact field required on both the Opportunity and Quote.  I know how to make the field required using the customizations.  However, I am concerned on how it could affect the workflow. Adding quotes, processing, action areas, etc.

For example; Opportunity/Quotes.  Are their any issues or problems that could arise.  Management wants sales reps to have contacts on all their opportunities and quotes.  We also have an Approval process for large quotes. Since the documents are interconnected, 

  1.  Should the customization be separate or together?
  2. I don’t want to slow down the Sales process; however it does present some issues with sales
  3. Approval process? issues
  4. Actions being affected; Convert to Order, etc.

Does anyone have a better suggestion?  Or a better way to go?

Thank you.

Hi @grillevan 

 

You could use the ePXDefault] attribute this would make the field required and throw an error when you try to save with the field not being populated.

 

This shouldn’t cause any real issues with workflows, except for enforcing the need for a contact.

 

You can add this in a CacheAttached event:

hPXMergeAttributes(MergeMethod = PXMergeMethod.Append)]
protected virtual void _(Events.CacheAttached<YourDAC.yourField> e) {}

Alternatively, I think you could add to the PXUIFieldAttribute, either through the CacheAttached or RowSelected handler.

Cache Attached:

hPXMergeMethod(Method = MergeMethod.Merge)]
protected virtual void _(Events.CacheAttached<YourDAC.yourField> e) {}

RowSelected:

protected virtual void _(Events.RowSelected<YourDAC> e, PXRowSelected b)
{
YourDAC row = e.Row;

b?.Invoke(e.Cache, e.Args);

PXUIFieldAttribute.SetRequired<YourDAC.yourField>(e.Cache, true);
}

Hope this helps.

Aleks


I believe the most significant discomfort you would experience would be just after ‘go-live’, as every Opp and Quote not having a contact would require one before changes could be saved.

Unless you are creating either entity automatically, it should present fine to the user and allow for selection.


@aiwan 

I appreciate the code; it is a little above my pay grade.  I am not on the developer level yet.

 

I am basically going to publish a Project Customization that makes the ContactID required on the opportunity/quote form.

@darylbowman Much appreciated.


Reply