Forum Stats

  • 3,871,980 Users
  • 2,266,360 Discussions
  • 7,911,018 Comments

Discussions

How to reference the column of an interactive grid while using in a dynamic action (set Value)

User_Q16K1
User_Q16K1 Member Posts: 4 Green Ribbon

Hello Apex Friends,

I am working on master details form,

in details level I'm using IG and there is one column which is set as select list ( example: account_id and account_code)

now, I'm trying to display account_name in forms field

😊 First Try:

JavaScript with IG change row event :

this JS show [object object] and when i tried it without select list field, it works

JS code as following

--------------------------------------------------------------------------------------------

var v_acc_desc;

var v_factorcode

model=this.data.model;

if(this.data != null){

  if(this.data.selectedRecords[0] != null){

    v_acc_desc = model.getValue(this.data.selectedRecords[0],"ACCOUNT_ID");

    v_factorcode = model.getValue(this.data.selectedRecords[0],"FACTOR_ID");

  }}

apex.item("P104_ACC_DESC").setValue(v_acc_desc);

apex.item("P104_FACTOR_DESC").setValue(v_factorcode);

-------------------------------------------------------------------------------------

2nd Try🤨

set value Dynamic action but no luck

SELECT ACCOUNT_NAME FROM GL_ACCOUNTS_HEADER WHERE ACCOUNT_ID = :ACCOUNT_ID

here account_id is IG column

--------------------------------------------------------------------------------------


Tagged:

Best Answer

  • Hamza Al-abbasi
    Hamza Al-abbasi Member Posts: 770 Bronze Crown
    edited Jan 25, 2022 12:53PM Answer ✓

    Hi User,

    this JS show [object object] and when i tried it without select list field, it works

    The select list is an object contained a display value and return value, to get display value :

    model.getValue(this.data.selectedRecords[0],"ACCOUNT_ID")['d']
    

    To get return value:

    model.getValue(this.data.selectedRecords[0],"ACCOUNT_ID")['v']
    
    User_Q16K1

Answers