1

Am trying to fetch company name while am dealing with a cross company task.

I used the following code to get the company name which has the current comapny as invoice company.

 CrossCompanyPostingRules    crossCompanyPostingRulesLoc;
    int i;
    Container Comp;
    dataArea dataArea1;
    companyID company;
;


company = curExt();

    while select dataArea1  where dataArea1.id != curExt()
    {
        comp += [dataArea1.id];
    }

    for(i=1;i<=conlen(comp);i++)
    {
       com = conpeek(comp,i);
       element.company(com,company);
    }

void company(companyID name,companyID company)
{
      CompanyName companyNameLoc;
       LedgerEmSysParameters_EMS    ledgerEmSysParameters_EMSLoc;
      ;

      changeCompany(name)
      {
      select ledgerEmSysParameters_EMSLoc;
      if(ledgerEmSysParameters_EMSLoc.Invoicecompany == company)
          {
            changecompany(company)
            {
                companyNameLoc.Name = name;
                companyNameLoc.insert();
            }
          }

      }

}

in the above code am storing it in a table but i need not want to use table. Rather than that i need to use companyInfo table and filter out the records into the lookup.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Raavi
  • 11
  • 1

1 Answers1

1

I would expect you to be able to do something like this:

select crosscompany DataAreaId, InvoiceCompany from ledgerEmSysParameters_EMSLoc
    group by DataAreaId, InvoiceCompany
    where ledgerEmSysParameters_EMSLoc.DataAreaId       != curExt()
       && ledgerEmSysParameters_EMSLoc.InvoiceCompany   == curExt();

Only do it in a query and create a lookup form if needed.

10p
  • 5,488
  • 22
  • 30