Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Activity type in CRM

(0) ShareShare
ReportReport
Posted on by 5,007

We would like to make the "Dispute Amount" field a required field.

If the dispute amount value does not meet the requirements of the Activity Type.

we would like to add logic to alert the creator of the CRM case through a pop up message

Example: An invoice challenge activity type must be greater than or equal to $50. If the value is not greater than or equal to $50, then the activity type would need to be an invoice write off.

The pop up message for either Activity Type (Invoice Challenge >= $50, Invoice Write Off <=$50) that does not meet the criteria would read (for dispute amounts that equal $50.00 should be able to be either an invoice challenge or an invoice write off and will not receive an error message

So to recap...if I enter an invoice challenge or invoice write off for $50.00 - I will not receive an error message by choosing either option

If I enter an invoice challenge for $49.99, I will receive a pop-up message
If I enter an invoice write off for $50.01, I will receive a pop-up message

*This post is locked for comments

  • sandeepc Profile Picture
    sandeepc 5,007 on at
    RE: Activity type in CRM

    for (var i = 0; i < document.getElementById("new_acttype_i").options.length; i++)

    {

                   if (document.getElementById("new_acttype_i")== "Invoice Challenge")

                   {

                      alert(" Invoice Challenge");

                  }

                    else

                       {

                         alert("");

                          }

           }

    i changed the code as there is no error but no action is performing i am getting in a loop

  • sandeepc Profile Picture
    sandeepc 5,007 on at
    RE: Activity type in CRM

    5556.err.PNG

  • PS Profile Picture
    PS 23,577 on at
    RE: Activity type in CRM

    Can you share the error message

  • sandeepc Profile Picture
    sandeepc 5,007 on at
    RE: Activity type in CRM

    as i added this code . but its showing an error message

  • sandeepc Profile Picture
    sandeepc 5,007 on at
    RE: Activity type in CRM

    function checkdisputeAmount()

    {

    if(Xrm.Page.getAttribute("Dispute amount >=$50").getValue()!="null")

    {

    var disputeAmount=Xrm.Page.getAttribute("invoice challenge").getValue();

    if(dsiputeAmount <=$50)

    {

    alert("invoice write off");

    }

                   var disputeAmount=Xrm.Page.getAttribute("disputeAmount").getValue();

                   if(disputeAmount=="$50")                

                   {

                          alert("either invoice challenge /invoice write off");

                   }

           }

    }

  • Tim Dutcher Profile Picture
    Tim Dutcher 2,100 on at
    RE: Activity type in CRM

    In my opinion... the purpose of this forum is for Dynamics CRM users, developers, etc. to share experience, advice, links and small amounts of sample code. It is not intended as a place to ask others to write complete (fully written, tested, production-ready) scripts or applications.

    My recommendation is for you to try to code this incrementally and verify the code along the way. Once you have the basics of your script/functions working, and if you are still having problems with one or two aspects of the code, then please post the code that you've written so far so others can help get you past specific problems you're facing.

  • sandeepc Profile Picture
    sandeepc 5,007 on at
    RE: Activity type in CRM

    Hi all i still confsued of how to acheive it

  • sandeepc Profile Picture
    sandeepc 5,007 on at
    RE: Activity type in CRM

    any suggestions??/ as requirement was urgent

  • sandeepc Profile Picture
    sandeepc 5,007 on at
    RE: Activity type in CRM

    7713.crm2.PNG Here there is a field Dispute Amount

    7713.crm2.PNGHere there is a field Activity type: Invoice challenge/Invoice Write off

    Requirement :

    if Dispute amount >=$50
    {
    then

    activity type= Invoice challenge

    // They need to add an logic to alert creator Through pop up message

    (alert popup message("invoice challenge "));
    )

    if Dispute amount= <=$50
    {
    then

    activity type = invoice write off

    // They need to add an logic to alert creator Through pop up message

    (alert through popup message("invoice write off "));
    }

    if Dispute amount =$50
    {
    then

    activity type = ("either invoice challenge /invoice write off")

    // no pop up message should come

    could any one please help me out to solve this.. as the written code is just to make understand you guys clearly

    So to recap...if I enter an invoice challenge or invoice write off for $50.00 - I will not receive an error message by choosing either option

    If I enter an invoice challenge for $49.99, I will receive a pop-up message
    If I enter an invoice write off for $50.01, I will receive a pop-up message

    Please let me know if you have any questions

  • Verified answer
    PS Profile Picture
    PS 23,577 on at
    RE: Activity type in CRM

    Hi Sandeep

    See if this helps:

    You can take an idea from this:

    function checkblk()

    {

    if(Xrm.Page.getAttribute("attribute1").getValue()!="null")

    {

    var blk=Xrm.Page.getAttribute("new_blacklistedinformation").getValue();

    if(blk=="1")

    {

    alert("Are you sure, you want to punch an order for this customer ?");

    }

                   var st=Xrm.Page.getAttribute("bis_supporttype").getValue();

                   if(st=="1")                

                   {

                          alert("This customer has - Standard Support");

                   }

           }

    }

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

Featured topics

Product updates

Dynamics 365 release plans