I was trying to do percentage calculation for "baseamount" in orderproduct entity, for that i create one custom field (single line text) add give the value:
eg: (i) if custome field value is 4 means.i want to calculate: baseamount*4/100;
(i) if custome field value is 5 means.i want to calculate : baseamount*5/100;
for this i did the following steps,
(i) Create the plugin
(ii) Add a step->update salesorderdetail->field->baseamount
but,the problem is,the entity does not contain my custom attribute,if i register my plugin in create means i can get my field but in this case i get the baseamount value is 0.
so, how can i get the custom filed while baseamount updated using plugin......
Plugin entity object only contains the values for the dpdated fields. If you custom attribute is not being updated on a form then you will not get the same.
you can an attribute to the property bag of entity object like entity.attributes.add("your attribute schema name"), set the appropriate value and update the record.
You can keep it registered on update step and can use the pre image of orderproduct entity.
Thanks, Ankit Shah