Configurator - Context fields via Config Rules

Hi all,

Has anyone else had trouble accessing context data through Configurator Rules? We have a particular customer who wants one component left off one of our regular products. Logic tells me to put this in the Keep When rules against the part in our MoM. Trouble being, when I try to access CustomerID or CustomerNumber the rules return an empty string and 0, respectively. It does the same for OrderNumber, OrderLineNumber, JobNumber…

Do others experience the same thing or am I missing something? If this is common, does anyone have a workaround?

Cheers!

I have a hidden page where I programmatically request and hold data to pass where I need it.

image001.jpg

We use LINQ statements in configurator user defined methods to retrieve information like this.

1 Like

That sounds like a reasonable solution. I already have a hidden page where I store other info, I’ll have a go adding some context data there for retrieval in the methods. Thanks Brenda.

We use LINQ statements in configurator user defined methods to retrieve information like this.

Thanks for the idea. I’ve tried this but I can’t call an order number through context either so I haven’t been able to work out how to get what I need through LINQ. I admit my LINQ isn’t brilliant though. Are you able to provide an example of finding a customer number in LINQ through a method rule?

I will get back to you on this, I believe we have something.

That’d be great. Thank you.

It seems like you already have a solution or at least a way forward, but I am able to successfully call and get the customer number in a server side method with the following code.

int customer = Context.CustomerNumber > 0 ? Context.CustomerNumber : 1;

I have it default to one if there isn’t a customer so that I don’t generate an error when I am doing things like testing inputs when there isn’t a customer, etc.