Search 800 + Posts

May 6, 2009

Copy Order fail to copy Context Senstive DFF with Synchronize with reference Field checked

Recently I came across one of my customer who has requirement to Copy the Descriptive flex field on Order Header when creates a order by Action >Copy.
Sound very easy to me , but this specific requirement was not that easy as it sounds.Reason? let me explain.

customer has context sensitive Order Header DFF with the following context
  1. EDI
  2. Online
  3. PkMS etc
and he want to maintain the follwing setup
  1. Reference Fields = ORDER_SOURCE
  2. Synchronize with reference Field = Checked
DFF Setup

Context Attributes

Global Attributes

as per them SETUP step 2 us a MUST for Importing Orders from different Sources and he was not willing to change it.(well ct. is King)
There was nothing wrong with the above setup , but when he copied the Order , the new copied order has values for the Global Attributes , but all the DFF attributes that were based on the Context appears NULL. Isn't that Strange , but no that not.

After doing copy order I have executed query on OE_ORDER_HEADERS_ALL ,and I have found that though the values appear NULL in DFF in Context sensitive DFF attributes , but these attributes has values in database fields.

On further Investigation I have found that , When we creates new order by Copying the existing Order (in my example existing order is Manul Order with ORDER SOURCE colum = "Online") system will Copy all the DFF Values to the newly created Order
In copied order
Context = "Online"
Attribute3 = Copied value from Old Order
Attribute4 = Copied value from Old Order
I have verified that after doing a simple backend query on OE_ORDER_HEADERS_ALL table.

But interestingly , if I open the Order Header DFF of newly copied Order , due to DFF
Set up "Synchronize with reference Field in DFF " , system will copy the ORDER_SOURCE (in this case it is "Copy" ) to the "Context" column of the DFF , and that results in NULL Values apppear for the Context senstive attribute Attribute3 and Attribute4 ( these attributes has value copied from the Original Order with Context = "Online") .Now If user press the Save button in DFF
Context = "Copy"
Attribute3 = NULL

Attribute4 = NULL
will be save in OE_ORDER_HEADERS_ALL table.

And this is very much the expected Behavious with the Setup "Synchronize with reference Field".Now If customer want to copy the values while doing the copy Order , he need to UNCHECK the "Synchronize with reference Field", But if that is not possible they need to do the Customization by means of
  1. Database Trigger
  2. Form Personalization.
NOTE - In My Example Attribute1 &2 are Global Attribute and Attribute3&4 are Context senstive Attribute.

Blogged with the Flock Browser

No comments:

Post a Comment