cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Extension Field in selectionParams

0 Kudos
882

Hello Experts,

I've added the extension field ExoToBeSentViaEDI:Indicator to PurchaseOrder object using SDK. I activated the change in ExtPurchaseOrder.xbo object.

Now I would like to be able to query the PurchaseOrder using my new field: ExoToBeSentViaEDI. Unfortunately, the new extension field doesn't show up in the list of available objects which give the possibility to limit the query results:

var query = PurchaseOrder.QueryByElements;

var selectionParams = query.CreateSelectionParams();

selectionParams.Add(query. after ctrl+space I've expected to see my extension field here

,"I","EQ","true");

Do you know what I'm doing wrong?

Or maybe it is just not possible to achieve?

Best Regards

Piotr Kowalski

View Entire Topic
0 Kudos

Fred, thank you very much again 🙂

It works indeed.

If you could take a look at one more thing.

Why changing the value of the extended field in ABSL doesn't take effect:

var query = PurchaseOrder.QueryByElements;

var selectionParams = query.CreateSelectionParams();

selectionParams.Add(query.ExoToBeSentViaEDI_BHQ7O8J0U6CKCS20MCR06HO3R,"I","EQ",true);

var resultData = query.Execute(selectionParams);


foreach(var po in resultData){

// the first way I've tried:

po.ExoToBeSentViaEDI = false;

// the second way I've tried:

PurchaseOrder.Retrieve(po.UUID).ExoToBeSentViaEDI = false;

}

Both ways don't make any effect. It means, that the extension field ExoToBeSentViaEDI doesn't change, it still stays as True.

As a complementary information here is how I set the field to True:

I've created BO extension and in Event-BeforeSave event, I've added this code:

import ABSL;

this.ExoToBeSentViaEDI = true;

It just changes the value of ExoToBeSentViaEDI extension field to True whenever the user changes something in the PurchaseOrder.

Is it the possibility to add something like commit/save command for the changes to take effect?