Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

hmm, ich wies nicht obs hier wirklich richtig ist.

Ich hab nen MS Dynamics AX 4.0 auf MS-SQL 2005

und will nun folgendes erreichen.

In Tabelle B2B_Potentials sind für Kunden das zu einer ItemGroup gehörende Potential vermerkt.

Also so in der Art:

BusRelAccount | ItemGroupID | Potential

000001 | 1749 | 5000

000001 | 1536 | 1000

000002 | 1536 | 5000

Nun bräuchte ich eine Funktion die für alle nicht aufgeführten Kombinationen Kunde - ItemGroup das Potential 0,01 einträgt.

Ich habe den folgenden Code mal geschrieben:

static void STUFillB2BPotentials(Args _args)

{

    B2B_Potentials  B2B_Potentials;

    smmBusRelTable  smmBusRelTable;

    InventItemGroup InventItemGroup;


    ttsbegin;


    while select forupdate B2B_Potentials

    {

        while select * from smmBusRelTable

        {

            while select * from InventItemGroup

            {

                if (InventItemGroup.ItemGroupId != '9999' && InventItemGroup.ItemGroupId != '1899' && InventItemGroup.ItemGroupId != '1799')

                {

                    if ( B2B_Potentials.smmBusRelAccount == smmBusRelTable.BusRelAccount && B2B_Potentials.ItemGroupId == InventItemGroup.ItemGroupId)

                    {

                        info (strfmt("gefunden %1 - %2", smmBusRelTable.BusRelAccount, B2B_Potentials.ItemGroupId));

                        print (strfmt("gefunden %1 - %2", smmBusRelTable.BusRelAccount, B2B_Potentials.ItemGroupId));

                    }

                    print (strfmt("%1 - %2", smmBusRelTable.BusRelAccount, B2B_Potentials.ItemGroupId));

                }

            }

        }

    }


    ttscommit;

}

Der soll mit erstmal ja nur die ausgeben die schon enthalten sind.

wenn das richtig klappt würde ich beim innersten if die == durch != ersetzen und die zuweisungen der Felder mit einbauen.

Ich habe nun das Problem.

Das er mit nie alle findet die bereits in der B2B_Potentials enthalten sind.

Irgendeiner ne Idee was ich falsch mache?

  • Autor

args.

manchmal ists ja so einfach.

static void STUFillB2BPotentials(Args _args)

{

    B2B_Potentials  B2B_Potentials;

    smmBusRelTable  smmBusRelTable;

    InventItemGroup InventItemGroup;


    ttsbegin;


        while select * from smmBusRelTable

        {

            while select * from InventItemGroup

            {

                if (InventItemGroup.ItemGroupId != '9999' && InventItemGroup.ItemGroupId != '1899' && InventItemGroup.ItemGroupId != '1799')

                {

                   while select forupdate B2B_Potentials

                   {

                    if ( B2B_Potentials.smmBusRelAccount == smmBusRelTable.BusRelAccount && B2B_Potentials.ItemGroupId == InventItemGroup.ItemGroupId)

                    {

                        info (strfmt("gefunden %1 - %2", smmBusRelTable.BusRelAccount, B2B_Potentials.ItemGroupId));

                        print (strfmt("gefunden %1 - %2", smmBusRelTable.BusRelAccount, B2B_Potentials.ItemGroupId));

                    }

                    print (strfmt("%1 - %2", smmBusRelTable.BusRelAccount, B2B_Potentials.ItemGroupId));

                }

            }

        }

    }


    ttscommit;

}

das while select forupdate muss in die innerste schleife. :upps

klar ansonsten geht er ja für jeden gefundenen treffer in der B2B_Potentials alle Kunden und ItemGroups durch.

*in Tischkante beis*

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.