Hi,
I have some fields which to be displayed for one vendor and some fields to another vendor. Is there any way to do that??
I mean when one vendor got detected it should show some specific fields and when another vendor detected it should show other fields..
Comments
1 comment
Hi Sunil,
You can do this. Maybe the easiest solution would be to:
1. Create two groups (Vendor1 and Vendor2 in my example); add fields to groups
2. Create new rule on Vendor (severity: warning, apply: always)
3. Add following code:
string vendorId = Context.Field("VendorId").Text;
if(vendorId == "123")
{
Context.Field("Vendor1").IsVisible = false;
Context.Field("Vendor2").IsVisible = true;
}
else if(vendorId == "456")
{
Context.Field("Vendor1").IsVisible = true;
Context.Field("Vendor2").IsVisible = false;
}
else
{
Context.Field("Vendor1").IsVisible = true;
Context.Field("Vendor2").IsVisible = true;
}
Better solution is to check against Vendors dataset, instead of changing code every time when new vendor is added. I mean to add new column "VendorGroup" to Vendors table, for example add values "1,2 or 3" for all vendors, where value 1 would show only group 1, value 2 would show only group 2 and value 3 would show or hide both groups.
First question, do you need to recognize those fields you want to show/hide?
Best regards,
Vladimir
Please sign in to leave a comment.