Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Dynamics GP tables cache not cleared after company switch

Posted on by 515

I have two company database with 'TWO' and 'THREE'. In each company database I have added a table (lets say 'ABC') which hold some customised company config values.

The problem is when I switch from one company to another company I am getting records from table of first company database. If I switch from company TWO to THREE and tried to read my ABC table, found that get first table command executed against first company database 'TWO'. 

I am not getting why GP execute query for previously logged in company database instead of current logged in company?

*This post is locked for comments

  • soma Profile Picture
    soma 24,406 on at
    RE: Dynamics GP tables cache not cleared after company switch

    Technically its a good findings. Keep it up.. Good luck.......

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Dynamics GP tables cache not cleared after company switch

    Good to hear that your problem is solved.

  • Verified answer
    ram shenkar Profile Picture
    ram shenkar 515 on at
    RE: Dynamics GP tables cache not cleared after company switch

    Thanks all of you for your reply.

    I got solution here, I am having a hidden form and same table was copied on that form. That hidden form is always open that why the related table also always connected with sql.  I close that form before user change company and it works. 

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Dynamics GP tables cache not cleared after company switch

    We can only give suggestions based on your inputs. Have you tried debugging your code? If not, I would recommend you to try the methods below.

    Debug your code by Dexterity >>Test mode

    or by copying the extracted dictionary to the GP folder and add this script"ScriptDebugger= TRUE" in the Dex.ini file in the GP installed >>Data folder and start debugging your code and definitely you can able to find the problem and fix it.

    Note: Before changing the dex.ini file take a back up.

  • soma Profile Picture
    soma 24,406 on at
    RE: Dynamics GP tables cache not cleared after company switch

    Can you share the trigger registration script?

  • ram shenkar Profile Picture
    ram shenkar 515 on at
    RE: Dynamics GP tables cache not cleared after company switch

    Manjunath

    I don't have company ID field in my table. Do you mean to say 'Intercompany ID' of Dynamics GP?

  • ram shenkar Profile Picture
    ram shenkar 515 on at
    RE: Dynamics GP tables cache not cleared after company switch

    This script already written after add successful login record of GP. Do you want me to change trigger?

    And one more update this happens only with my one table rest of the tables are working fine.

  • Suggested answer
    Manjunath Vemula Profile Picture
    Manjunath Vemula 1,195 on at
    RE: Dynamics GP tables cache not cleared after company switch

    You can use the Company ID field by setting the value and then do get first. This can get you results for that company.

    Hope this helps.

  • Suggested answer
    soma Profile Picture
    soma 24,406 on at
    RE: Dynamics GP tables cache not cleared after company switch

    Hope you have written above script on some trigger functions. If so, check the trigger and change registration to After/before switch company then try again.

    Hope this helps!!!

  • ram shenkar Profile Picture
    ram shenkar 515 on at
    RE: Dynamics GP tables cache not cleared after company switch

    Hi Shan,

    Both tables from different companies contain different records.

    dex code to get record from table (only one record in both tables) -

    release table ABC;

    clear table ABC;

    range clear table ABC;

    get first table ABC;

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans