web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Error: A transaction must be started before changes can be made to the database.

(0) ShareShare
ReportReport
Posted on by

I am using PHP for web services. While requesting for the customer prices page, I am getting following response.

A transaction must be started before changes can be made to the database.

My PHP code as follows

public function getPriceList($customer_number){
    $url = 'Page/CustomerPrices';
    try {
        $response = new \stdClass();
        $response->status = false;
        $options = [
          'soap_version' => SOAP_1_1,
          'connection_timeout' => 120,
          'login' => env('MICROSOFT_DYNAMICS_NAV_USERNAME', ''),
          'password' => env('MICROSOFT_DYNAMICS_NAV_PASSWORD', ''),
          'exceptions' => true,
        ];
        $soapWsdl = env('MICROSOFT_DYNAMICS_NAV_URI', '').$url;
        $client = new SoapClient($soapWsdl, $options);
        $response->data = $client->ReadMultiple(['filter'=> [],'Start_Date' => "30-05-2018",'Cust_No'=>$customer_number,'Name'=>'Testing','Price_Comments'=>'','setSize'=>'1']);
        $response->status = true;

    }catch (SoapFault $e) {
        $response->data = $e->getMessage();
    }
    return $response;
}


*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    This error normally occours when you have placed code on the wrong NAV trigger. Is the CustomerPrices page the standard NAV page or do you have customizations?

  • Community Member Profile Picture
    on at

    Yes, it is a customized page.

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    Check the triggers on that page. Do you have something that updates the records?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans