Skip to main content
Answer

Populating custom field up on VendorID field in the Create Purchase Order (PO505000)

  • April 22, 2025
  • 9 replies
  • 162 views

Hi Community,

I’m working on a customization related to the Create Purchase Orders screen and need some guidance with vendor defaulting and updating custom fields on the POFixedDemand DAC.

Customization Details:

I’ve added the following custom fields to POFixedDemand:

  • Shipping Destination Type

  • Ship To

  • Shipping Location

Scenario:

  • In the Sales Order, we have a Configurable item (parent) and IsSupplement (child) items.

  • When creating a PO from this sales order:

    • The Vendor and VendorName on the parent (Configurable) item in the POFixedDemand should default from the child item (where IsSupplement = true). and also on Parent Item (Configurable = true)

What I’ve Tried:

  1. POFixedDemand_VendorID_FieldUpdated:

    • I added logic here to assign values to the custom UDF fields.

    • The values seem to be set in the code but do not reflect on the screen/UI.

  2. Overridden EnumerateAndPrepareFixedDemandRow delegate:

    • I tried to default the vendor here based on the child (supplement) or stock item’s default vendor.

    • Still, the Vendor field and custom fields are not updating as expected on the UI.

       

       

Questions:

  • What is the correct way to default and display values (like Vendor ID and UDFs) on POFixedDemand lines in Create Purchase Orders?

  • Should I be using a different event or place to assign these values?

Any suggestions, best practices, or code samples would be greatly appreciated!

Best answer by darylbowman

Have you tried setting the values in the RowSelecting event handler for POFixedDemand?

This is an event that runs when a row is being selected from the database (and only IF the row is selecting from the database, but POFixedDemand should be).

9 replies

Forum|alt.badge.img+1
  • Jr Varsity I
  • April 24, 2025

Is there a reason you are using fieldupdated, but trying to update all of the rows when only one of the rows’ vendor is updated? It seems like you might want to only be running this for the specific row you are on instead of looping through all of them?

 

Is the code hitting those lines where you set your usr field values, and do the soLineExt fields have value?

You could also try using setvalueext and see if that gives you any different result. Other things you could try is using field selecting if you don’t need to update the field value, or using attributes, as it looks like the source code for POFixedDemand VendorLocationID uses attributes to default the value based on the vendor, you could look at mimicking that logic if all else fails.


@josiahl64 

In our scenario, we have items in the PO Fixed Demand grid where:

  • Some items (e.g., AMDOORSH01) are configurable, and

  • These configurable items do not default the VendorID automatically.

To handle this, I wrote a FieldUpdated event handler on the VendorID field.

Here's the logic I'm implementing:

  • When a VendorID and Vendor Location are selected on one of the lines with the same UsrParentLineNbr,

  • The system should automatically apply the same VendorID and Location to all other lines that share the same UsrParentLineNbr.

  • In addition, we also want to default:

    • ShipTo

    • Shipping Location

    • Shipping Destination Type (this should be "Vendor" by default)

      using the FieldUpdate event its only defaults on the selected line.


Forum|alt.badge.img+1
  • Jr Varsity I
  • May 5, 2025

@josiahl64 

In our scenario, we have items in the PO Fixed Demand grid where:

  • Some items (e.g., AMDOORSH01) are configurable, and

  • These configurable items do not default the VendorID automatically.

To handle this, I wrote a FieldUpdated event handler on the VendorID field.

Here's the logic I'm implementing:

  • When a VendorID and Vendor Location are selected on one of the lines with the same UsrParentLineNbr,

  • The system should automatically apply the same VendorID and Location to all other lines that share the same UsrParentLineNbr.

  • In addition, we also want to default:

    • ShipTo

    • Shipping Location

    • Shipping Destination Type (this should be "Vendor" by default)

      using the FieldUpdate event its only defaults on the selected line.

I don’t see in the code you originally shared where you are updating the other vendor/locations for the other lines, but if you are indeed doing that, it sounds like you could potentially have an infinite loop if you don’t have the correct conditions, and that could be why it isn’t updating as expected.

Have you gone in to debug and verify that it is indeed looping through and finding each line?

 


Hi ​@josiahl64  User will select the VendorID  for the configurable Item so, that it should default Vendor Name and  Location in the code line 331 i  have set if condition Usrconfigurable = true. In the method updateudf() i have checked parentlinenbr and Issupplemental  = true at line 357 then its defaulting the VendorId and Vendor Location to Shipto and ShiptoLocation. The debugger was attach an defaulting on values in the above screen shot but its not updating in the View FixedDemand. If i write on the rowselected then its only defaults on the selected line.There was a mistake above i was not trying to default 
 

There was a mistake here “The System should automatically apply the same VendorID and Location to all Other lines that share the same UsrParentLineNbr” meaning VendorID and Location of the configurable item should default on the Shipto and ShiptoLocation which has same ParentLineNbr.


DipakNilkanth
Pro III
Forum|alt.badge.img+13

Hi ​@HarikanthMantri,

Have you checked below forum?


Hope, it helps!


@Nilkanth Dipak  Thank you for looking at the issue. yes i have checked the forum but that is different from what actually im facing the issue.

 


darylbowman
Captain II
Forum|alt.badge.img+15
  • Answer
  • May 14, 2025

Have you tried setting the values in the RowSelecting event handler for POFixedDemand?

This is an event that runs when a row is being selected from the database (and only IF the row is selecting from the database, but POFixedDemand should be).


@darylbowman Yes, i have tried in the RowSelected event that doesn’t works.


darylbowman
Captain II
Forum|alt.badge.img+15

...RowSelecting event...

​...RowSelected event…

Not the same