コミュニティ

Regarding visibility of fields

 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..

 

この記事は役に立ちましたか?

0人中0人がこの記事が役に立ったと言っています

コメント

1件のコメント

  • Avatar
    Vladimir Dimitrijević

    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

    0

サインインしてコメントを残してください。