Skip to main content

Hi All,

I wanted to add a condition to specific Object to set the specific document classes for different Company Ids. I have used ,Object Condition  as - COMPANY_ID='XXX' and set up the condition. It worked as expected.

What are different methods we use to add conditions on Document default for object? 

  In online documentation different methods are described, but no idea how to use those in different situations.

Online Documentation

I also read that it is possible to implement rules on the ‘Key Ref’ as well. Anyone has experience on setting up conditions like this.  

 

Thanks & Best Regards,

Nipun

If Company is one of the keys for the object, you can simply provide an expression in the Key Ref column, and not use the Object Condition:

COMPANY_ID=123^%

Or, you can use a rule that uses #COMPANY_ID# (as I remember it) as the class itself, or part of the class.

What did you try up to now?

 


Hi Mathias,

I have tried to use #COMPANY_ID# = 123% but that didn’t work for me. I have doubt that it should be #company# or #company_ID# . In online documentation those things are not stated clearly. Confused when creating the correct condition. In my scenario I need to add a condition to ‘Absence’ window. I think in that window we can’t use key ref as company. 

 

Nipun


This is where the global placeholders such as #SITE# and #COMPANY# is explained (from the Document Defaults per Object documentation):

Global variable placeholders

Optionally, in the Key RefObject Condition and Document Class fields, global variable placeholders can be used. A global variable placeholder has the following format: #NAME#, where NAME is the name of the global variable. Currently the names SITE and COMPANY are supported and they stand for the user's default site as well as his default company.

Example: If you input #SITE# anywhere in the Document Class field, it will be replaced by the value of the user's default site before the final default value of the document class is set. It can be combined with normal text, so an expression like SPEC#SITE# will be evaluated to SPEC70 if the user's default site is 70 . Company works in the same way. Multiple global variable placeholders can be combined, if needed.

Let me know if there is something above that I can clarify. Above, it should be clear that we support SITE and COMPANY. I made a mistake in my earlier reply when I wrote #COMPANY_ID#.

 


Where in the Absence window do you want to attach documents? The header? Some of the tabs (which one)? It’s extremely important that you find the correct LU to be used.

 


I tried adding a rule for the header in the Absence form. Seems to work well and it works like the documentation describes (it replaces the “#COMPANY#” with the company of the logged in user).

Watch this recording:

https://youtu.be/jCPrndiQU2Y

@Yasas Kasthuriarachchi 

 


Hi again,

I tested some more and used #COMPANY# in the Object Condition field. It did not work, so there seems to be a bug here. We have forgotten to replace the global placeholder with its value. If you are working with a customer on this, perhaps you can report this?

In the meantime, you can use the other technique if the company ID is part of the document class.

/Mathias

 


Hi Mathias,

Yes true, Placeholder #COMPANY# didn’t work as expected. Although documentation details weren’t clear, That’s why this conversation was created. I could be able to sort out customer issue with Object condition column. We set a specific company id on that column, and that was the customer requirement. Thank you very much for your help!

 

/Nipun


Hi Nipun,

Great that you solved the issue!

If you have some ideas on how to make the documentation clearer, don’t hesitate to come with suggestions. Apart from that, it does not work as it should 🙂, right now, I think the text is correct. But perhaps it is hard to understand?

/Mathias