0

The script don't work

" Variable 'Categories_>' is n:1 relationship ";
let catg := 'Categories_>';
let rate := (select Categories where Category = catg).Rate;
'Rate by Categ' = rate

I try once choose the 'Categories_>' automatically give me the rate on the field 'Rate by Categ'.

I place the script in trigger After Update.

6 replies

null
    • John_Halls
    • 2 wk ago
    • Reported - view

    Hi  You need to add a first() function in your select statement to return a record rather than an array

    let rate := first(select Categories where Category = catg).Rate;
    

    Regards John

      • Rafael Sanchis
      • Rafael_Sanchis
      • 2 wk ago
      • Reported - view

       

      Hi John Thanks, no work, the 'Categories_>' is a N:1 Relationship , and I'm on Table  'Hours by Resources'.

      Need when select the Category on 'Categories_>' give me the rate on the field 'Rate by Categ'

    • John_Halls
    • 2 wk ago
    • Reported - view

    Also need

    'Rate by Categ' = rate

    to be

    'Rate by Categ' := rate
      • Rafael Sanchis
      • Rafael_Sanchis
      • 2 wk ago
      • Reported - view

       

      Hi John Somethimg I'm doing bad.

    • John_Halls
    • 2 wk ago
    • Reported - view

    If I am understanding this correctly and Categories is the table and Categories_> is the relationship you can just use

    Categories_>.Rate

    Either assign this to Rate by Categ or use is as is and don't use Categ at all and then you won't need a trigger.

    I like your _> and <_ notation by the way!

    Regards John

      • Rafael Sanchis
      • Rafael_Sanchis
      • 2 wk ago
      • Reported - view

       

      Hi John Yes I use the _> to N:1 Relationship and <_ for 1:N Relationship. Can visualize the type relationship, don't know if the besr wat

Content aside

  • 2 wk agoLast active
  • 6Replies
  • 38Views
  • 2 Following