Domanda

I have two columns called "C_BPartner_ID" and "displayname" in my table. I want to make read only "displayname" column when "C_BPartner.name"='test'

The problem is I do not know how to make read only this field in adempiere. I added following sql query into readonly logic field in table & column.

@SQL=(SELECT C_BPartner.C_BPartner_ID  FROM C_BPartner WHERE C_BPartner.name='test')=@C_BPartner_ID@

I think using "Column SQL" we can make field read only. I tried out to do that also.. But it also didn't work for me.

This is not working..... Can anybody please help me... thanks..

È stato utile?

Soluzione

Inner join doesnt work, Lets do one thing add C_BPartner_ID.Name (like hiddenfield) in your table and try to use it

Altri suggerimenti

Assuming your metadata in ADempiere's Application Dictionary (AD) table is C_BPartner, the correct usage ought to be a boolean evaluation:

@Name@='test'

The content here is parsed by the AD engine as stated in the APIdoc of the code for ReadOnlyLogic (GridTab.isReadOnly() - Boolean evaluateLogic):

 *  Evaluate Logic.
 *  <code>
 *  format      := <expression> [<logic> <expression>]
 *  expression  := @<context>@<exLogic><value>
 *  logic       := <|> | <&>
 *  exLogic     := <=> | <!> | <^> | <<> | <>>
 *
 *  context     := any global or window context
 *  value       := strings can be with ' or "
 *  logic operators := AND or OR with the prevoius result from left to right
 *
 *  Example '@AD_Table@=Test | @Language@=GERGER
 *  </code>
 *  @param source class implementing get_ValueAsString(variable)
 *  @param logic logic string
 *  @return logic result
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top