Jump to content

Populate PO Invoice detail line with a with a related object field


 Share

Recommended Posts

I'm trying to create a Smart Event, that will populate a  custom field on the line detail with a field from a related object.

For example:

I have a custom field on my detail line called STAT ACCOUNT.  I want this field to be populated by a STAT ACCOUNT assigned to an Item. 

I can't figure out the API that would do this.

Link to comment
Share on other sites

  • Members

Got it.

Object Type: Po Transaction Detail
Transaction Definition: <Select proper TD>
Action: API
Events: Add+Set
Condition: ("{!PODOCUMENTENTRY.STAT_ACCOUNT!}" != "{!PODOCUMENTENTRY.ITEM.STAT_ACCOUNT!}")
API:
<update>
  <PODOCUMENTENTRY>
    <RECORDNO>{!PODOCUMENTENTRY.RECORDNO!}</RECORDNO>
    <STAT_ACCOUNT>{!PODOCUMENTENTRY.ITEM.STAT_ACCOUNT!}</STAT_ACCOUNT>
  </PODOCUMENTENTRY>
</update>
Synchronous Smart Event = true
name: UPDATE_PO_LINE

Link to comment
Share on other sites

  • Members

In this case it would not work because there is a current limitation with platform triggers and nexus path relationships like this:
{!PODOCUMENTENTRY.ITEM.STAT_ACCOUNT!}

Engineering has this on their roadmap to resolve but in order to solve this requirement today you would have to use smart events.

Link to comment
Share on other sites

Do Triggers fire off before Smart Events?  The reason I am asking because I created a trigger to create a  stats entry that posts to an associated stats account for the item.  The other option would be to have the ITEM ID be the STAT account.  Any thoughts?

Link to comment
Share on other sites

On 6/28/2024 at 4:07 PM, Jozef Pietruniak said:

Do Triggers fire off before Smart Events?  The reason I am asking because I created a trigger to create a  stats entry that posts to an associated stats account for the item.  The other option would be to have the ITEM ID be the STAT account.  Any thoughts?

Triggers fire immediately. Smart Events are pushed to the Smart Events queue for processing. The queue time is anywhere between almost immediately and around 9 minutes. This time can be affected by current system load.

Link to comment
Share on other sites

22 hours ago, Sterio, Louis said:

@Lee Savidge This is true unless you "tick" the synchronous checkbox within the smart event properties. This will ensure the smart event executes within the context of the save/real time.

I recall a tick box that said synchronous or asynchronous but checking just now, I can't find that tick box any more. There is one on triggers for running offline which puts the trigger into a queue type thing like smart events (at least I think it does).

 

On a side note, I have never figured out the point of the timeout field on the smart event, but more to the point, the tick box you mentioned, no longer appears to be there.

Link to comment
Share on other sites

Posted (edited)
5 hours ago, Sterio, Louis said:

This only shows up for API type of smart events not any other type.

Hi @Sterio, Louis

You're right. the field is only available if you choose API type as the action for the smart event. It doesn't exist for the other types.

Edited by Lee Savidge
Link to comment
Share on other sites

 Share

×
×
  • Create New...