Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Making Maintain Charges mandatory at So Confirmation Level

Posted on by 1,534

Hi expert, i want to make maintain charges mandatory on Sales Order Confirmation level, i.e system check before posting so confirmation that maintain charges are inserted for that SO. if yes then system allow me to post so confirmation , and if not then system throw error, 

plz guide.

*This post is locked for comments

  • munsif Profile Picture
    munsif 1,534 on at
    RE: Making Maintain Charges mandatory at So Confirmation Level

    i have override check method in salesconfirmjournalCreate class with following code, but it did not working, plz guide me where i making mistake,

    protected boolean check()

    {

       boolean ret;

        MarkUpTrans  markUpTrans;

       //boolean ret;

    salesTable      salesTableLocal;

      // ret=super();

    select firstonly RecId from salesTableLocal

    join  salesTable

    where salesTableLocal.salesId == salesTable.salesId

    notexists join  salesTableLocal

    where salesTableLocal.RecId == markUpTrans.TransRecId

     && salesTableLocal.tableId == markupTrans.TransTableId;

    // && salesTableLocal.salesId == salesTable.salesId; // salesTable variable is already available

    if (markupTrans.MarkupCode=='' && salesTableLocal.ExFor==ExFor::For)

    {

    ret=checkFailed("Please update Charges Code ");

       //ret=false;

    }

      //return  ret;

      ret = super();

       return ret;

    }

  • munsif Profile Picture
    munsif 1,534 on at
    RE: Making Maintain Charges mandatory at So Confirmation Level

    yes but i did not understand!

  • munsif Profile Picture
    munsif 1,534 on at
    RE: Making Maintain Charges mandatory at So Confirmation Level

    static void Job79(Args _args)
    {
    SalesTable sales;
    MarkupTrans t;
    MarkupTable m;
    SalesLine l;
    select * from sales
    join l
    where sales.SalesId==l.SalesId && sales.SalesId=='xxxxxxxx'
    notExists join t
    where t.TransTableId==l.TableId && t.TransRecId==l.RecId
    join m where t.MarkupCode==t.MarkupCode && t.ModuleType==t.ModuleType;

    if(l.ExFor==ExFor::For && t.MarkupCode=="")
    {
    error("Please Update Codes For Sales");
    }
    else
    {
    info(strFmt("SalesId: %1, %2,%3",sales.SalesId,t.Value,t.MarkupCode));
    }
    }

    this is my code in job, its working at job level, now question is that how to implement it on form level..plz guide

  • munsif Profile Picture
    munsif 1,534 on at
    RE: Making Maintain Charges mandatory at So Confirmation Level

    i did not understand how to do that!

  • Suggested answer
    Sohaib Cheema Profile Picture
    Sohaib Cheema 46,610 User Group Leader on at
    RE: Making Maintain Charges mandatory at So Confirmation Level

    You can add any logic on next class

    \Classes\SalesConfirmJournalCreate

    There are methods like checkline, checkHeader etc.

    Not sure what issue you are facing while getting this done.

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans