Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

REQUESTSHIPDATE IN Dynamics GP

(0) ShareShare
ReportReport
Posted on by 180

Hi All,

Can i add the Date to the REQUESTSHIPDATE in Sales order Window console at Order  line item level through econnect (C# code). when i pass the Date to that field ,eConnect throws an exception as below "The INSERT statement conflicted with the CHECK constraint "CK__SOP10200__ReqShi__763775D2". The conflict occurred in database "TEST", table "dbo.SOP10200", column 'ReqShipDate'.
The statement has been terminated

I haved checked in Database ,one Check constraint is there in SOP10200 with constraint name.

How can i overcome this error ?. please help me any one

Thanks,

Pavan G.

Categories:
  • Tim Wappat Profile Picture
    Tim Wappat 5,701 on at
    RE: REQUESTSHIPDATE IN Dynamics GP

    DateTime.Now.Date

    Note the date in above answer, this is what strips out the the time.

    .now will return a time element, pipe it through .Date to get rid of the time.

    Tim.

  • PavanBujji Profile Picture
    PavanBujji 180 on at
    RE: REQUESTSHIPDATE IN Dynamics GP

    Tim, Same error is occuring when i use Datetime.now in the request.

    Any ideas ?.

  • PavanBujji Profile Picture
    PavanBujji 180 on at
    RE: REQUESTSHIPDATE IN Dynamics GP

    I passed the same data  (salesLine.ReqShipDate = DateTime.UtcNow.AddDays(7).ToString();) to the eConnect, but i added 7 days to the Current date , because its client's requirement . Now i will try with out UTC time.

  • Tim Wappat Profile Picture
    Tim Wappat 5,701 on at
    RE: REQUESTSHIPDATE IN Dynamics GP

    Examples of returning only date part of datetime in c#

    DateTime.Now.Date

    or

    DateTime.Now.Date.ToString()

    And yes it is possible to pass through and set the requested ship date using this eConnect node. If using econenct serialization assembly,

    .ReqShipDate = DateTime.Now.Date.ToString()

  • PavanBujji Profile Picture
    PavanBujji 180 on at
    RE: REQUESTSHIPDATE IN Dynamics GP

    Yes Tim,

    Constraint is same in DB.. My Question is , Is it posible to pass the Date time in the REQUEST SHIP DATE field. If Yes,then tell me the process and if no ,then could you tell me the reason.

    Thanks,

    Pavan G.

  • Tim Wappat Profile Picture
    Tim Wappat 5,701 on at
    RE: REQUESTSHIPDATE IN Dynamics GP

    I'm guessing without investigating, that you are passing a non zero time part through eConnect.

    Mostly GP SQL datetime fields only allow use of the date part, the time must be zero. I'm betting this is your problem.

    Constraint will be...

    (datepart(hour,[ReqShipDate])=(0) AND datepart(minute,[ReqShipDate])=(0) AND datepart(second,[ReqShipDate])=(0) AND datepart(millisecond,[ReqShipDate])=(0))

    Tim.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans