Constraint turn off uvm_do_with

In reply to chr_sue:

In reply to UVM_learner6:
In you body task of your sequence you have to create a handle/object of the seq_item.
In the next step you can switch off all conatraints in the seq_item by calling
<seq_item_object>. constraint_mode(0);
If the object name is req it would be reg.constraint_mode(0);
If you want to switch off only a specific constaring you can call:
<seq_item_object>.<constraint_name>.constraint_mode(0);

I created an obj of the SI and then turned off the specific constraint.
This did not work, if I do this to turn off constraint before using uvm_do_with, it says “null object access”